@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,25 @@
|
|
|
1
|
+
import type { DefaultChildrenType } from '../../typings/globals';
|
|
2
|
+
import type { JSX } from "react";
|
|
3
|
+
interface Props {
|
|
4
|
+
/**
|
|
5
|
+
* Accept a React node as children.
|
|
6
|
+
*/
|
|
7
|
+
children: DefaultChildrenType;
|
|
8
|
+
/**
|
|
9
|
+
* The access token to authenticate the API calls.
|
|
10
|
+
*/
|
|
11
|
+
accessToken: string;
|
|
12
|
+
/**
|
|
13
|
+
* The endpoint to make the API calls. e.g. https://yourdomain.commercelayer.io
|
|
14
|
+
*/
|
|
15
|
+
endpoint?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The domain to make the API calls. e.g. commercelayer.io
|
|
18
|
+
*/
|
|
19
|
+
domain?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* CommerceLayer component
|
|
23
|
+
*/
|
|
24
|
+
export declare function CommerceLayer(props: Props): JSX.Element;
|
|
25
|
+
export default CommerceLayer;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommerceLayer=CommerceLayer;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),ErrorBoundary_1=tslib_1.__importDefault(require("../utils/ErrorBoundary")),jwt_1=require("../../utils/jwt");function CommerceLayer(props){var _a;const{children}=props,p=tslib_1.__rest(props,["children"]);if(!p.endpoint){const{organization}=(0,jwt_1.jwt)(p.accessToken);p.endpoint=`https://${organization.slug}.${(_a=p.domain)!==null&&_a!==void 0?_a:"commercelayer.io"}`}return(0,jsx_runtime_1.jsx)(ErrorBoundary_1.default,{children:(0,jsx_runtime_1.jsx)(CommerceLayerContext_1.default.Provider,{value:Object.assign({},p),children})})}exports.default=CommerceLayer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReactNode, type JSX } from 'react';
|
|
2
|
+
interface Props extends Omit<JSX.IntrinsicElements['form'], 'onSubmit'> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
reset?: boolean;
|
|
5
|
+
errorClassName?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Array of countries that have states has select options. Ignore this if you are not overriding the default states list.
|
|
8
|
+
* If you are overriding the default states list, you must pass the countries that have states as select options.
|
|
9
|
+
*/
|
|
10
|
+
countriesWithPredefinedStateOptions?: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function CustomerAddressForm(props: Props): JSX.Element;
|
|
13
|
+
export default CustomerAddressForm;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomerAddressForm=CustomerAddressForm;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),AddressContext_1=tslib_1.__importDefault(require("../../context/AddressContext")),rapid_form_1=require("rapid-form"),react_1=require("react"),CustomerAddressFormContext_1=tslib_1.__importDefault(require("../../context/CustomerAddressFormContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),countryStateCity_1=require("../../utils/countryStateCity");function CustomerAddressForm(props){const{children,errorClassName,autoComplete="on",reset=!1,countriesWithPredefinedStateOptions}=props,p=tslib_1.__rest(props,["children","errorClassName","autoComplete","reset","countriesWithPredefinedStateOptions"]),{validation,values,errors,reset:resetForm}=(0,rapid_form_1.useRapidForm)(),{setAddressErrors,setAddress}=(0,react_1.useContext)(AddressContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),ref=(0,react_1.useRef)(null);(0,react_1.useEffect)(()=>{var _a,_b,_c,_d;if(Object.keys(errors).length>0){const formErrors=[];for(const fieldName in errors){const code=(_a=errors[fieldName])===null||_a===void 0?void 0:_a.code,message=((_b=errors[fieldName])===null||_b===void 0?void 0:_b.message)||"";fieldName==="billing_address_state_code"?values.state_code?delete errors[fieldName]:formErrors.push({code,message,resource:"billing_address",field:fieldName}):formErrors.push({code,message,resource:"billing_address",field:fieldName})}setAddressErrors(formErrors,"billing_address")}else if(Object.keys(values).length>0){setAddressErrors([],"billing_address");for(const name in values){const field=values[name];if(field?.value&&(values[name.replace("billing_address_","")]=field.value,delete values[name]),["billing_address_state_code"].includes(name)){const countryCode=((_c=values.billing_address_country_code)===null||_c===void 0?void 0:_c.value)||values.country_code;!(0,countryStateCity_1.isEmptyStates)({countryCode,countriesWithPredefinedStateOptions})&&!field.value&&delete values.billing_address_state_code}}setAddress({values,resource:"billing_address"})}reset&&(Object.keys(values).length>0||Object.keys(errors).length>0)&&ref&&((_d=ref.current)===null||_d===void 0||_d.reset(),resetForm({target:ref.current}),setAddressErrors([],"billing_address"),setAddress({values:{},resource:"billing_address"}))},[errors,values,reset]);const providerValues={values,validation,setValue:(name,value)=>{const field={[name.replace("billing_address_","")]:value};setAddress({values:Object.assign(Object.assign({},values),field),resource:"billing_address"})},errorClassName,requiresBillingInfo:order?.requires_billing_info||!1,errors,resetField:name=>{resetForm({currentTarget:ref.current},name)}};return(0,jsx_runtime_1.jsx)(CustomerAddressFormContext_1.default.Provider,{value:providerValues,children:(0,jsx_runtime_1.jsx)("form",Object.assign({ref,autoComplete},p,{children}))})}exports.default=CustomerAddressForm;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { DefaultChildrenType } from '../../typings/globals';
|
|
3
|
+
import type { QueryPageSize } from '@commercelayer/sdk';
|
|
4
|
+
interface Props {
|
|
5
|
+
children: DefaultChildrenType;
|
|
6
|
+
/**
|
|
7
|
+
* Customer type
|
|
8
|
+
*/
|
|
9
|
+
isGuest?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The page size
|
|
12
|
+
* default: 10
|
|
13
|
+
*/
|
|
14
|
+
addressesPageSize?: QueryPageSize;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Main container for the Customers components.
|
|
18
|
+
* It stores - in its context - the details of an active customer, if present.
|
|
19
|
+
*
|
|
20
|
+
* It also accept a `isGuest` prop to define if no customer is currently set as active.
|
|
21
|
+
*
|
|
22
|
+
* <span title='Requirements' type='warning'>
|
|
23
|
+
* Must be a child of the `<CommerceLayer>` component.
|
|
24
|
+
* </span>
|
|
25
|
+
* <span title='Children' type='info'>
|
|
26
|
+
* `<CustomerField>`,
|
|
27
|
+
* `<CustomerInput>`,
|
|
28
|
+
* `<SaveCustomerButton>`,
|
|
29
|
+
* `<AddressesContainer>`,
|
|
30
|
+
* `<AddressesEmpty>`,
|
|
31
|
+
* `<CustomerPaymentSource>`,
|
|
32
|
+
* `<CustomerPaymentSourceEmpty>`,
|
|
33
|
+
* `<PaymentMethodsContainer>`,
|
|
34
|
+
* `<OrdersList>`
|
|
35
|
+
* </span>
|
|
36
|
+
*/
|
|
37
|
+
export declare function CustomerContainer(props: Props): JSX.Element;
|
|
38
|
+
export default CustomerContainer;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomerContainer=CustomerContainer;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),CustomerReducer_1=tslib_1.__importStar(require("../../reducers/CustomerReducer")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),isGuestToken_1=require("../../utils/isGuestToken");function CustomerContainer(props){const{children,isGuest,addressesPageSize:pageSize}=props,[state,dispatch]=(0,react_1.useReducer)(CustomerReducer_1.default,CustomerReducer_1.customerInitialState),{order,addResourceToInclude,include,updateOrder,includeLoaded,withoutIncludes}=(0,react_1.useContext)(OrderContext_1.default),config=(0,react_1.useContext)(CommerceLayerContext_1.default);(0,react_1.useEffect)(()=>{if(config.accessToken){if(isGuest??(0,isGuestToken_1.isGuestToken)(config.accessToken))return;include?.includes("available_customer_payment_sources.payment_source")?includeLoaded?.["available_customer_payment_sources.payment_source"]||addResourceToInclude({newResourceLoaded:{"available_customer_payment_sources.payment_source":!0,"available_customer_payment_sources.payment_method":!0}}):addResourceToInclude({newResource:["available_customer_payment_sources.payment_source","available_customer_payment_sources.payment_method"]})}},[config.accessToken,include?.length,Object.keys(includeLoaded??{}).length]),(0,react_1.useEffect)(()=>{if(config.accessToken){if(isGuest??(0,isGuestToken_1.isGuestToken)(config.accessToken))return;state.customers==null&&(0,CustomerReducer_1.getCustomerInfo)({config,dispatch}),state.addresses==null&&(0,CustomerReducer_1.getCustomerAddresses)({config,dispatch,isOrderAvailable:withoutIncludes!=null,pageSize}),order?.available_customer_payment_sources&&(0,CustomerReducer_1.getCustomerPaymentSources)({dispatch,order}),config.accessToken&&order==null&&include==null&&includeLoaded==null&&withoutIncludes===void 0&&function(){return tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,CustomerReducer_1.getCustomerOrders)({config,dispatch}),yield(0,CustomerReducer_1.getCustomerSubscriptions)({config,dispatch}),yield(0,CustomerReducer_1.getCustomerPayments)({config,dispatch})})}()}},[config.accessToken,order?.payment_source!=null,isGuest]);const contextValue=(0,react_1.useMemo)(()=>Object.assign(Object.assign({isGuest},state),{saveCustomerUser:customerEmail=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,CustomerReducer_1.saveCustomerUser)({config,customerEmail,dispatch,updateOrder,order})}),setCustomerErrors:errors=>{(0,CustomerReducer_1.setCustomerErrors)(errors,dispatch)},setCustomerEmail:customerEmail=>{(0,CustomerReducer_1.setCustomerEmail)(customerEmail,dispatch)},getCustomerPaymentSources:()=>{(0,CustomerReducer_1.getCustomerPaymentSources)({dispatch,order})},deleteCustomerAddress:_a=>tslib_1.__awaiter(this,[_a],void 0,function*({customerAddressId}){yield(0,CustomerReducer_1.deleteCustomerAddress)({customerAddressId,dispatch,config,addresses:state.addresses})}),setResourceTrigger:props2=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield(0,CustomerReducer_1.setResourceTrigger)(Object.assign(Object.assign({},props2),{dispatch,config}))}),createCustomerAddress:address=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,CustomerReducer_1.createCustomerAddress)({address,config,dispatch,state})}),getCustomerOrders:_a=>tslib_1.__awaiter(this,[_a],void 0,function*({pageNumber,pageSize:pageSize2}){yield(0,CustomerReducer_1.getCustomerOrders)({config,dispatch,pageNumber,pageSize:pageSize2})}),getCustomerSubscriptions:_a=>tslib_1.__awaiter(this,[_a],void 0,function*({pageNumber,pageSize:pageSize2,id}){yield(0,CustomerReducer_1.getCustomerSubscriptions)({config,dispatch,pageNumber,pageSize:pageSize2,id})}),reloadCustomerAddresses:()=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,CustomerReducer_1.getCustomerAddresses)({config,dispatch,isOrderAvailable:withoutIncludes!=null,pageSize})})}),[state,isGuest]);return(0,jsx_runtime_1.jsx)(CustomerContext_1.default.Provider,{value:contextValue,children})}exports.default=CustomerContainer;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ConditionalElement } from '../../typings/index';
|
|
2
|
+
import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
|
|
3
|
+
import type { JSX } from "react";
|
|
4
|
+
type StockTransferFieldChildrenProps = TGenericChildrenProps<TResources['Customer']>;
|
|
5
|
+
type TCondition = ConditionalElement<Exclude<TResources['Customer'], 'resource'>>;
|
|
6
|
+
type Props = {
|
|
7
|
+
children?: (props: StockTransferFieldChildrenProps) => JSX.Element;
|
|
8
|
+
} & TCondition;
|
|
9
|
+
/**
|
|
10
|
+
* The CustomerField component displays any attribute of the `customer` set in the state of the parent `<CustomerContainer>` component.
|
|
11
|
+
*
|
|
12
|
+
* It also accepts a `tagElement` props to enable specific tag-related props.
|
|
13
|
+
* For examples, when `tagElement` is set to `img` it will also accept props related to `<img>` tag such as `height` and `width`.
|
|
14
|
+
*
|
|
15
|
+
* <span title="Requirement" type="warning">
|
|
16
|
+
* It must to be used inside the `<CustomerContainer>` component.
|
|
17
|
+
* </span>
|
|
18
|
+
*
|
|
19
|
+
* <span title="Fields" type="info">
|
|
20
|
+
* Check the `customers` resource from our [Core API documentation](https://docs.commercelayer.io/core/v/api-reference/customers/object)
|
|
21
|
+
* for more details about the available attributes to render.
|
|
22
|
+
* </span>
|
|
23
|
+
*/
|
|
24
|
+
export declare function CustomerField<P extends Props>(props: P): JSX.Element;
|
|
25
|
+
export default CustomerField;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomerField=CustomerField;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),GenericFieldComponent_1=tslib_1.__importDefault(require("../utils/GenericFieldComponent")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext"));function CustomerField(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:"customers",attribute,tagElement,context:CustomerContext_1.default},p,{children}))}exports.default=CustomerField;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { BaseInputComponentProps } from '../../typings/index';
|
|
3
|
+
type Props = {
|
|
4
|
+
name?: 'customer_email' | string;
|
|
5
|
+
type?: 'email' | string;
|
|
6
|
+
saveOnBlur?: boolean;
|
|
7
|
+
onBlur?: (email: string) => void;
|
|
8
|
+
errorClassName?: string;
|
|
9
|
+
} & Omit<BaseInputComponentProps, 'name' | 'type' | 'onBlur'> & Omit<JSX.IntrinsicElements['input'], 'children'> & Omit<JSX.IntrinsicElements['textarea'], 'children'>;
|
|
10
|
+
export declare function CustomerInput(props: Props): JSX.Element;
|
|
11
|
+
export default CustomerInput;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomerInput=CustomerInput;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),BaseInput_1=tslib_1.__importDefault(require("../utils/BaseInput")),rapid_form_1=require("rapid-form"),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),validateFormFields_1=require("../../utils/validateFormFields"),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext"));function CustomerInput(props){const{name="customer_email",placeholder="",required=!0,saveOnBlur=!1,type="email",value,onBlur,className,errorClassName}=props,p=tslib_1.__rest(props,["name","placeholder","required","saveOnBlur","type","value","onBlur","className","errorClassName"]),{validation,values,errors,setError}=(0,rapid_form_1.useRapidForm)({fieldEvent:"blur"}),{saveCustomerUser,setCustomerErrors,setCustomerEmail}=(0,react_1.useContext)(CustomerContext_1.default),{setOrderErrors}=(0,react_1.useContext)(OrderContext_1.default),[hasError,setHasError]=(0,react_1.useState)(!1),handleOnBlur=e=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a;const v=(_a=e?.target)===null||_a===void 0?void 0:_a.value,checkValue=(0,validateFormFields_1.validateValue)(v,name,type,"orders"),isValid=Object.keys(checkValue).length===0;if(saveOnBlur&&Object.keys(values).length>0&&saveCustomerUser!=null&&(yield saveCustomerUser(values[name].value),onBlur&&onBlur(values[name].value)),!isValid){const currentError=Object.assign(Object.assign({},checkValue),{name:checkValue?.field});setError(currentError)}});(0,react_1.useEffect)(()=>{var _a,_b;if(Object.keys(errors).length>0){const formErrors=[];for(const fieldName in errors){const code=(_a=errors[fieldName])===null||_a===void 0?void 0:_a.code,message=(_b=errors[fieldName])===null||_b===void 0?void 0:_b.message;formErrors.push({code,message:message||"",resource:"orders",field:fieldName})}formErrors.length>0&&(setHasError(!0),setCustomerErrors&&setCustomerErrors(formErrors))}else setCustomerErrors&&setCustomerErrors([]),setOrderErrors&&setOrderErrors([]),setHasError(!1);return Object.keys(values).length>0&&setCustomerEmail&&setCustomerEmail(values[name].value),()=>{setHasError(!1)}},[errors]);const classNameComputed=`${className??""} ${hasError&&errorClassName?errorClassName:""}`;return(0,jsx_runtime_1.jsx)(BaseInput_1.default,Object.assign({name,type,ref:validation,required,placeholder,defaultValue:value,onBlur:e=>{handleOnBlur(e)},className:classNameComputed},p))}exports.default=CustomerInput;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DefaultChildrenType } from '../../typings/globals';
|
|
2
|
+
import { type JSX } from 'react';
|
|
3
|
+
interface Props {
|
|
4
|
+
children?: DefaultChildrenType;
|
|
5
|
+
/**
|
|
6
|
+
* Customize the loader content.
|
|
7
|
+
*/
|
|
8
|
+
loader?: string | JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export declare function CustomerPaymentSource({ children, loader }: Props): JSX.Element;
|
|
11
|
+
export default CustomerPaymentSource;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomerPaymentSource=CustomerPaymentSource;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),CustomerPaymentSourceContext_1=tslib_1.__importDefault(require("../../context/CustomerPaymentSourceContext")),getCardDetails_1=tslib_1.__importDefault(require("../../utils/getCardDetails")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext")),react_1=require("react");function CustomerPaymentSource({children,loader="Loading..."}){const[loading,setLoading]=(0,react_1.useState)(!0),{payments}=(0,useCustomContext_1.default)({context:CustomerContext_1.default,contextComponentName:"CustomerContainer",currentComponentName:"CustomerPaymentSource",key:"payments"});(0,react_1.useEffect)(()=>(payments!=null&&setLoading(!1),()=>{setLoading(!0)}),[payments!=null]);const provider=payments?.filter(p=>p?.payment_source!=null).map(p=>{var _a;const paymentType=(_a=p.payment_source)===null||_a===void 0?void 0:_a.type,customerPayment=p,cardDetails=(0,getCardDetails_1.default)({paymentType,customerPayment}),value=Object.assign({},cardDetails);return(0,jsx_runtime_1.jsx)(CustomerPaymentSourceContext_1.default.Provider,{value,children},p.id)});return loading?(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:loader}):(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:provider})}exports.default=CustomerPaymentSource;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
2
|
+
import type { JSX } from "react";
|
|
3
|
+
interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
|
|
4
|
+
/**
|
|
5
|
+
* Function allow you to customize the component
|
|
6
|
+
*/
|
|
7
|
+
children?: ChildrenFunction<Omit<Props, 'children'>>;
|
|
8
|
+
/**
|
|
9
|
+
* Label to show. Default: 'No payments available.'
|
|
10
|
+
*/
|
|
11
|
+
emptyText?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function CustomerPaymentSourceEmpty({ children, emptyText, ...p }: Props): JSX.Element | null;
|
|
14
|
+
export default CustomerPaymentSourceEmpty;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomerPaymentSourceEmpty=CustomerPaymentSourceEmpty;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext"));function CustomerPaymentSourceEmpty(_a){var{children,emptyText="No payments available"}=_a,p=tslib_1.__rest(_a,["children","emptyText"]);const{payments}=(0,useCustomContext_1.default)({context:CustomerContext_1.default,contextComponentName:"CustomerContainer",currentComponentName:"CustomerPaymentSourceEmpty",key:"payments"}),parentProps=Object.assign({emptyText},p);return payments!=null&&payments.length>0||payments===null?null:children!==void 0?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},p,{children:emptyText}))}exports.default=CustomerPaymentSourceEmpty;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
3
|
+
interface ChildrenProps extends Omit<Props, 'children'> {
|
|
4
|
+
/**
|
|
5
|
+
* The link href
|
|
6
|
+
*/
|
|
7
|
+
href: string;
|
|
8
|
+
/**
|
|
9
|
+
* The link status
|
|
10
|
+
*/
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface Props extends Omit<JSX.IntrinsicElements['a'], 'children'> {
|
|
14
|
+
/**
|
|
15
|
+
* A render function to render your own custom component
|
|
16
|
+
*/
|
|
17
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
18
|
+
/**
|
|
19
|
+
* The label of the link
|
|
20
|
+
*/
|
|
21
|
+
label?: string | JSX.Element;
|
|
22
|
+
/**
|
|
23
|
+
* The domain of your forked application
|
|
24
|
+
*/
|
|
25
|
+
customDomain?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* This component generates a link to the hosted mfe-my-account application.
|
|
29
|
+
* In this way you can connect your shop application with our hosted micro-frontend and let your customers manage their account with zero code.
|
|
30
|
+
*
|
|
31
|
+
* <span title="Requirement" type="warning">
|
|
32
|
+
* Must be a child of the `<CustomerContainer>` component. <br />
|
|
33
|
+
* </span>
|
|
34
|
+
*
|
|
35
|
+
* @link https://github.com/commercelayer/mfe-my-account
|
|
36
|
+
*/
|
|
37
|
+
export declare function MyAccountLink(props: Props): JSX.Element;
|
|
38
|
+
export default MyAccountLink;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MyAccountLink=MyAccountLink;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),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"),jwt_1=require("../../utils/jwt"),organization_1=require("../../utils/organization");function MyAccountLink(props){const{label="Go to my account",children,customDomain}=props,p=tslib_1.__rest(props,["label","children","customDomain"]),{accessToken,endpoint}=(0,react_1.useContext)(CommerceLayerContext_1.default);if(accessToken==null||endpoint==null)throw new Error("Cannot use `MyAccountLink` outside of `CommerceLayer`");const{domain,slug}=(0,getDomain_1.getDomain)(endpoint),disabled=!("owner"in(0,jwt_1.jwt)(accessToken)),href=(0,getApplicationLink_1.getApplicationLink)({slug,accessToken,applicationType:"my-account",domain,customDomain}),parentProps=Object.assign({disabled,label,href},p);function handleClick(e){!disabled&&accessToken&&endpoint&&(0,organization_1.getOrganizationConfig)({accessToken,endpoint,params:{accessToken,slug}}).then(config=>{var _a;!((_a=config?.links)===null||_a===void 0)&&_a.my_account&&(e.preventDefault(),location.href=config.links.my_account)})}return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("a",Object.assign({"aria-disabled":disabled,onClick:handleClick,href},p,{children:label}))}exports.default=MyAccountLink;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
3
|
+
interface ChildrenProps extends Omit<Props, 'children'> {
|
|
4
|
+
/**
|
|
5
|
+
* The link href
|
|
6
|
+
*/
|
|
7
|
+
href: string;
|
|
8
|
+
}
|
|
9
|
+
interface Props extends Omit<JSX.IntrinsicElements['a'], 'children'> {
|
|
10
|
+
/**
|
|
11
|
+
* A render function to render your own custom component
|
|
12
|
+
*/
|
|
13
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
14
|
+
/**
|
|
15
|
+
* The label of the link
|
|
16
|
+
*/
|
|
17
|
+
label: string | JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* The type of the link
|
|
20
|
+
*/
|
|
21
|
+
type: 'login' | 'signup';
|
|
22
|
+
/**
|
|
23
|
+
* The client id of the Commerce Layer application
|
|
24
|
+
*/
|
|
25
|
+
clientId: string;
|
|
26
|
+
/**
|
|
27
|
+
* The scope of the Commerce Layer application
|
|
28
|
+
*/
|
|
29
|
+
scope: string;
|
|
30
|
+
/**
|
|
31
|
+
* The return url to redirect the user after the login/signup
|
|
32
|
+
*/
|
|
33
|
+
returnUrl?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The domain of your forked application
|
|
36
|
+
*/
|
|
37
|
+
customDomain?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The reset password url
|
|
40
|
+
*/
|
|
41
|
+
resetPasswordUrl?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* This component generates a link to the hosted mfe-identity application.
|
|
45
|
+
*
|
|
46
|
+
* In this way you can connect your shop application with our hosted micro-frontend and let your customers manage their account with zero code.
|
|
47
|
+
*
|
|
48
|
+
* <span title="Requirement" type="warning">
|
|
49
|
+
* Must be a child of the `<CommerceLayer>` component.
|
|
50
|
+
* </span>
|
|
51
|
+
*
|
|
52
|
+
* <span title="My Identity" type="info">
|
|
53
|
+
* The Commerce Layer Identity micro frontend (React) provides you with an application, powered by Commerce Layer APIs, handling customer login and sign-up functionalities
|
|
54
|
+
* </span>
|
|
55
|
+
*
|
|
56
|
+
* @link https://github.com/commercelayer/mfe-identity
|
|
57
|
+
*/
|
|
58
|
+
export declare function MyIdentityLink(props: Props): JSX.Element;
|
|
59
|
+
export default MyIdentityLink;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MyIdentityLink=MyIdentityLink;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),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 MyIdentityLink(props){const{label,children,type,clientId,scope,returnUrl,customDomain,resetPasswordUrl}=props,p=tslib_1.__rest(props,["label","children","type","clientId","scope","returnUrl","customDomain","resetPasswordUrl"]),{accessToken,endpoint}=(0,react_1.useContext)(CommerceLayerContext_1.default),[href,setHref]=(0,react_1.useState)(void 0);if(accessToken==null||endpoint==null)throw new Error("Cannot use `MyIdentityLink` outside of `CommerceLayer`");const{domain,slug}=(0,getDomain_1.getDomain)(endpoint);(0,react_1.useEffect)(()=>(accessToken&&endpoint&&(0,organization_1.getOrganizationConfig)({accessToken,endpoint,params:{accessToken,slug}}).then(config=>{var _a;if(!((_a=config?.links)===null||_a===void 0)&&_a.identity)setHref(config.links.identity);else{const link=(0,getApplicationLink_1.getApplicationLink)({slug,accessToken,applicationType:"identity",domain,modeType:type,clientId,scope,returnUrl:returnUrl??window.location.href,resetPasswordUrl,customDomain});setHref(link)}}),()=>{setHref(void 0)}),[accessToken,endpoint]);const parentProps=Object.assign({label,href,clientId,scope},p);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("a",Object.assign({href},p,{children:label}))}exports.default=MyIdentityLink;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode, type JSX } from 'react';
|
|
2
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
3
|
+
interface ChildrenProps extends Omit<Props, 'children'> {
|
|
4
|
+
handleClick: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface Props extends Omit<JSX.IntrinsicElements['button'], 'children'> {
|
|
7
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
8
|
+
label?: string | ReactNode;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function SaveCustomerButton(props: Props): JSX.Element;
|
|
12
|
+
export default SaveCustomerButton;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SaveCustomerButton=SaveCustomerButton;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext"));function SaveCustomerButton(props){const{children,label="Save",resource,disabled,onClick}=props,p=tslib_1.__rest(props,["children","label","resource","disabled","onClick"]),{errors,saveCustomerUser,customerEmail}=(0,react_1.useContext)(CustomerContext_1.default),disable=disabled||!(0,isEmpty_1.default)(errors)||(0,isEmpty_1.default)(customerEmail),handleClick=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){(0,isEmpty_1.default)(errors)&&!disable&&customerEmail!=null&&(saveCustomerUser&&(yield saveCustomerUser(customerEmail)),onClick&&onClick())}),parentProps=Object.assign(Object.assign({},p),{label,resource,handleClick,disabled:disable});return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("button",Object.assign({type:"button",disabled:disable,onClick:()=>{handleClick()}},p,{children:label}))}exports.default=SaveCustomerButton;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { CodeErrorType } from '../../typings/errors';
|
|
3
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
4
|
+
export type TResourceError = 'addresses' | 'billing_address' | 'gift_cards' | 'gift_card_or_coupon_code' | 'line_items' | 'orders' | 'payment_methods' | 'prices' | 'shipments' | 'shipping_address' | 'customer_address' | 'sku_options' | 'variant' | 'in_stock_subscriptions';
|
|
5
|
+
type ErrorChildrenComponentProps = ChildrenFunction<Omit<TErrorComponent, 'children'> & {
|
|
6
|
+
errors: string[];
|
|
7
|
+
}>;
|
|
8
|
+
export interface TErrorComponent extends Omit<JSX.IntrinsicElements['span'], 'children'> {
|
|
9
|
+
/**
|
|
10
|
+
* Resource which get the error
|
|
11
|
+
*/
|
|
12
|
+
resource: TResourceError;
|
|
13
|
+
children?: ErrorChildrenComponentProps;
|
|
14
|
+
/**
|
|
15
|
+
* Field which get the error
|
|
16
|
+
*/
|
|
17
|
+
field?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Error message which you can translate
|
|
20
|
+
*/
|
|
21
|
+
messages?: Array<{
|
|
22
|
+
code: CodeErrorType;
|
|
23
|
+
message: string;
|
|
24
|
+
resource?: TResourceError;
|
|
25
|
+
field?: string;
|
|
26
|
+
id?: string;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
type Props = TErrorComponent;
|
|
30
|
+
export declare function Errors(props: Props): JSX.Element;
|
|
31
|
+
export default Errors;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Errors=Errors;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),GiftCardContext_1=tslib_1.__importDefault(require("../../context/GiftCardContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),AddressContext_1=tslib_1.__importDefault(require("../../context/AddressContext")),getAllErrors_1=tslib_1.__importDefault(require("../utils/getAllErrors")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),PaymentMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodChildrenContext")),ShipmentContext_1=tslib_1.__importDefault(require("../../context/ShipmentContext")),InStockSubscriptionContext_1=tslib_1.__importDefault(require("../../context/InStockSubscriptionContext"));function Errors(props){const{children,messages=[],resource,field}=props,p=tslib_1.__rest(props,["children","messages","resource","field"]),{payment}=(0,react_1.useContext)(PaymentMethodChildrenContext_1.default),{errors:orderErrors}=(0,react_1.useContext)(OrderContext_1.default),{errors:giftCardErrors}=(0,react_1.useContext)(GiftCardContext_1.default),{errors:lineItemErrors}=(0,react_1.useContext)(LineItemContext_1.default),{errors:addressErrors}=(0,react_1.useContext)(AddressContext_1.default),{errors:customerErrors}=(0,react_1.useContext)(CustomerContext_1.default),{errors:shipmentErrors}=(0,react_1.useContext)(ShipmentContext_1.default),{errors:inStockSubscriptionErrors}=(0,react_1.useContext)(InStockSubscriptionContext_1.default),{errors:paymentMethodErrors,currentPaymentMethodType,currentPaymentMethodId}=(0,react_1.useContext)(PaymentMethodContext_1.default),{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),allErrors=(0,react_1.useMemo)(()=>[...giftCardErrors||[],...orderErrors||[],...lineItemErrors||[],...customerErrors||[],...shipmentErrors||[],...inStockSubscriptionErrors||[],...paymentMethodErrors?.filter(v=>v.field===currentPaymentMethodType&&payment?.id===currentPaymentMethodId)||[]],[giftCardErrors,orderErrors,lineItemErrors,customerErrors,shipmentErrors,inStockSubscriptionErrors,paymentMethodErrors]).filter((v,k,a)=>{var _a;return v?.code!==((_a=a[k-1])===null||_a===void 0?void 0:_a.code)}),addressesErrors=(0,react_1.useMemo)(()=>[...addressErrors||[]],[addressErrors]),msgErrors=(0,getAllErrors_1.default)({allErrors:[...allErrors,...addressesErrors],field,messages,props:p,lineItem,resource,returnHtml:!children}),parentProps=Object.assign({messages,resource,field,errors:msgErrors},p);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:msgErrors})}exports.default=Errors;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type RefObject, type JSX } from 'react';
|
|
2
|
+
import type { BaseState } from '../../typings/index';
|
|
3
|
+
import type { DefaultChildrenType } from '../../typings/globals';
|
|
4
|
+
interface Props extends Omit<JSX.IntrinsicElements['form'], 'children' | 'ref'> {
|
|
5
|
+
children: DefaultChildrenType;
|
|
6
|
+
onSubmit?: (values: BaseState) => void;
|
|
7
|
+
ref?: RefObject<HTMLFormElement | null>;
|
|
8
|
+
}
|
|
9
|
+
export declare function GiftCard(props: Props): JSX.Element;
|
|
10
|
+
export default GiftCard;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCard=GiftCard;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),validateFormFields_1=tslib_1.__importDefault(require("../../utils/validateFormFields")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty")),GiftCardContext_1=tslib_1.__importDefault(require("../../context/GiftCardContext"));function GiftCard(props){const{children,onSubmit}=props,name="giftCardForm",ref=(0,react_1.useRef)(null),{addGiftCard,addGiftCardError}=(0,react_1.useContext)(GiftCardContext_1.default),handleSubmit=e=>{e.preventDefault();const currentForm=ref.current,elements=currentForm?.elements,{errors,values}=(0,validateFormFields_1.default)(elements,["currencyCode","balanceCents"],"gift_cards");(0,isEmpty_1.default)(errors)?(addGiftCard(values),currentForm?.reset(),onSubmit&&onSubmit(values)):addGiftCardError(errors)};return(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:(0,jsx_runtime_1.jsx)("form",{name,onSubmit:handleSubmit,children},name)})}exports.default=GiftCard;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardContainer=GiftCardContainer;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),GiftCardContext_1=tslib_1.__importDefault(require("../../context/GiftCardContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),GiftCardReducer_1=tslib_1.__importStar(require("../../reducers/GiftCardReducer")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext"));function GiftCardContainer(props){const{children}=props,[state,dispatch]=(0,react_1.useReducer)(GiftCardReducer_1.default,GiftCardReducer_1.giftCardInitialState),config=(0,react_1.useContext)(CommerceLayerContext_1.default),{getOrder,createOrder,order}=(0,react_1.useContext)(OrderContext_1.default),giftCardValue=Object.assign(Object.assign({},state),{addGiftCardRecipient:values=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,GiftCardReducer_1.addGiftCardRecipient)(values,config,dispatch)}),addGiftCard:values=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,GiftCardReducer_1.addGiftCard)(Object.assign({},values),{config,dispatch,getOrder,createOrder,order})}),addGiftCardError:errors=>{(0,GiftCardReducer_1.addGiftCardError)(errors,dispatch)},addGiftCardLoading:loading=>{(0,GiftCardReducer_1.addGiftCardLoading)(loading,dispatch)}});return(0,jsx_runtime_1.jsx)(GiftCardContext_1.default.Provider,{value:giftCardValue,children})}exports.default=GiftCardContainer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BaseSelectComponentProps } from '../../typings/index';
|
|
2
|
+
import type { JSX } from "react";
|
|
3
|
+
type Props = Omit<BaseSelectComponentProps, 'options' | 'name'> & {
|
|
4
|
+
required?: boolean;
|
|
5
|
+
} & Pick<JSX.IntrinsicElements['select'], 'className' | 'id' | 'style'>;
|
|
6
|
+
export declare function GiftCardCurrencySelector(props: Props): JSX.Element;
|
|
7
|
+
export default GiftCardCurrencySelector;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardCurrencySelector=GiftCardCurrencySelector;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),BaseSelect_1=tslib_1.__importDefault(require("../utils/BaseSelect")),currency_1=tslib_1.__importDefault(require("../../config/currency"));function GiftCardCurrencySelector(props){return(0,jsx_runtime_1.jsx)(BaseSelect_1.default,Object.assign({options:currency_1.default,name:"currencyCode"},props))}exports.default=GiftCardCurrencySelector;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BaseInputComponentProps, GiftCardInputName } from '../../typings/index';
|
|
2
|
+
import type { JSX } from "react";
|
|
3
|
+
type Props = {
|
|
4
|
+
name: GiftCardInputName;
|
|
5
|
+
} & Omit<BaseInputComponentProps, 'name'> & Omit<JSX.IntrinsicElements['input'], 'children'> & Omit<JSX.IntrinsicElements['textarea'], 'children'>;
|
|
6
|
+
export declare function GiftCardInput(props: Props): JSX.Element;
|
|
7
|
+
export default GiftCardInput;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardInput=GiftCardInput;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),BaseInput_1=tslib_1.__importDefault(require("../utils/BaseInput"));function GiftCardInput(props){const{placeholder=""}=props,p=tslib_1.__rest(props,["placeholder"]);return(0,jsx_runtime_1.jsx)(BaseInput_1.default,Object.assign({placeholder},p))}exports.default=GiftCardInput;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
import type { ChildrenFunction } from "../../typings/index";
|
|
3
|
+
import type { CodeType } from "../../reducers/OrderReducer";
|
|
4
|
+
interface ChildrenProps extends Omit<Props, "children" | "type"> {
|
|
5
|
+
code?: string | null;
|
|
6
|
+
hide?: boolean;
|
|
7
|
+
discountAmountCents?: number | null;
|
|
8
|
+
discountAmountFloat?: number | null;
|
|
9
|
+
formattedDiscountAmount?: string | null;
|
|
10
|
+
}
|
|
11
|
+
interface Props extends Omit<JSX.IntrinsicElements["span"], "children"> {
|
|
12
|
+
type?: CodeType;
|
|
13
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
14
|
+
}
|
|
15
|
+
export declare function GiftCardOrCouponCode({ children, type, ...props }: Props): JSX.Element | null;
|
|
16
|
+
export default GiftCardOrCouponCode;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponCode=GiftCardOrCouponCode;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")),manageGiftCard_1=require("../../utils/adyen/manageGiftCard");function GiftCardOrCouponCode(_a){var{children,type}=_a,props=tslib_1.__rest(_a,["children","type"]);const{order,manageAdyenGiftCard}=(0,react_1.useContext)(OrderContext_1.default);let codeType=type?`${type}_code`:void 0;!type&&order&&"coupon_code"in order&&order.coupon_code!==""?codeType="coupon_code":type||(codeType="gift_card_code");const code=order&&codeType?order[codeType]:"";let hide=!(order&&code);if(manageAdyenGiftCard&&type==="gift_card"){const giftCardData=(0,manageGiftCard_1.manageGiftCard)({order});if(!giftCardData)return null;hide=!1;const parentProps2=Object.assign(Object.assign({},props),{code:`${giftCardData.cardBrand} ${giftCardData.cardSummary}`,hide});return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps2,{children})):hide?null:(0,jsx_runtime_1.jsx)("span",Object.assign({},props,{children:code}))}const parentProps=Object.assign(Object.assign({},props),{code,hide,discountAmountCents:order?.discount_amount_cents,discountAmountFloat:order?.discount_amount_float,formattedDiscountAmount:order?.formatted_discount_amount});return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):hide?null:(0,jsx_runtime_1.jsx)("span",Object.assign({},props,{children:code}))}exports.default=GiftCardOrCouponCode;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { OrderCodeType } from '../../reducers/OrderReducer';
|
|
3
|
+
import type { Order } from '@commercelayer/sdk';
|
|
4
|
+
import type { DefaultChildrenType } from '../../typings/globals';
|
|
5
|
+
interface Props extends Omit<JSX.IntrinsicElements['form'], 'onSubmit'> {
|
|
6
|
+
codeType?: OrderCodeType;
|
|
7
|
+
children: DefaultChildrenType;
|
|
8
|
+
onSubmit?: (response: {
|
|
9
|
+
success: boolean;
|
|
10
|
+
value: string;
|
|
11
|
+
order?: Order;
|
|
12
|
+
}) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function GiftCardOrCouponForm(props: Props): JSX.Element | null;
|
|
15
|
+
export default GiftCardOrCouponForm;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponForm=GiftCardOrCouponForm;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),rapid_form_1=require("rapid-form"),react_1=require("react"),CouponAndGiftCardFormContext_1=tslib_1.__importDefault(require("../../context/CouponAndGiftCardFormContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext"));function GiftCardOrCouponForm(props){const{children,codeType,autoComplete="on",onSubmit}=props,p=tslib_1.__rest(props,["children","codeType","autoComplete","onSubmit"]),{validation,values,reset}=(0,rapid_form_1.useRapidForm)(),{setGiftCardOrCouponCode,order,errors,setOrderErrors}=(0,react_1.useContext)(OrderContext_1.default),ref=(0,react_1.useRef)(null),[type,setType]=(0,react_1.useState)(codeType);(0,react_1.useEffect)(()=>{var _a,_b,_c,_d;if(type!=null&&((_a=values[type])===null||_a===void 0?void 0:_a.value)===""&&errors!=null&&errors.length>0){const err=errors.filter(e=>e.field===type);setOrderErrors(err),onSubmit&&onSubmit({value:(_b=values[type])===null||_b===void 0?void 0:_b.value,success:!1})}type!=null&&((_c=values[type])===null||_c===void 0?void 0:_c.value)===""&&(setOrderErrors([]),onSubmit&&onSubmit({value:(_d=values[type])===null||_d===void 0?void 0:_d.value,success:!1}))},[values]),(0,react_1.useEffect)(()=>{codeType==null?(order?.gift_card_code&&!order?.coupon_code&&setType("coupon_code"),!order?.gift_card_code&&order?.coupon_code&&setType("gift_card_code"),!order?.gift_card_code&&!order?.coupon_code&&setType("gift_card_or_coupon_code")):setType(codeType)},[order]);const handleSubmit=e=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a;e.preventDefault();const code=type!=null&&values[type]!=null?values[type].value:void 0;if(code!=null&&setGiftCardOrCouponCode!=null&&type!=null){const{success,order:order2}=yield setGiftCardOrCouponCode({code,codeType:type}),value=(_a=values[type])===null||_a===void 0?void 0:_a.value;onSubmit&&onSubmit({success,value,order:order2}),success&&reset(e)}});return codeType!=null&&order?.[codeType]!=null&&order?.[codeType]!==""||order?.gift_card_code&&order?.coupon_code||order==null?null:(0,jsx_runtime_1.jsx)(CouponAndGiftCardFormContext_1.default.Provider,{value:{validation,codeType:type},children:(0,jsx_runtime_1.jsx)("form",Object.assign({ref,autoComplete,onSubmit:e=>{handleSubmit(e)}},p,{children}))})}exports.default=GiftCardOrCouponForm;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { BaseInputComponentProps } from '../../typings/index';
|
|
3
|
+
import type { OrderCodeType } from '../../reducers/OrderReducer';
|
|
4
|
+
type FieldName = 'gift_card_code' | 'coupon_code';
|
|
5
|
+
type Props = {
|
|
6
|
+
name?: FieldName;
|
|
7
|
+
type?: 'text';
|
|
8
|
+
placeholderTranslation?: (codeType: OrderCodeType) => string;
|
|
9
|
+
} & Omit<BaseInputComponentProps, 'name' | 'type'> & Omit<JSX.IntrinsicElements['input'], 'children'> & Omit<JSX.IntrinsicElements['textarea'], 'children'>;
|
|
10
|
+
export declare function GiftCardOrCouponInput(props: Props): JSX.Element | null;
|
|
11
|
+
export default GiftCardOrCouponInput;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponInput=GiftCardOrCouponInput;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),BaseInput_1=tslib_1.__importDefault(require("../utils/BaseInput")),CouponAndGiftCardFormContext_1=tslib_1.__importDefault(require("../../context/CouponAndGiftCardFormContext"));function GiftCardOrCouponInput(props){const{placeholder="",required,value,placeholderTranslation,name}=props,p=tslib_1.__rest(props,["placeholder","required","value","placeholderTranslation","name"]),{validation,codeType}=(0,react_1.useContext)(CouponAndGiftCardFormContext_1.default);let placeholderLabel=placeholder;return placeholderTranslation&&codeType&&(placeholderLabel=placeholderTranslation(codeType)),codeType==null?null:(0,jsx_runtime_1.jsx)(BaseInput_1.default,Object.assign({type:"text",name:codeType??"gift_card_or_coupon_code",ref:validation,required:required!==void 0?required:!0,placeholder:placeholderLabel,defaultValue:value},p))}exports.default=GiftCardOrCouponInput;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode, type JSX } from "react";
|
|
2
|
+
import type { ChildrenFunction } from "../../typings/index";
|
|
3
|
+
import type { CodeType, OrderCodeType } from "../../reducers/OrderReducer";
|
|
4
|
+
import type { Order } from "@commercelayer/sdk";
|
|
5
|
+
interface ChildrenProps extends Omit<Props, "children" | "onClick"> {
|
|
6
|
+
codeType?: OrderCodeType;
|
|
7
|
+
hide?: boolean;
|
|
8
|
+
handleClick?: () => void;
|
|
9
|
+
}
|
|
10
|
+
type Props = {
|
|
11
|
+
type?: CodeType;
|
|
12
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
13
|
+
label?: string | ReactNode;
|
|
14
|
+
onClick?: (response: {
|
|
15
|
+
success: boolean;
|
|
16
|
+
order?: Order;
|
|
17
|
+
}) => void;
|
|
18
|
+
} & Omit<JSX.IntrinsicElements["button"], "type" | "onClick">;
|
|
19
|
+
export declare function GiftCardOrCouponRemoveButton(props: Props): JSX.Element | null;
|
|
20
|
+
export default GiftCardOrCouponRemoveButton;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponRemoveButton=GiftCardOrCouponRemoveButton;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")),manageGiftCard_1=require("../../utils/adyen/manageGiftCard");function GiftCardOrCouponRemoveButton(props){const{children,label="Remove",onClick,type}=props,p=tslib_1.__rest(props,["children","label","onClick","type"]),{order,removeGiftCardOrCouponCode,manageAdyenGiftCard,paymentSourceRequest}=(0,react_1.useContext)(OrderContext_1.default);let codeType=type?`${type}_code`:void 0;!type&&order&&"coupon_code"in order&&order.coupon_code!==""?codeType="coupon_code":type||(codeType="gift_card_code");const code=order&&codeType?order[codeType]:"";let hide=!(order&&code);const handleClick=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a;if(manageAdyenGiftCard&&codeType==="gift_card_code"&&order!=null){const id=(_a=order?.payment_source)===null||_a===void 0?void 0:_a.id;if(id!=null){const res=yield paymentSourceRequest({resource:"adyen_payments",requestType:"update",attributes:{id,payment_request_data:{}},order});onClick!=null&&res!=null&&onClick(res)}}else if(codeType!=null&&removeGiftCardOrCouponCode!=null){const response=yield removeGiftCardOrCouponCode({codeType});onClick!=null&&response!=null&&onClick(response)}});if(manageAdyenGiftCard&&type==="gift_card"){if(!(0,manageGiftCard_1.manageGiftCard)({order}))return null;hide=!1;const parentProps2=Object.assign(Object.assign({},p),{label,handleClick,codeType});return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps2,{children})):hide?null:(0,jsx_runtime_1.jsx)("button",Object.assign({type:"button",onClick:()=>{handleClick()}},p,{children:label}))}const parentProps=Object.assign(Object.assign({},p),{label,handleClick,codeType});return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):hide?null:(0,jsx_runtime_1.jsx)("button",Object.assign({type:"button",onClick:()=>{handleClick()}},p,{children:label}))}exports.default=GiftCardOrCouponRemoveButton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode, JSX } from 'react';
|
|
2
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
3
|
+
interface ChildrenProps extends Omit<Props, 'children'> {
|
|
4
|
+
}
|
|
5
|
+
interface Props extends Omit<JSX.IntrinsicElements['button'], 'children'> {
|
|
6
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
7
|
+
label?: string | ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function GiftCardOrCouponSubmit(props: Props): JSX.Element;
|
|
10
|
+
export default GiftCardOrCouponSubmit;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponSubmit=GiftCardOrCouponSubmit;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function GiftCardOrCouponSubmit(props){const{children,label="Submit"}=props,p=tslib_1.__rest(props,["children","label"]),parentProps=Object.assign(Object.assign({},p),{label});return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("button",Object.assign({type:"submit"},p,{children:label}))}exports.default=GiftCardOrCouponSubmit;
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
2
|
+
import { type JSX } from 'react';
|
|
3
|
+
interface Props extends Omit<JSX.IntrinsicElements['button'], 'children' | 'onClick'> {
|
|
4
|
+
/**
|
|
5
|
+
* The code of the sku.
|
|
6
|
+
*/
|
|
7
|
+
skuCode: string;
|
|
8
|
+
/**
|
|
9
|
+
* The label to display.
|
|
10
|
+
*/
|
|
11
|
+
label?: string | JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* The label to display when the button is loading.
|
|
14
|
+
*/
|
|
15
|
+
loadingLabel?: string | JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* The email of the customer.
|
|
18
|
+
*/
|
|
19
|
+
customerEmail?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The children of the component.
|
|
22
|
+
*/
|
|
23
|
+
children?: ChildrenFunction<Omit<Props, 'children'>>;
|
|
24
|
+
/**
|
|
25
|
+
* Show the button.
|
|
26
|
+
*/
|
|
27
|
+
show?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The callback function to call when the button is clicked.
|
|
30
|
+
*/
|
|
31
|
+
onClick?: (response: {
|
|
32
|
+
success: boolean;
|
|
33
|
+
}) => void;
|
|
34
|
+
}
|
|
35
|
+
export declare function InStockSubscriptionButton({ skuCode, customerEmail, children, onClick, show, label, loadingLabel, ...props }: Props): JSX.Element | null;
|
|
36
|
+
export default InStockSubscriptionButton;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InStockSubscriptionButton=InStockSubscriptionButton;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),InStockSubscriptionContext_1=tslib_1.__importDefault(require("../../context/InStockSubscriptionContext")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext")),jwt_1=require("../../utils/jwt"),react_1=require("react");function InStockSubscriptionButton(_a){var{skuCode,customerEmail,children,onClick,show=!1,label="Subscribe",loadingLabel="Loading..."}=_a,props=tslib_1.__rest(_a,["skuCode","customerEmail","children","onClick","show","label","loadingLabel"]);const{setInStockSubscription}=(0,useCustomContext_1.default)({context:InStockSubscriptionContext_1.default,contextComponentName:"InStockSubscriptionsContainer",currentComponentName:"InStockSubscriptionButton",key:"setInStockSubscription"}),{accessToken}=(0,react_1.useContext)(CommerceLayerContext_1.default),[loading,setLoading]=(0,react_1.useState)(!1),handleClick=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){if(accessToken!=null&&customerEmail==null){const get=(0,jwt_1.jwt)(accessToken);if(get?.owner==null){console.error("Missing customerEmail");return}}if(setInStockSubscription==null){console.error("Missing <InStockSubscriptionsContainer>");return}setLoading(!0);const res=yield setInStockSubscription({customerEmail,skuCode});onClick?.(res),setLoading(!1)});if(children!=null){const parentProps=Object.assign({skuCode,customerEmail,onClick,show,label,loadingLabel},props);return(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children}))}return show?(0,jsx_runtime_1.jsx)("button",Object.assign({onClick:()=>{handleClick()},disabled:loading},props,{children:loading?loadingLabel:label})):null}exports.default=InStockSubscriptionButton;
|