@commercelayer/react-components 4.21.0-beta.1 → 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.
Files changed (1013) hide show
  1. package/lib/cjs/components/ExternalFunction.d.ts +7 -0
  2. package/lib/cjs/components/ExternalFunction.js +2 -0
  3. package/lib/cjs/components/MetadataInput.d.ts +5 -0
  4. package/lib/cjs/components/MetadataInput.js +2 -0
  5. package/lib/cjs/components/SubmitButton.d.ts +10 -0
  6. package/lib/cjs/components/SubmitButton.js +2 -0
  7. package/lib/cjs/components/addresses/Address.d.ts +31 -0
  8. package/lib/cjs/components/addresses/Address.js +2 -0
  9. package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +34 -0
  10. package/lib/cjs/components/addresses/AddressCountrySelector.js +2 -0
  11. package/lib/cjs/components/addresses/AddressField.d.ts +61 -0
  12. package/lib/cjs/components/addresses/AddressField.js +2 -0
  13. package/lib/cjs/components/addresses/AddressInput.d.ts +34 -0
  14. package/lib/cjs/components/addresses/AddressInput.js +2 -0
  15. package/lib/cjs/components/addresses/AddressInputSelect.d.ts +29 -0
  16. package/lib/cjs/components/addresses/AddressInputSelect.js +2 -0
  17. package/lib/cjs/components/addresses/AddressStateSelector.d.ts +50 -0
  18. package/lib/cjs/components/addresses/AddressStateSelector.js +2 -0
  19. package/lib/cjs/components/addresses/AddressesContainer.d.ts +40 -0
  20. package/lib/cjs/components/addresses/AddressesContainer.js +2 -0
  21. package/lib/cjs/components/addresses/AddressesEmpty.d.ts +26 -0
  22. package/lib/cjs/components/addresses/AddressesEmpty.js +2 -0
  23. package/lib/cjs/components/addresses/BillingAddressContainer.d.ts +6 -0
  24. package/lib/cjs/components/addresses/BillingAddressContainer.js +2 -0
  25. package/lib/cjs/components/addresses/BillingAddressForm.d.ts +34 -0
  26. package/lib/cjs/components/addresses/BillingAddressForm.js +2 -0
  27. package/lib/cjs/components/addresses/SaveAddressesButton.d.ts +18 -0
  28. package/lib/cjs/components/addresses/SaveAddressesButton.js +2 -0
  29. package/lib/cjs/components/addresses/ShippingAddressContainer.d.ts +7 -0
  30. package/lib/cjs/components/addresses/ShippingAddressContainer.js +2 -0
  31. package/lib/cjs/components/addresses/ShippingAddressForm.d.ts +31 -0
  32. package/lib/cjs/components/addresses/ShippingAddressForm.js +2 -0
  33. package/lib/cjs/components/auth/CommerceLayer.d.ts +25 -0
  34. package/lib/cjs/components/auth/CommerceLayer.js +2 -0
  35. package/lib/cjs/components/customers/CustomerAddressForm.d.ts +13 -0
  36. package/lib/cjs/components/customers/CustomerAddressForm.js +2 -0
  37. package/lib/cjs/components/customers/CustomerContainer.d.ts +38 -0
  38. package/lib/cjs/components/customers/CustomerContainer.js +2 -0
  39. package/lib/cjs/components/customers/CustomerField.d.ts +25 -0
  40. package/lib/cjs/components/customers/CustomerField.js +2 -0
  41. package/lib/cjs/components/customers/CustomerInput.d.ts +11 -0
  42. package/lib/cjs/components/customers/CustomerInput.js +2 -0
  43. package/lib/cjs/components/customers/CustomerPaymentSource.d.ts +11 -0
  44. package/lib/cjs/components/customers/CustomerPaymentSource.js +2 -0
  45. package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.d.ts +14 -0
  46. package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.js +2 -0
  47. package/lib/cjs/components/customers/MyAccountLink.d.ts +38 -0
  48. package/lib/cjs/components/customers/MyAccountLink.js +2 -0
  49. package/lib/cjs/components/customers/MyIdentityLink.d.ts +59 -0
  50. package/lib/cjs/components/customers/MyIdentityLink.js +2 -0
  51. package/lib/cjs/components/customers/SaveCustomerButton.d.ts +12 -0
  52. package/lib/cjs/components/customers/SaveCustomerButton.js +2 -0
  53. package/lib/cjs/components/errors/Errors.d.ts +31 -0
  54. package/lib/cjs/components/errors/Errors.js +2 -0
  55. package/lib/cjs/components/gift_cards/GiftCard.d.ts +10 -0
  56. package/lib/cjs/components/gift_cards/GiftCard.js +2 -0
  57. package/lib/cjs/components/gift_cards/GiftCardContainer.d.ts +6 -0
  58. package/lib/cjs/components/gift_cards/GiftCardContainer.js +2 -0
  59. package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +7 -0
  60. package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.js +2 -0
  61. package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +7 -0
  62. package/lib/cjs/components/gift_cards/GiftCardInput.js +2 -0
  63. package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.d.ts +16 -0
  64. package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.js +2 -0
  65. package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.d.ts +15 -0
  66. package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.js +2 -0
  67. package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +11 -0
  68. package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.js +2 -0
  69. package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +20 -0
  70. package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.js +2 -0
  71. package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.d.ts +10 -0
  72. package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.js +2 -0
  73. package/lib/cjs/components/gift_cards/GiftCardRecipientInput.d.ts +0 -0
  74. package/lib/cjs/components/gift_cards/GiftCardRecipientInput.js +2 -0
  75. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +36 -0
  76. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.js +2 -0
  77. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +10 -0
  78. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.js +2 -0
  79. package/lib/cjs/components/line_items/LineItem.d.ts +8 -0
  80. package/lib/cjs/components/line_items/LineItem.js +2 -0
  81. package/lib/cjs/components/line_items/LineItemAmount.d.ts +7 -0
  82. package/lib/cjs/components/line_items/LineItemAmount.js +2 -0
  83. package/lib/cjs/components/line_items/LineItemCode.d.ts +13 -0
  84. package/lib/cjs/components/line_items/LineItemCode.js +2 -0
  85. package/lib/cjs/components/line_items/LineItemField.d.ts +14 -0
  86. package/lib/cjs/components/line_items/LineItemField.js +2 -0
  87. package/lib/cjs/components/line_items/LineItemImage.d.ts +17 -0
  88. package/lib/cjs/components/line_items/LineItemImage.js +2 -0
  89. package/lib/cjs/components/line_items/LineItemName.d.ts +12 -0
  90. package/lib/cjs/components/line_items/LineItemName.js +2 -0
  91. package/lib/cjs/components/line_items/LineItemOption.d.ts +19 -0
  92. package/lib/cjs/components/line_items/LineItemOption.js +2 -0
  93. package/lib/cjs/components/line_items/LineItemOptions.d.ts +16 -0
  94. package/lib/cjs/components/line_items/LineItemOptions.js +2 -0
  95. package/lib/cjs/components/line_items/LineItemQuantity.d.ts +21 -0
  96. package/lib/cjs/components/line_items/LineItemQuantity.js +2 -0
  97. package/lib/cjs/components/line_items/LineItemRemoveLink.d.ts +14 -0
  98. package/lib/cjs/components/line_items/LineItemRemoveLink.js +2 -0
  99. package/lib/cjs/components/line_items/LineItemsContainer.d.ts +9 -0
  100. package/lib/cjs/components/line_items/LineItemsContainer.js +2 -0
  101. package/lib/cjs/components/line_items/LineItemsCount.d.ts +12 -0
  102. package/lib/cjs/components/line_items/LineItemsCount.js +2 -0
  103. package/lib/cjs/components/line_items/LineItemsEmpty.d.ts +12 -0
  104. package/lib/cjs/components/line_items/LineItemsEmpty.js +2 -0
  105. package/lib/cjs/components/orders/AddToCartButton.d.ts +95 -0
  106. package/lib/cjs/components/orders/AddToCartButton.js +2 -0
  107. package/lib/cjs/components/orders/AdjustmentAmount.d.ts +4 -0
  108. package/lib/cjs/components/orders/AdjustmentAmount.js +2 -0
  109. package/lib/cjs/components/orders/CartLink.d.ts +47 -0
  110. package/lib/cjs/components/orders/CartLink.js +2 -0
  111. package/lib/cjs/components/orders/CheckoutLink.d.ts +28 -0
  112. package/lib/cjs/components/orders/CheckoutLink.js +2 -0
  113. package/lib/cjs/components/orders/DiscountAmount.d.ts +4 -0
  114. package/lib/cjs/components/orders/DiscountAmount.js +2 -0
  115. package/lib/cjs/components/orders/GiftCardAmount.d.ts +4 -0
  116. package/lib/cjs/components/orders/GiftCardAmount.js +2 -0
  117. package/lib/cjs/components/orders/HostedCart.d.ts +58 -0
  118. package/lib/cjs/components/orders/HostedCart.js +2 -0
  119. package/lib/cjs/components/orders/OrderContainer.d.ts +62 -0
  120. package/lib/cjs/components/orders/OrderContainer.js +2 -0
  121. package/lib/cjs/components/orders/OrderList.d.ts +83 -0
  122. package/lib/cjs/components/orders/OrderList.js +2 -0
  123. package/lib/cjs/components/orders/OrderListEmpty.d.ts +17 -0
  124. package/lib/cjs/components/orders/OrderListEmpty.js +2 -0
  125. package/lib/cjs/components/orders/OrderListPaginationButtons.d.ts +48 -0
  126. package/lib/cjs/components/orders/OrderListPaginationButtons.js +2 -0
  127. package/lib/cjs/components/orders/OrderListPaginationInfo.d.ts +29 -0
  128. package/lib/cjs/components/orders/OrderListPaginationInfo.js +2 -0
  129. package/lib/cjs/components/orders/OrderListRow.d.ts +29 -0
  130. package/lib/cjs/components/orders/OrderListRow.js +2 -0
  131. package/lib/cjs/components/orders/OrderNumber.d.ts +5 -0
  132. package/lib/cjs/components/orders/OrderNumber.js +2 -0
  133. package/lib/cjs/components/orders/OrderStorage.d.ts +31 -0
  134. package/lib/cjs/components/orders/OrderStorage.js +2 -0
  135. package/lib/cjs/components/orders/PaymentMethodAmount.d.ts +4 -0
  136. package/lib/cjs/components/orders/PaymentMethodAmount.js +2 -0
  137. package/lib/cjs/components/orders/PlaceOrderButton.d.ts +35 -0
  138. package/lib/cjs/components/orders/PlaceOrderButton.js +2 -0
  139. package/lib/cjs/components/orders/PlaceOrderContainer.d.ts +8 -0
  140. package/lib/cjs/components/orders/PlaceOrderContainer.js +2 -0
  141. package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.d.ts +4 -0
  142. package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.js +2 -0
  143. package/lib/cjs/components/orders/ShippingAmount.d.ts +4 -0
  144. package/lib/cjs/components/orders/ShippingAmount.js +2 -0
  145. package/lib/cjs/components/orders/SubTotalAmount.d.ts +4 -0
  146. package/lib/cjs/components/orders/SubTotalAmount.js +2 -0
  147. package/lib/cjs/components/orders/TaxesAmount.d.ts +4 -0
  148. package/lib/cjs/components/orders/TaxesAmount.js +2 -0
  149. package/lib/cjs/components/orders/TotalAmount.d.ts +4 -0
  150. package/lib/cjs/components/orders/TotalAmount.js +2 -0
  151. package/lib/cjs/components/parcels/ParcelField.d.ts +14 -0
  152. package/lib/cjs/components/parcels/ParcelField.js +2 -0
  153. package/lib/cjs/components/parcels/ParcelLineItem.d.ts +7 -0
  154. package/lib/cjs/components/parcels/ParcelLineItem.js +2 -0
  155. package/lib/cjs/components/parcels/ParcelLineItemField.d.ts +14 -0
  156. package/lib/cjs/components/parcels/ParcelLineItemField.js +2 -0
  157. package/lib/cjs/components/parcels/ParcelLineItemsCount.d.ts +18 -0
  158. package/lib/cjs/components/parcels/ParcelLineItemsCount.js +2 -0
  159. package/lib/cjs/components/parcels/Parcels.d.ts +7 -0
  160. package/lib/cjs/components/parcels/Parcels.js +2 -0
  161. package/lib/cjs/components/parcels/ParcelsCount.d.ts +18 -0
  162. package/lib/cjs/components/parcels/ParcelsCount.js +2 -0
  163. package/lib/cjs/components/payment_gateways/AdyenGateway.d.ts +5 -0
  164. package/lib/cjs/components/payment_gateways/AdyenGateway.js +2 -0
  165. package/lib/cjs/components/payment_gateways/BraintreeGateway.d.ts +5 -0
  166. package/lib/cjs/components/payment_gateways/BraintreeGateway.js +2 -0
  167. package/lib/cjs/components/payment_gateways/CheckoutComGateway.d.ts +5 -0
  168. package/lib/cjs/components/payment_gateways/CheckoutComGateway.js +2 -0
  169. package/lib/cjs/components/payment_gateways/ExternalGateway.d.ts +5 -0
  170. package/lib/cjs/components/payment_gateways/ExternalGateway.js +2 -0
  171. package/lib/cjs/components/payment_gateways/KlarnaGateway.d.ts +5 -0
  172. package/lib/cjs/components/payment_gateways/KlarnaGateway.js +2 -0
  173. package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +16 -0
  174. package/lib/cjs/components/payment_gateways/PaymentGateway.js +2 -0
  175. package/lib/cjs/components/payment_gateways/PaypalGateway.d.ts +5 -0
  176. package/lib/cjs/components/payment_gateways/PaypalGateway.js +2 -0
  177. package/lib/cjs/components/payment_gateways/StripeGateway.d.ts +5 -0
  178. package/lib/cjs/components/payment_gateways/StripeGateway.js +2 -0
  179. package/lib/cjs/components/payment_gateways/WireTransferGateway.d.ts +5 -0
  180. package/lib/cjs/components/payment_gateways/WireTransferGateway.js +2 -0
  181. package/lib/cjs/components/payment_methods/PaymentMethod.d.ts +45 -0
  182. package/lib/cjs/components/payment_methods/PaymentMethod.js +2 -0
  183. package/lib/cjs/components/payment_methods/PaymentMethodName.d.ts +10 -0
  184. package/lib/cjs/components/payment_methods/PaymentMethodName.js +2 -0
  185. package/lib/cjs/components/payment_methods/PaymentMethodPrice.d.ts +8 -0
  186. package/lib/cjs/components/payment_methods/PaymentMethodPrice.js +2 -0
  187. package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.d.ts +17 -0
  188. package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.js +2 -0
  189. package/lib/cjs/components/payment_methods/PaymentMethodsContainer.d.ts +8 -0
  190. package/lib/cjs/components/payment_methods/PaymentMethodsContainer.js +2 -0
  191. package/lib/cjs/components/payment_source/AdyenPayment.d.ts +66 -0
  192. package/lib/cjs/components/payment_source/AdyenPayment.js +2 -0
  193. package/lib/cjs/components/payment_source/BraintreePayment.d.ts +32 -0
  194. package/lib/cjs/components/payment_source/BraintreePayment.js +2 -0
  195. package/lib/cjs/components/payment_source/CheckoutComPayment.d.ts +23 -0
  196. package/lib/cjs/components/payment_source/CheckoutComPayment.js +2 -0
  197. package/lib/cjs/components/payment_source/ExternalPayment.d.ts +24 -0
  198. package/lib/cjs/components/payment_source/ExternalPayment.js +2 -0
  199. package/lib/cjs/components/payment_source/KlarnaPayment.d.ts +10 -0
  200. package/lib/cjs/components/payment_source/KlarnaPayment.js +2 -0
  201. package/lib/cjs/components/payment_source/PaymentSource.d.ts +19 -0
  202. package/lib/cjs/components/payment_source/PaymentSource.js +2 -0
  203. package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.d.ts +15 -0
  204. package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.js +2 -0
  205. package/lib/cjs/components/payment_source/PaymentSourceBrandName.d.ts +12 -0
  206. package/lib/cjs/components/payment_source/PaymentSourceBrandName.js +2 -0
  207. package/lib/cjs/components/payment_source/PaymentSourceDetail.d.ts +15 -0
  208. package/lib/cjs/components/payment_source/PaymentSourceDetail.js +2 -0
  209. package/lib/cjs/components/payment_source/PaymentSourceEditButton.d.ts +10 -0
  210. package/lib/cjs/components/payment_source/PaymentSourceEditButton.js +2 -0
  211. package/lib/cjs/components/payment_source/PaypalPayment.d.ts +12 -0
  212. package/lib/cjs/components/payment_source/PaypalPayment.js +2 -0
  213. package/lib/cjs/components/payment_source/StripeExpressPayment.d.ts +6 -0
  214. package/lib/cjs/components/payment_source/StripeExpressPayment.js +2 -0
  215. package/lib/cjs/components/payment_source/StripePayment.d.ts +21 -0
  216. package/lib/cjs/components/payment_source/StripePayment.js +2 -0
  217. package/lib/cjs/components/payment_source/WireTransferPayment.d.ts +12 -0
  218. package/lib/cjs/components/payment_source/WireTransferPayment.js +2 -0
  219. package/lib/cjs/components/prices/Price.d.ts +35 -0
  220. package/lib/cjs/components/prices/Price.js +2 -0
  221. package/lib/cjs/components/prices/PricesContainer.d.ts +41 -0
  222. package/lib/cjs/components/prices/PricesContainer.js +2 -0
  223. package/lib/cjs/components/shipments/Shipment.d.ts +10 -0
  224. package/lib/cjs/components/shipments/Shipment.js +2 -0
  225. package/lib/cjs/components/shipments/ShipmentField.d.ts +12 -0
  226. package/lib/cjs/components/shipments/ShipmentField.js +2 -0
  227. package/lib/cjs/components/shipments/ShipmentsContainer.d.ts +6 -0
  228. package/lib/cjs/components/shipments/ShipmentsContainer.js +2 -0
  229. package/lib/cjs/components/shipments/ShipmentsCount.d.ts +18 -0
  230. package/lib/cjs/components/shipments/ShipmentsCount.js +2 -0
  231. package/lib/cjs/components/shipping_methods/ShippingMethod.d.ts +8 -0
  232. package/lib/cjs/components/shipping_methods/ShippingMethod.js +2 -0
  233. package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +11 -0
  234. package/lib/cjs/components/shipping_methods/ShippingMethodName.js +2 -0
  235. package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +20 -0
  236. package/lib/cjs/components/shipping_methods/ShippingMethodPrice.js +2 -0
  237. package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.d.ts +17 -0
  238. package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.js +2 -0
  239. package/lib/cjs/components/skus/AvailabilityContainer.d.ts +34 -0
  240. package/lib/cjs/components/skus/AvailabilityContainer.js +2 -0
  241. package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +52 -0
  242. package/lib/cjs/components/skus/AvailabilityTemplate.js +2 -0
  243. package/lib/cjs/components/skus/DeliveryLeadTime.d.ts +10 -0
  244. package/lib/cjs/components/skus/DeliveryLeadTime.js +2 -0
  245. package/lib/cjs/components/skus/SkuField.d.ts +25 -0
  246. package/lib/cjs/components/skus/SkuField.js +2 -0
  247. package/lib/cjs/components/skus/SkuList.d.ts +10 -0
  248. package/lib/cjs/components/skus/SkuList.js +2 -0
  249. package/lib/cjs/components/skus/SkuListsContainer.d.ts +6 -0
  250. package/lib/cjs/components/skus/SkuListsContainer.js +2 -0
  251. package/lib/cjs/components/skus/Skus.d.ts +18 -0
  252. package/lib/cjs/components/skus/Skus.js +2 -0
  253. package/lib/cjs/components/skus/SkusContainer.d.ts +31 -0
  254. package/lib/cjs/components/skus/SkusContainer.js +2 -0
  255. package/lib/cjs/components/stock_transfers/StockTransfer.d.ts +7 -0
  256. package/lib/cjs/components/stock_transfers/StockTransfer.js +2 -0
  257. package/lib/cjs/components/stock_transfers/StockTransferField.d.ts +10 -0
  258. package/lib/cjs/components/stock_transfers/StockTransferField.js +2 -0
  259. package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +26 -0
  260. package/lib/cjs/components/utils/AddressCardsTemplate.js +2 -0
  261. package/lib/cjs/components/utils/BaseField.d.ts +8 -0
  262. package/lib/cjs/components/utils/BaseField.js +2 -0
  263. package/lib/cjs/components/utils/BaseInput.d.ts +5 -0
  264. package/lib/cjs/components/utils/BaseInput.js +2 -0
  265. package/lib/cjs/components/utils/BaseOrderPrice.d.ts +6 -0
  266. package/lib/cjs/components/utils/BaseOrderPrice.js +2 -0
  267. package/lib/cjs/components/utils/BaseSelect.d.ts +5 -0
  268. package/lib/cjs/components/utils/BaseSelect.js +2 -0
  269. package/lib/cjs/components/utils/ErrorBoundary.d.ts +14 -0
  270. package/lib/cjs/components/utils/ErrorBoundary.js +2 -0
  271. package/lib/cjs/components/utils/GenericFieldComponent.d.ts +58 -0
  272. package/lib/cjs/components/utils/GenericFieldComponent.js +2 -0
  273. package/lib/cjs/components/utils/Parent.d.ts +6 -0
  274. package/lib/cjs/components/utils/Parent.js +2 -0
  275. package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +41 -0
  276. package/lib/cjs/components/utils/PaymentCardsTemplate.js +2 -0
  277. package/lib/cjs/components/utils/PriceTemplate.d.ts +8 -0
  278. package/lib/cjs/components/utils/PriceTemplate.js +2 -0
  279. package/lib/cjs/components/utils/getAllErrors.d.ts +16 -0
  280. package/lib/cjs/components/utils/getAllErrors.js +2 -0
  281. package/lib/cjs/config/currency.d.ts +5 -0
  282. package/lib/cjs/config/currency.js +2 -0
  283. package/lib/cjs/context/AddressChildrenContext.d.ts +6 -0
  284. package/lib/cjs/context/AddressChildrenContext.js +2 -0
  285. package/lib/cjs/context/AddressContext.d.ts +18 -0
  286. package/lib/cjs/context/AddressContext.js +2 -0
  287. package/lib/cjs/context/AvailabilityContext.d.ts +2 -0
  288. package/lib/cjs/context/AvailabilityContext.js +2 -0
  289. package/lib/cjs/context/BillingAddressContext.d.ts +9 -0
  290. package/lib/cjs/context/BillingAddressContext.js +2 -0
  291. package/lib/cjs/context/BillingAddressFormContext.d.ts +22 -0
  292. package/lib/cjs/context/BillingAddressFormContext.js +2 -0
  293. package/lib/cjs/context/CommerceLayerContext.d.ts +6 -0
  294. package/lib/cjs/context/CommerceLayerContext.js +2 -0
  295. package/lib/cjs/context/CouponAndGiftCardFormContext.d.ts +8 -0
  296. package/lib/cjs/context/CouponAndGiftCardFormContext.js +2 -0
  297. package/lib/cjs/context/CustomerAddressFormContext.d.ts +17 -0
  298. package/lib/cjs/context/CustomerAddressFormContext.js +2 -0
  299. package/lib/cjs/context/CustomerContext.d.ts +29 -0
  300. package/lib/cjs/context/CustomerContext.js +2 -0
  301. package/lib/cjs/context/CustomerPaymentSourceContext.d.ts +11 -0
  302. package/lib/cjs/context/CustomerPaymentSourceContext.js +2 -0
  303. package/lib/cjs/context/ExternalFunctionContext.d.ts +11 -0
  304. package/lib/cjs/context/ExternalFunctionContext.js +2 -0
  305. package/lib/cjs/context/GiftCardContext.d.ts +10 -0
  306. package/lib/cjs/context/GiftCardContext.js +2 -0
  307. package/lib/cjs/context/InStockSubscriptionContext.d.ts +6 -0
  308. package/lib/cjs/context/InStockSubscriptionContext.js +2 -0
  309. package/lib/cjs/context/LineItemChildrenContext.d.ts +8 -0
  310. package/lib/cjs/context/LineItemChildrenContext.js +2 -0
  311. package/lib/cjs/context/LineItemContext.d.ts +7 -0
  312. package/lib/cjs/context/LineItemContext.js +2 -0
  313. package/lib/cjs/context/LineItemOptionChildrenContext.d.ts +9 -0
  314. package/lib/cjs/context/LineItemOptionChildrenContext.js +2 -0
  315. package/lib/cjs/context/OrderContext.d.ts +30 -0
  316. package/lib/cjs/context/OrderContext.js +2 -0
  317. package/lib/cjs/context/OrderListChildrenContext.d.ts +73 -0
  318. package/lib/cjs/context/OrderListChildrenContext.js +2 -0
  319. package/lib/cjs/context/OrderListPaginationContext.d.ts +15 -0
  320. package/lib/cjs/context/OrderListPaginationContext.js +2 -0
  321. package/lib/cjs/context/OrderStorageContext.d.ts +10 -0
  322. package/lib/cjs/context/OrderStorageContext.js +2 -0
  323. package/lib/cjs/context/ParcelChildrenContext.d.ts +6 -0
  324. package/lib/cjs/context/ParcelChildrenContext.js +2 -0
  325. package/lib/cjs/context/ParcelLineItemChildrenContext.d.ts +6 -0
  326. package/lib/cjs/context/ParcelLineItemChildrenContext.js +2 -0
  327. package/lib/cjs/context/PaymentMethodChildrenContext.d.ts +10 -0
  328. package/lib/cjs/context/PaymentMethodChildrenContext.js +2 -0
  329. package/lib/cjs/context/PaymentMethodContext.d.ts +13 -0
  330. package/lib/cjs/context/PaymentMethodContext.js +2 -0
  331. package/lib/cjs/context/PaymentSourceContext.d.ts +14 -0
  332. package/lib/cjs/context/PaymentSourceContext.js +2 -0
  333. package/lib/cjs/context/PlaceOrderContext.d.ts +12 -0
  334. package/lib/cjs/context/PlaceOrderContext.js +2 -0
  335. package/lib/cjs/context/PricesContext.d.ts +6 -0
  336. package/lib/cjs/context/PricesContext.js +2 -0
  337. package/lib/cjs/context/ShipmentChildrenContext.d.ts +13 -0
  338. package/lib/cjs/context/ShipmentChildrenContext.js +2 -0
  339. package/lib/cjs/context/ShipmentContext.d.ts +10 -0
  340. package/lib/cjs/context/ShipmentContext.js +2 -0
  341. package/lib/cjs/context/ShippingAddressContext.d.ts +9 -0
  342. package/lib/cjs/context/ShippingAddressContext.js +2 -0
  343. package/lib/cjs/context/ShippingAddressFormContext.d.ts +3 -0
  344. package/lib/cjs/context/ShippingAddressFormContext.js +2 -0
  345. package/lib/cjs/context/ShippingMethodChildrenContext.d.ts +9 -0
  346. package/lib/cjs/context/ShippingMethodChildrenContext.js +2 -0
  347. package/lib/cjs/context/SkuChildrenContext.d.ts +8 -0
  348. package/lib/cjs/context/SkuChildrenContext.js +2 -0
  349. package/lib/cjs/context/SkuContext.d.ts +8 -0
  350. package/lib/cjs/context/SkuContext.js +2 -0
  351. package/lib/cjs/context/SkuListsContext.d.ts +5 -0
  352. package/lib/cjs/context/SkuListsContext.js +2 -0
  353. package/lib/cjs/context/StockTransferChildrenContext.d.ts +6 -0
  354. package/lib/cjs/context/StockTransferChildrenContext.js +2 -0
  355. package/lib/cjs/hooks/useCommerceLayer.d.ts +12 -0
  356. package/lib/cjs/hooks/useCommerceLayer.js +2 -0
  357. package/lib/cjs/hooks/useCustomerContainer.d.ts +12 -0
  358. package/lib/cjs/hooks/useCustomerContainer.js +2 -0
  359. package/lib/cjs/hooks/useOrderContainer.d.ts +16 -0
  360. package/lib/cjs/hooks/useOrderContainer.js +2 -0
  361. package/lib/cjs/index.d.ts +107 -0
  362. package/lib/cjs/index.js +2 -0
  363. package/lib/cjs/reducers/AddressReducer.d.ts +80 -0
  364. package/lib/cjs/reducers/AddressReducer.js +2 -0
  365. package/lib/cjs/reducers/AvailabilityReducer.d.ts +53 -0
  366. package/lib/cjs/reducers/AvailabilityReducer.js +2 -0
  367. package/lib/cjs/reducers/BillingAddressReducer.d.ts +31 -0
  368. package/lib/cjs/reducers/BillingAddressReducer.js +2 -0
  369. package/lib/cjs/reducers/CustomerReducer.d.ts +183 -0
  370. package/lib/cjs/reducers/CustomerReducer.js +2 -0
  371. package/lib/cjs/reducers/GiftCardReducer.d.ts +66 -0
  372. package/lib/cjs/reducers/GiftCardReducer.js +2 -0
  373. package/lib/cjs/reducers/InStockSubscriptionReducer.d.ts +33 -0
  374. package/lib/cjs/reducers/InStockSubscriptionReducer.js +2 -0
  375. package/lib/cjs/reducers/LineItemReducer.d.ts +47 -0
  376. package/lib/cjs/reducers/LineItemReducer.js +2 -0
  377. package/lib/cjs/reducers/OrderReducer.d.ts +171 -0
  378. package/lib/cjs/reducers/OrderReducer.js +2 -0
  379. package/lib/cjs/reducers/PaymentMethodReducer.d.ts +161 -0
  380. package/lib/cjs/reducers/PaymentMethodReducer.js +2 -0
  381. package/lib/cjs/reducers/PlaceOrderReducer.d.ts +72 -0
  382. package/lib/cjs/reducers/PlaceOrderReducer.js +2 -0
  383. package/lib/cjs/reducers/PriceReducer.d.ts +35 -0
  384. package/lib/cjs/reducers/PriceReducer.js +2 -0
  385. package/lib/cjs/reducers/ShipmentReducer.d.ts +41 -0
  386. package/lib/cjs/reducers/ShipmentReducer.js +2 -0
  387. package/lib/cjs/reducers/ShippingAddressReducer.d.ts +32 -0
  388. package/lib/cjs/reducers/ShippingAddressReducer.js +2 -0
  389. package/lib/cjs/reducers/SkuListsReducer.d.ts +21 -0
  390. package/lib/cjs/reducers/SkuListsReducer.js +2 -0
  391. package/lib/cjs/reducers/SkuReducer.d.ts +21 -0
  392. package/lib/cjs/reducers/SkuReducer.js +2 -0
  393. package/lib/cjs/typings/errors.d.ts +15 -0
  394. package/lib/cjs/typings/errors.js +2 -0
  395. package/lib/cjs/typings/globals.d.ts +6 -0
  396. package/lib/cjs/typings/globals.js +2 -0
  397. package/lib/cjs/typings/index.d.ts +117 -0
  398. package/lib/cjs/typings/index.js +2 -0
  399. package/lib/cjs/utils/PropsType.d.ts +33 -0
  400. package/lib/cjs/utils/PropsType.js +2 -0
  401. package/lib/cjs/utils/addressesManager.d.ts +64 -0
  402. package/lib/cjs/utils/addressesManager.js +2 -0
  403. package/lib/cjs/utils/adyen/manageGiftCard.d.ts +16 -0
  404. package/lib/cjs/utils/adyen/manageGiftCard.js +2 -0
  405. package/lib/cjs/utils/baseReducer.d.ts +3 -0
  406. package/lib/cjs/utils/baseReducer.js +2 -0
  407. package/lib/cjs/utils/browserInfo.d.ts +12 -0
  408. package/lib/cjs/utils/browserInfo.js +2 -0
  409. package/lib/cjs/utils/canPlaceOrder.d.ts +5 -0
  410. package/lib/cjs/utils/canPlaceOrder.js +2 -0
  411. package/lib/cjs/utils/checkIncludeResource.d.ts +8 -0
  412. package/lib/cjs/utils/checkIncludeResource.js +2 -0
  413. package/lib/cjs/utils/compareObjAttribute.d.ts +7 -0
  414. package/lib/cjs/utils/compareObjAttribute.js +2 -0
  415. package/lib/cjs/utils/countryStateCity.d.ts +801 -0
  416. package/lib/cjs/utils/countryStateCity.js +2 -0
  417. package/lib/cjs/utils/customMessages.d.ts +2 -0
  418. package/lib/cjs/utils/customMessages.js +2 -0
  419. package/lib/cjs/utils/customerOrderOptions.d.ts +3 -0
  420. package/lib/cjs/utils/customerOrderOptions.js +2 -0
  421. package/lib/cjs/utils/events.d.ts +5 -0
  422. package/lib/cjs/utils/events.js +2 -0
  423. package/lib/cjs/utils/expressPaymentHelper.d.ts +92 -0
  424. package/lib/cjs/utils/expressPaymentHelper.js +2 -0
  425. package/lib/cjs/utils/filterChildren.d.ts +12 -0
  426. package/lib/cjs/utils/filterChildren.js +2 -0
  427. package/lib/cjs/utils/formCleaner.d.ts +4 -0
  428. package/lib/cjs/utils/formCleaner.js +2 -0
  429. package/lib/cjs/utils/getAmount.d.ts +7 -0
  430. package/lib/cjs/utils/getAmount.js +2 -0
  431. package/lib/cjs/utils/getApplicationLink.d.ts +35 -0
  432. package/lib/cjs/utils/getApplicationLink.js +2 -0
  433. package/lib/cjs/utils/getCardDetails.d.ts +16 -0
  434. package/lib/cjs/utils/getCardDetails.js +2 -0
  435. package/lib/cjs/utils/getCustomerIdByToken.d.ts +6 -0
  436. package/lib/cjs/utils/getCustomerIdByToken.js +2 -0
  437. package/lib/cjs/utils/getDomain.d.ts +4 -0
  438. package/lib/cjs/utils/getDomain.js +2 -0
  439. package/lib/cjs/utils/getErrors.d.ts +19 -0
  440. package/lib/cjs/utils/getErrors.js +2 -0
  441. package/lib/cjs/utils/getLineItemsCount.d.ts +10 -0
  442. package/lib/cjs/utils/getLineItemsCount.js +2 -0
  443. package/lib/cjs/utils/getLoaderComponent.d.ts +3 -0
  444. package/lib/cjs/utils/getLoaderComponent.js +2 -0
  445. package/lib/cjs/utils/getPaymentAttributes.d.ts +17 -0
  446. package/lib/cjs/utils/getPaymentAttributes.js +2 -0
  447. package/lib/cjs/utils/getPrices.d.ts +6 -0
  448. package/lib/cjs/utils/getPrices.js +2 -0
  449. package/lib/cjs/utils/getPublicIp.d.ts +1 -0
  450. package/lib/cjs/utils/getPublicIp.js +2 -0
  451. package/lib/cjs/utils/getSdk.d.ts +3 -0
  452. package/lib/cjs/utils/getSdk.js +2 -0
  453. package/lib/cjs/utils/getSkus.d.ts +3 -0
  454. package/lib/cjs/utils/getSkus.js +2 -0
  455. package/lib/cjs/utils/hasSubscriptions.d.ts +7 -0
  456. package/lib/cjs/utils/hasSubscriptions.js +2 -0
  457. package/lib/cjs/utils/hooks/useCustomContext.d.ts +21 -0
  458. package/lib/cjs/utils/hooks/useCustomContext.js +2 -0
  459. package/lib/cjs/utils/hooks/useExternalScript.d.ts +1 -0
  460. package/lib/cjs/utils/hooks/useExternalScript.js +2 -0
  461. package/lib/cjs/utils/icons.d.ts +2 -0
  462. package/lib/cjs/utils/icons.js +2 -0
  463. package/lib/cjs/utils/isDate.d.ts +1 -0
  464. package/lib/cjs/utils/isDate.js +2 -0
  465. package/lib/cjs/utils/isEmpty.d.ts +1 -0
  466. package/lib/cjs/utils/isEmpty.js +2 -0
  467. package/lib/cjs/utils/isGuestToken.d.ts +6 -0
  468. package/lib/cjs/utils/isGuestToken.js +2 -0
  469. package/lib/cjs/utils/isJSON.d.ts +1 -0
  470. package/lib/cjs/utils/isJSON.js +2 -0
  471. package/lib/cjs/utils/jwt.d.ts +27 -0
  472. package/lib/cjs/utils/jwt.js +2 -0
  473. package/lib/cjs/utils/localStorage.d.ts +11 -0
  474. package/lib/cjs/utils/localStorage.js +2 -0
  475. package/lib/cjs/utils/omit.d.ts +1 -0
  476. package/lib/cjs/utils/omit.js +2 -0
  477. package/lib/cjs/utils/organization.d.ts +18 -0
  478. package/lib/cjs/utils/organization.js +2 -0
  479. package/lib/cjs/utils/payment-methods/sortPaymentMethods.d.ts +2 -0
  480. package/lib/cjs/utils/payment-methods/sortPaymentMethods.js +2 -0
  481. package/lib/cjs/utils/pick.d.ts +1 -0
  482. package/lib/cjs/utils/pick.js +2 -0
  483. package/lib/cjs/utils/placeholderImages.d.ts +2 -0
  484. package/lib/cjs/utils/placeholderImages.js +2 -0
  485. package/lib/cjs/utils/promisify.d.ts +1 -0
  486. package/lib/cjs/utils/promisify.js +2 -0
  487. package/lib/cjs/utils/replace.d.ts +2 -0
  488. package/lib/cjs/utils/replace.js +2 -0
  489. package/lib/cjs/utils/scrollbarWidth.d.ts +1 -0
  490. package/lib/cjs/utils/scrollbarWidth.js +2 -0
  491. package/lib/cjs/utils/shipments.d.ts +3 -0
  492. package/lib/cjs/utils/shipments.js +2 -0
  493. package/lib/cjs/utils/snakeToCamelCase.d.ts +5 -0
  494. package/lib/cjs/utils/snakeToCamelCase.js +2 -0
  495. package/lib/cjs/utils/stripe/retrievePaymentIntent.d.ts +14 -0
  496. package/lib/cjs/utils/stripe/retrievePaymentIntent.js +2 -0
  497. package/lib/cjs/utils/triggerAttributeHelper.d.ts +31 -0
  498. package/lib/cjs/utils/triggerAttributeHelper.js +2 -0
  499. package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +8 -0
  500. package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.js +2 -0
  501. package/lib/cjs/utils/validateFormFields.d.ts +16 -0
  502. package/lib/cjs/utils/validateFormFields.js +2 -0
  503. package/lib/esm/components/ExternalFunction.d.ts +7 -0
  504. package/lib/esm/components/ExternalFunction.js +2 -0
  505. package/lib/esm/components/MetadataInput.d.ts +5 -0
  506. package/lib/esm/components/MetadataInput.js +2 -0
  507. package/lib/esm/components/SubmitButton.d.ts +10 -0
  508. package/lib/esm/components/SubmitButton.js +2 -0
  509. package/lib/esm/components/addresses/Address.d.ts +31 -0
  510. package/lib/esm/components/addresses/Address.js +2 -0
  511. package/lib/esm/components/addresses/AddressCountrySelector.d.ts +34 -0
  512. package/lib/esm/components/addresses/AddressCountrySelector.js +2 -0
  513. package/lib/esm/components/addresses/AddressField.d.ts +61 -0
  514. package/lib/esm/components/addresses/AddressField.js +2 -0
  515. package/lib/esm/components/addresses/AddressInput.d.ts +34 -0
  516. package/lib/esm/components/addresses/AddressInput.js +2 -0
  517. package/lib/esm/components/addresses/AddressInputSelect.d.ts +29 -0
  518. package/lib/esm/components/addresses/AddressInputSelect.js +2 -0
  519. package/lib/esm/components/addresses/AddressStateSelector.d.ts +50 -0
  520. package/lib/esm/components/addresses/AddressStateSelector.js +2 -0
  521. package/lib/esm/components/addresses/AddressesContainer.d.ts +40 -0
  522. package/lib/esm/components/addresses/AddressesContainer.js +2 -0
  523. package/lib/esm/components/addresses/AddressesEmpty.d.ts +26 -0
  524. package/lib/esm/components/addresses/AddressesEmpty.js +2 -0
  525. package/lib/esm/components/addresses/BillingAddressContainer.d.ts +6 -0
  526. package/lib/esm/components/addresses/BillingAddressContainer.js +2 -0
  527. package/lib/esm/components/addresses/BillingAddressForm.d.ts +34 -0
  528. package/lib/esm/components/addresses/BillingAddressForm.js +2 -0
  529. package/lib/esm/components/addresses/SaveAddressesButton.d.ts +18 -0
  530. package/lib/esm/components/addresses/SaveAddressesButton.js +2 -0
  531. package/lib/esm/components/addresses/ShippingAddressContainer.d.ts +7 -0
  532. package/lib/esm/components/addresses/ShippingAddressContainer.js +2 -0
  533. package/lib/esm/components/addresses/ShippingAddressForm.d.ts +31 -0
  534. package/lib/esm/components/addresses/ShippingAddressForm.js +2 -0
  535. package/lib/esm/components/auth/CommerceLayer.d.ts +25 -0
  536. package/lib/esm/components/auth/CommerceLayer.js +2 -0
  537. package/lib/esm/components/customers/CustomerAddressForm.d.ts +13 -0
  538. package/lib/esm/components/customers/CustomerAddressForm.js +2 -0
  539. package/lib/esm/components/customers/CustomerContainer.d.ts +38 -0
  540. package/lib/esm/components/customers/CustomerContainer.js +2 -0
  541. package/lib/esm/components/customers/CustomerField.d.ts +25 -0
  542. package/lib/esm/components/customers/CustomerField.js +2 -0
  543. package/lib/esm/components/customers/CustomerInput.d.ts +11 -0
  544. package/lib/esm/components/customers/CustomerInput.js +2 -0
  545. package/lib/esm/components/customers/CustomerPaymentSource.d.ts +11 -0
  546. package/lib/esm/components/customers/CustomerPaymentSource.js +2 -0
  547. package/lib/esm/components/customers/CustomerPaymentSourceEmpty.d.ts +14 -0
  548. package/lib/esm/components/customers/CustomerPaymentSourceEmpty.js +2 -0
  549. package/lib/esm/components/customers/MyAccountLink.d.ts +38 -0
  550. package/lib/esm/components/customers/MyAccountLink.js +2 -0
  551. package/lib/esm/components/customers/MyIdentityLink.d.ts +59 -0
  552. package/lib/esm/components/customers/MyIdentityLink.js +2 -0
  553. package/lib/esm/components/customers/SaveCustomerButton.d.ts +12 -0
  554. package/lib/esm/components/customers/SaveCustomerButton.js +2 -0
  555. package/lib/esm/components/errors/Errors.d.ts +31 -0
  556. package/lib/esm/components/errors/Errors.js +2 -0
  557. package/lib/esm/components/gift_cards/GiftCard.d.ts +10 -0
  558. package/lib/esm/components/gift_cards/GiftCard.js +2 -0
  559. package/lib/esm/components/gift_cards/GiftCardContainer.d.ts +6 -0
  560. package/lib/esm/components/gift_cards/GiftCardContainer.js +2 -0
  561. package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +7 -0
  562. package/lib/esm/components/gift_cards/GiftCardCurrencySelector.js +2 -0
  563. package/lib/esm/components/gift_cards/GiftCardInput.d.ts +7 -0
  564. package/lib/esm/components/gift_cards/GiftCardInput.js +2 -0
  565. package/lib/esm/components/gift_cards/GiftCardOrCouponCode.d.ts +16 -0
  566. package/lib/esm/components/gift_cards/GiftCardOrCouponCode.js +2 -0
  567. package/lib/esm/components/gift_cards/GiftCardOrCouponForm.d.ts +15 -0
  568. package/lib/esm/components/gift_cards/GiftCardOrCouponForm.js +2 -0
  569. package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +11 -0
  570. package/lib/esm/components/gift_cards/GiftCardOrCouponInput.js +2 -0
  571. package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +20 -0
  572. package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.js +2 -0
  573. package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.d.ts +10 -0
  574. package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.js +2 -0
  575. package/lib/esm/components/gift_cards/GiftCardRecipientInput.d.ts +0 -0
  576. package/lib/esm/components/gift_cards/GiftCardRecipientInput.js +2 -0
  577. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +36 -0
  578. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.js +2 -0
  579. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +10 -0
  580. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.js +2 -0
  581. package/lib/esm/components/line_items/LineItem.d.ts +8 -0
  582. package/lib/esm/components/line_items/LineItem.js +2 -0
  583. package/lib/esm/components/line_items/LineItemAmount.d.ts +7 -0
  584. package/lib/esm/components/line_items/LineItemAmount.js +2 -0
  585. package/lib/esm/components/line_items/LineItemCode.d.ts +13 -0
  586. package/lib/esm/components/line_items/LineItemCode.js +2 -0
  587. package/lib/esm/components/line_items/LineItemField.d.ts +14 -0
  588. package/lib/esm/components/line_items/LineItemField.js +2 -0
  589. package/lib/esm/components/line_items/LineItemImage.d.ts +17 -0
  590. package/lib/esm/components/line_items/LineItemImage.js +2 -0
  591. package/lib/esm/components/line_items/LineItemName.d.ts +12 -0
  592. package/lib/esm/components/line_items/LineItemName.js +2 -0
  593. package/lib/esm/components/line_items/LineItemOption.d.ts +19 -0
  594. package/lib/esm/components/line_items/LineItemOption.js +2 -0
  595. package/lib/esm/components/line_items/LineItemOptions.d.ts +16 -0
  596. package/lib/esm/components/line_items/LineItemOptions.js +2 -0
  597. package/lib/esm/components/line_items/LineItemQuantity.d.ts +21 -0
  598. package/lib/esm/components/line_items/LineItemQuantity.js +2 -0
  599. package/lib/esm/components/line_items/LineItemRemoveLink.d.ts +14 -0
  600. package/lib/esm/components/line_items/LineItemRemoveLink.js +2 -0
  601. package/lib/esm/components/line_items/LineItemsContainer.d.ts +9 -0
  602. package/lib/esm/components/line_items/LineItemsContainer.js +2 -0
  603. package/lib/esm/components/line_items/LineItemsCount.d.ts +12 -0
  604. package/lib/esm/components/line_items/LineItemsCount.js +2 -0
  605. package/lib/esm/components/line_items/LineItemsEmpty.d.ts +12 -0
  606. package/lib/esm/components/line_items/LineItemsEmpty.js +2 -0
  607. package/lib/esm/components/orders/AddToCartButton.d.ts +95 -0
  608. package/lib/esm/components/orders/AddToCartButton.js +2 -0
  609. package/lib/esm/components/orders/AdjustmentAmount.d.ts +4 -0
  610. package/lib/esm/components/orders/AdjustmentAmount.js +2 -0
  611. package/lib/esm/components/orders/CartLink.d.ts +47 -0
  612. package/lib/esm/components/orders/CartLink.js +2 -0
  613. package/lib/esm/components/orders/CheckoutLink.d.ts +28 -0
  614. package/lib/esm/components/orders/CheckoutLink.js +2 -0
  615. package/lib/esm/components/orders/DiscountAmount.d.ts +4 -0
  616. package/lib/esm/components/orders/DiscountAmount.js +2 -0
  617. package/lib/esm/components/orders/GiftCardAmount.d.ts +4 -0
  618. package/lib/esm/components/orders/GiftCardAmount.js +2 -0
  619. package/lib/esm/components/orders/HostedCart.d.ts +58 -0
  620. package/lib/esm/components/orders/HostedCart.js +2 -0
  621. package/lib/esm/components/orders/OrderContainer.d.ts +62 -0
  622. package/lib/esm/components/orders/OrderContainer.js +2 -0
  623. package/lib/esm/components/orders/OrderList.d.ts +83 -0
  624. package/lib/esm/components/orders/OrderList.js +2 -0
  625. package/lib/esm/components/orders/OrderListEmpty.d.ts +17 -0
  626. package/lib/esm/components/orders/OrderListEmpty.js +2 -0
  627. package/lib/esm/components/orders/OrderListPaginationButtons.d.ts +48 -0
  628. package/lib/esm/components/orders/OrderListPaginationButtons.js +2 -0
  629. package/lib/esm/components/orders/OrderListPaginationInfo.d.ts +29 -0
  630. package/lib/esm/components/orders/OrderListPaginationInfo.js +2 -0
  631. package/lib/esm/components/orders/OrderListRow.d.ts +29 -0
  632. package/lib/esm/components/orders/OrderListRow.js +2 -0
  633. package/lib/esm/components/orders/OrderNumber.d.ts +5 -0
  634. package/lib/esm/components/orders/OrderNumber.js +2 -0
  635. package/lib/esm/components/orders/OrderStorage.d.ts +31 -0
  636. package/lib/esm/components/orders/OrderStorage.js +2 -0
  637. package/lib/esm/components/orders/PaymentMethodAmount.d.ts +4 -0
  638. package/lib/esm/components/orders/PaymentMethodAmount.js +2 -0
  639. package/lib/esm/components/orders/PlaceOrderButton.d.ts +35 -0
  640. package/lib/esm/components/orders/PlaceOrderButton.js +2 -0
  641. package/lib/esm/components/orders/PlaceOrderContainer.d.ts +8 -0
  642. package/lib/esm/components/orders/PlaceOrderContainer.js +2 -0
  643. package/lib/esm/components/orders/PrivacyAndTermsCheckbox.d.ts +4 -0
  644. package/lib/esm/components/orders/PrivacyAndTermsCheckbox.js +2 -0
  645. package/lib/esm/components/orders/ShippingAmount.d.ts +4 -0
  646. package/lib/esm/components/orders/ShippingAmount.js +2 -0
  647. package/lib/esm/components/orders/SubTotalAmount.d.ts +4 -0
  648. package/lib/esm/components/orders/SubTotalAmount.js +2 -0
  649. package/lib/esm/components/orders/TaxesAmount.d.ts +4 -0
  650. package/lib/esm/components/orders/TaxesAmount.js +2 -0
  651. package/lib/esm/components/orders/TotalAmount.d.ts +4 -0
  652. package/lib/esm/components/orders/TotalAmount.js +2 -0
  653. package/lib/esm/components/parcels/ParcelField.d.ts +14 -0
  654. package/lib/esm/components/parcels/ParcelField.js +2 -0
  655. package/lib/esm/components/parcels/ParcelLineItem.d.ts +7 -0
  656. package/lib/esm/components/parcels/ParcelLineItem.js +2 -0
  657. package/lib/esm/components/parcels/ParcelLineItemField.d.ts +14 -0
  658. package/lib/esm/components/parcels/ParcelLineItemField.js +2 -0
  659. package/lib/esm/components/parcels/ParcelLineItemsCount.d.ts +18 -0
  660. package/lib/esm/components/parcels/ParcelLineItemsCount.js +2 -0
  661. package/lib/esm/components/parcels/Parcels.d.ts +7 -0
  662. package/lib/esm/components/parcels/Parcels.js +2 -0
  663. package/lib/esm/components/parcels/ParcelsCount.d.ts +18 -0
  664. package/lib/esm/components/parcels/ParcelsCount.js +2 -0
  665. package/lib/esm/components/payment_gateways/AdyenGateway.d.ts +5 -0
  666. package/lib/esm/components/payment_gateways/AdyenGateway.js +2 -0
  667. package/lib/esm/components/payment_gateways/BraintreeGateway.d.ts +5 -0
  668. package/lib/esm/components/payment_gateways/BraintreeGateway.js +2 -0
  669. package/lib/esm/components/payment_gateways/CheckoutComGateway.d.ts +5 -0
  670. package/lib/esm/components/payment_gateways/CheckoutComGateway.js +2 -0
  671. package/lib/esm/components/payment_gateways/ExternalGateway.d.ts +5 -0
  672. package/lib/esm/components/payment_gateways/ExternalGateway.js +2 -0
  673. package/lib/esm/components/payment_gateways/KlarnaGateway.d.ts +5 -0
  674. package/lib/esm/components/payment_gateways/KlarnaGateway.js +2 -0
  675. package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +16 -0
  676. package/lib/esm/components/payment_gateways/PaymentGateway.js +2 -0
  677. package/lib/esm/components/payment_gateways/PaypalGateway.d.ts +5 -0
  678. package/lib/esm/components/payment_gateways/PaypalGateway.js +2 -0
  679. package/lib/esm/components/payment_gateways/StripeGateway.d.ts +5 -0
  680. package/lib/esm/components/payment_gateways/StripeGateway.js +2 -0
  681. package/lib/esm/components/payment_gateways/WireTransferGateway.d.ts +5 -0
  682. package/lib/esm/components/payment_gateways/WireTransferGateway.js +2 -0
  683. package/lib/esm/components/payment_methods/PaymentMethod.d.ts +45 -0
  684. package/lib/esm/components/payment_methods/PaymentMethod.js +2 -0
  685. package/lib/esm/components/payment_methods/PaymentMethodName.d.ts +10 -0
  686. package/lib/esm/components/payment_methods/PaymentMethodName.js +2 -0
  687. package/lib/esm/components/payment_methods/PaymentMethodPrice.d.ts +8 -0
  688. package/lib/esm/components/payment_methods/PaymentMethodPrice.js +2 -0
  689. package/lib/esm/components/payment_methods/PaymentMethodRadioButton.d.ts +17 -0
  690. package/lib/esm/components/payment_methods/PaymentMethodRadioButton.js +2 -0
  691. package/lib/esm/components/payment_methods/PaymentMethodsContainer.d.ts +8 -0
  692. package/lib/esm/components/payment_methods/PaymentMethodsContainer.js +2 -0
  693. package/lib/esm/components/payment_source/AdyenPayment.d.ts +66 -0
  694. package/lib/esm/components/payment_source/AdyenPayment.js +2 -0
  695. package/lib/esm/components/payment_source/BraintreePayment.d.ts +32 -0
  696. package/lib/esm/components/payment_source/BraintreePayment.js +2 -0
  697. package/lib/esm/components/payment_source/CheckoutComPayment.d.ts +23 -0
  698. package/lib/esm/components/payment_source/CheckoutComPayment.js +2 -0
  699. package/lib/esm/components/payment_source/ExternalPayment.d.ts +24 -0
  700. package/lib/esm/components/payment_source/ExternalPayment.js +2 -0
  701. package/lib/esm/components/payment_source/KlarnaPayment.d.ts +10 -0
  702. package/lib/esm/components/payment_source/KlarnaPayment.js +2 -0
  703. package/lib/esm/components/payment_source/PaymentSource.d.ts +19 -0
  704. package/lib/esm/components/payment_source/PaymentSource.js +2 -0
  705. package/lib/esm/components/payment_source/PaymentSourceBrandIcon.d.ts +15 -0
  706. package/lib/esm/components/payment_source/PaymentSourceBrandIcon.js +2 -0
  707. package/lib/esm/components/payment_source/PaymentSourceBrandName.d.ts +12 -0
  708. package/lib/esm/components/payment_source/PaymentSourceBrandName.js +2 -0
  709. package/lib/esm/components/payment_source/PaymentSourceDetail.d.ts +15 -0
  710. package/lib/esm/components/payment_source/PaymentSourceDetail.js +2 -0
  711. package/lib/esm/components/payment_source/PaymentSourceEditButton.d.ts +10 -0
  712. package/lib/esm/components/payment_source/PaymentSourceEditButton.js +2 -0
  713. package/lib/esm/components/payment_source/PaypalPayment.d.ts +12 -0
  714. package/lib/esm/components/payment_source/PaypalPayment.js +2 -0
  715. package/lib/esm/components/payment_source/StripeExpressPayment.d.ts +6 -0
  716. package/lib/esm/components/payment_source/StripeExpressPayment.js +2 -0
  717. package/lib/esm/components/payment_source/StripePayment.d.ts +21 -0
  718. package/lib/esm/components/payment_source/StripePayment.js +2 -0
  719. package/lib/esm/components/payment_source/WireTransferPayment.d.ts +12 -0
  720. package/lib/esm/components/payment_source/WireTransferPayment.js +2 -0
  721. package/lib/esm/components/prices/Price.d.ts +35 -0
  722. package/lib/esm/components/prices/Price.js +2 -0
  723. package/lib/esm/components/prices/PricesContainer.d.ts +41 -0
  724. package/lib/esm/components/prices/PricesContainer.js +2 -0
  725. package/lib/esm/components/shipments/Shipment.d.ts +10 -0
  726. package/lib/esm/components/shipments/Shipment.js +2 -0
  727. package/lib/esm/components/shipments/ShipmentField.d.ts +12 -0
  728. package/lib/esm/components/shipments/ShipmentField.js +2 -0
  729. package/lib/esm/components/shipments/ShipmentsContainer.d.ts +6 -0
  730. package/lib/esm/components/shipments/ShipmentsContainer.js +2 -0
  731. package/lib/esm/components/shipments/ShipmentsCount.d.ts +18 -0
  732. package/lib/esm/components/shipments/ShipmentsCount.js +2 -0
  733. package/lib/esm/components/shipping_methods/ShippingMethod.d.ts +8 -0
  734. package/lib/esm/components/shipping_methods/ShippingMethod.js +2 -0
  735. package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +11 -0
  736. package/lib/esm/components/shipping_methods/ShippingMethodName.js +2 -0
  737. package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +20 -0
  738. package/lib/esm/components/shipping_methods/ShippingMethodPrice.js +2 -0
  739. package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.d.ts +17 -0
  740. package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.js +2 -0
  741. package/lib/esm/components/skus/AvailabilityContainer.d.ts +34 -0
  742. package/lib/esm/components/skus/AvailabilityContainer.js +2 -0
  743. package/lib/esm/components/skus/AvailabilityTemplate.d.ts +52 -0
  744. package/lib/esm/components/skus/AvailabilityTemplate.js +2 -0
  745. package/lib/esm/components/skus/DeliveryLeadTime.d.ts +10 -0
  746. package/lib/esm/components/skus/DeliveryLeadTime.js +2 -0
  747. package/lib/esm/components/skus/SkuField.d.ts +25 -0
  748. package/lib/esm/components/skus/SkuField.js +2 -0
  749. package/lib/esm/components/skus/SkuList.d.ts +10 -0
  750. package/lib/esm/components/skus/SkuList.js +2 -0
  751. package/lib/esm/components/skus/SkuListsContainer.d.ts +6 -0
  752. package/lib/esm/components/skus/SkuListsContainer.js +2 -0
  753. package/lib/esm/components/skus/Skus.d.ts +18 -0
  754. package/lib/esm/components/skus/Skus.js +2 -0
  755. package/lib/esm/components/skus/SkusContainer.d.ts +31 -0
  756. package/lib/esm/components/skus/SkusContainer.js +2 -0
  757. package/lib/esm/components/stock_transfers/StockTransfer.d.ts +7 -0
  758. package/lib/esm/components/stock_transfers/StockTransfer.js +2 -0
  759. package/lib/esm/components/stock_transfers/StockTransferField.d.ts +10 -0
  760. package/lib/esm/components/stock_transfers/StockTransferField.js +2 -0
  761. package/lib/esm/components/utils/AddressCardsTemplate.d.ts +26 -0
  762. package/lib/esm/components/utils/AddressCardsTemplate.js +2 -0
  763. package/lib/esm/components/utils/BaseField.d.ts +8 -0
  764. package/lib/esm/components/utils/BaseField.js +2 -0
  765. package/lib/esm/components/utils/BaseInput.d.ts +5 -0
  766. package/lib/esm/components/utils/BaseInput.js +2 -0
  767. package/lib/esm/components/utils/BaseOrderPrice.d.ts +6 -0
  768. package/lib/esm/components/utils/BaseOrderPrice.js +2 -0
  769. package/lib/esm/components/utils/BaseSelect.d.ts +5 -0
  770. package/lib/esm/components/utils/BaseSelect.js +2 -0
  771. package/lib/esm/components/utils/ErrorBoundary.d.ts +14 -0
  772. package/lib/esm/components/utils/ErrorBoundary.js +2 -0
  773. package/lib/esm/components/utils/GenericFieldComponent.d.ts +58 -0
  774. package/lib/esm/components/utils/GenericFieldComponent.js +2 -0
  775. package/lib/esm/components/utils/Parent.d.ts +6 -0
  776. package/lib/esm/components/utils/Parent.js +2 -0
  777. package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +41 -0
  778. package/lib/esm/components/utils/PaymentCardsTemplate.js +2 -0
  779. package/lib/esm/components/utils/PriceTemplate.d.ts +8 -0
  780. package/lib/esm/components/utils/PriceTemplate.js +2 -0
  781. package/lib/esm/components/utils/getAllErrors.d.ts +16 -0
  782. package/lib/esm/components/utils/getAllErrors.js +2 -0
  783. package/lib/esm/config/currency.d.ts +5 -0
  784. package/lib/esm/config/currency.js +2 -0
  785. package/lib/esm/context/AddressChildrenContext.d.ts +6 -0
  786. package/lib/esm/context/AddressChildrenContext.js +2 -0
  787. package/lib/esm/context/AddressContext.d.ts +18 -0
  788. package/lib/esm/context/AddressContext.js +2 -0
  789. package/lib/esm/context/AvailabilityContext.d.ts +2 -0
  790. package/lib/esm/context/AvailabilityContext.js +2 -0
  791. package/lib/esm/context/BillingAddressContext.d.ts +9 -0
  792. package/lib/esm/context/BillingAddressContext.js +2 -0
  793. package/lib/esm/context/BillingAddressFormContext.d.ts +22 -0
  794. package/lib/esm/context/BillingAddressFormContext.js +2 -0
  795. package/lib/esm/context/CommerceLayerContext.d.ts +6 -0
  796. package/lib/esm/context/CommerceLayerContext.js +2 -0
  797. package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +8 -0
  798. package/lib/esm/context/CouponAndGiftCardFormContext.js +2 -0
  799. package/lib/esm/context/CustomerAddressFormContext.d.ts +17 -0
  800. package/lib/esm/context/CustomerAddressFormContext.js +2 -0
  801. package/lib/esm/context/CustomerContext.d.ts +29 -0
  802. package/lib/esm/context/CustomerContext.js +2 -0
  803. package/lib/esm/context/CustomerPaymentSourceContext.d.ts +11 -0
  804. package/lib/esm/context/CustomerPaymentSourceContext.js +2 -0
  805. package/lib/esm/context/ExternalFunctionContext.d.ts +11 -0
  806. package/lib/esm/context/ExternalFunctionContext.js +2 -0
  807. package/lib/esm/context/GiftCardContext.d.ts +10 -0
  808. package/lib/esm/context/GiftCardContext.js +2 -0
  809. package/lib/esm/context/InStockSubscriptionContext.d.ts +6 -0
  810. package/lib/esm/context/InStockSubscriptionContext.js +2 -0
  811. package/lib/esm/context/LineItemChildrenContext.d.ts +8 -0
  812. package/lib/esm/context/LineItemChildrenContext.js +2 -0
  813. package/lib/esm/context/LineItemContext.d.ts +7 -0
  814. package/lib/esm/context/LineItemContext.js +2 -0
  815. package/lib/esm/context/LineItemOptionChildrenContext.d.ts +9 -0
  816. package/lib/esm/context/LineItemOptionChildrenContext.js +2 -0
  817. package/lib/esm/context/OrderContext.d.ts +30 -0
  818. package/lib/esm/context/OrderContext.js +2 -0
  819. package/lib/esm/context/OrderListChildrenContext.d.ts +73 -0
  820. package/lib/esm/context/OrderListChildrenContext.js +2 -0
  821. package/lib/esm/context/OrderListPaginationContext.d.ts +15 -0
  822. package/lib/esm/context/OrderListPaginationContext.js +2 -0
  823. package/lib/esm/context/OrderStorageContext.d.ts +10 -0
  824. package/lib/esm/context/OrderStorageContext.js +2 -0
  825. package/lib/esm/context/ParcelChildrenContext.d.ts +6 -0
  826. package/lib/esm/context/ParcelChildrenContext.js +2 -0
  827. package/lib/esm/context/ParcelLineItemChildrenContext.d.ts +6 -0
  828. package/lib/esm/context/ParcelLineItemChildrenContext.js +2 -0
  829. package/lib/esm/context/PaymentMethodChildrenContext.d.ts +10 -0
  830. package/lib/esm/context/PaymentMethodChildrenContext.js +2 -0
  831. package/lib/esm/context/PaymentMethodContext.d.ts +13 -0
  832. package/lib/esm/context/PaymentMethodContext.js +2 -0
  833. package/lib/esm/context/PaymentSourceContext.d.ts +14 -0
  834. package/lib/esm/context/PaymentSourceContext.js +2 -0
  835. package/lib/esm/context/PlaceOrderContext.d.ts +12 -0
  836. package/lib/esm/context/PlaceOrderContext.js +2 -0
  837. package/lib/esm/context/PricesContext.d.ts +6 -0
  838. package/lib/esm/context/PricesContext.js +2 -0
  839. package/lib/esm/context/ShipmentChildrenContext.d.ts +13 -0
  840. package/lib/esm/context/ShipmentChildrenContext.js +2 -0
  841. package/lib/esm/context/ShipmentContext.d.ts +10 -0
  842. package/lib/esm/context/ShipmentContext.js +2 -0
  843. package/lib/esm/context/ShippingAddressContext.d.ts +9 -0
  844. package/lib/esm/context/ShippingAddressContext.js +2 -0
  845. package/lib/esm/context/ShippingAddressFormContext.d.ts +3 -0
  846. package/lib/esm/context/ShippingAddressFormContext.js +2 -0
  847. package/lib/esm/context/ShippingMethodChildrenContext.d.ts +9 -0
  848. package/lib/esm/context/ShippingMethodChildrenContext.js +2 -0
  849. package/lib/esm/context/SkuChildrenContext.d.ts +8 -0
  850. package/lib/esm/context/SkuChildrenContext.js +2 -0
  851. package/lib/esm/context/SkuContext.d.ts +8 -0
  852. package/lib/esm/context/SkuContext.js +2 -0
  853. package/lib/esm/context/SkuListsContext.d.ts +5 -0
  854. package/lib/esm/context/SkuListsContext.js +2 -0
  855. package/lib/esm/context/StockTransferChildrenContext.d.ts +6 -0
  856. package/lib/esm/context/StockTransferChildrenContext.js +2 -0
  857. package/lib/esm/hooks/useCommerceLayer.d.ts +12 -0
  858. package/lib/esm/hooks/useCommerceLayer.js +2 -0
  859. package/lib/esm/hooks/useCustomerContainer.d.ts +12 -0
  860. package/lib/esm/hooks/useCustomerContainer.js +2 -0
  861. package/lib/esm/hooks/useOrderContainer.d.ts +16 -0
  862. package/lib/esm/hooks/useOrderContainer.js +2 -0
  863. package/lib/esm/index.d.ts +107 -0
  864. package/lib/esm/index.js +2 -0
  865. package/lib/esm/reducers/AddressReducer.d.ts +80 -0
  866. package/lib/esm/reducers/AddressReducer.js +2 -0
  867. package/lib/esm/reducers/AvailabilityReducer.d.ts +53 -0
  868. package/lib/esm/reducers/AvailabilityReducer.js +2 -0
  869. package/lib/esm/reducers/BillingAddressReducer.d.ts +31 -0
  870. package/lib/esm/reducers/BillingAddressReducer.js +2 -0
  871. package/lib/esm/reducers/CustomerReducer.d.ts +183 -0
  872. package/lib/esm/reducers/CustomerReducer.js +2 -0
  873. package/lib/esm/reducers/GiftCardReducer.d.ts +66 -0
  874. package/lib/esm/reducers/GiftCardReducer.js +2 -0
  875. package/lib/esm/reducers/InStockSubscriptionReducer.d.ts +33 -0
  876. package/lib/esm/reducers/InStockSubscriptionReducer.js +2 -0
  877. package/lib/esm/reducers/LineItemReducer.d.ts +47 -0
  878. package/lib/esm/reducers/LineItemReducer.js +2 -0
  879. package/lib/esm/reducers/OrderReducer.d.ts +171 -0
  880. package/lib/esm/reducers/OrderReducer.js +2 -0
  881. package/lib/esm/reducers/PaymentMethodReducer.d.ts +161 -0
  882. package/lib/esm/reducers/PaymentMethodReducer.js +2 -0
  883. package/lib/esm/reducers/PlaceOrderReducer.d.ts +72 -0
  884. package/lib/esm/reducers/PlaceOrderReducer.js +2 -0
  885. package/lib/esm/reducers/PriceReducer.d.ts +35 -0
  886. package/lib/esm/reducers/PriceReducer.js +2 -0
  887. package/lib/esm/reducers/ShipmentReducer.d.ts +41 -0
  888. package/lib/esm/reducers/ShipmentReducer.js +2 -0
  889. package/lib/esm/reducers/ShippingAddressReducer.d.ts +32 -0
  890. package/lib/esm/reducers/ShippingAddressReducer.js +2 -0
  891. package/lib/esm/reducers/SkuListsReducer.d.ts +21 -0
  892. package/lib/esm/reducers/SkuListsReducer.js +2 -0
  893. package/lib/esm/reducers/SkuReducer.d.ts +21 -0
  894. package/lib/esm/reducers/SkuReducer.js +2 -0
  895. package/lib/esm/typings/errors.d.ts +15 -0
  896. package/lib/esm/typings/errors.js +2 -0
  897. package/lib/esm/typings/globals.d.ts +6 -0
  898. package/lib/esm/typings/globals.js +2 -0
  899. package/lib/esm/typings/index.d.ts +117 -0
  900. package/lib/esm/typings/index.js +2 -0
  901. package/lib/esm/utils/PropsType.d.ts +33 -0
  902. package/lib/esm/utils/PropsType.js +2 -0
  903. package/lib/esm/utils/addressesManager.d.ts +64 -0
  904. package/lib/esm/utils/addressesManager.js +2 -0
  905. package/lib/esm/utils/adyen/manageGiftCard.d.ts +16 -0
  906. package/lib/esm/utils/adyen/manageGiftCard.js +2 -0
  907. package/lib/esm/utils/baseReducer.d.ts +3 -0
  908. package/lib/esm/utils/baseReducer.js +2 -0
  909. package/lib/esm/utils/browserInfo.d.ts +12 -0
  910. package/lib/esm/utils/browserInfo.js +2 -0
  911. package/lib/esm/utils/canPlaceOrder.d.ts +5 -0
  912. package/lib/esm/utils/canPlaceOrder.js +2 -0
  913. package/lib/esm/utils/checkIncludeResource.d.ts +8 -0
  914. package/lib/esm/utils/checkIncludeResource.js +2 -0
  915. package/lib/esm/utils/compareObjAttribute.d.ts +7 -0
  916. package/lib/esm/utils/compareObjAttribute.js +2 -0
  917. package/lib/esm/utils/countryStateCity.d.ts +801 -0
  918. package/lib/esm/utils/countryStateCity.js +2 -0
  919. package/lib/esm/utils/customMessages.d.ts +2 -0
  920. package/lib/esm/utils/customMessages.js +2 -0
  921. package/lib/esm/utils/customerOrderOptions.d.ts +3 -0
  922. package/lib/esm/utils/customerOrderOptions.js +2 -0
  923. package/lib/esm/utils/events.d.ts +5 -0
  924. package/lib/esm/utils/events.js +2 -0
  925. package/lib/esm/utils/expressPaymentHelper.d.ts +92 -0
  926. package/lib/esm/utils/expressPaymentHelper.js +2 -0
  927. package/lib/esm/utils/filterChildren.d.ts +12 -0
  928. package/lib/esm/utils/filterChildren.js +2 -0
  929. package/lib/esm/utils/formCleaner.d.ts +4 -0
  930. package/lib/esm/utils/formCleaner.js +2 -0
  931. package/lib/esm/utils/getAmount.d.ts +7 -0
  932. package/lib/esm/utils/getAmount.js +2 -0
  933. package/lib/esm/utils/getApplicationLink.d.ts +35 -0
  934. package/lib/esm/utils/getApplicationLink.js +2 -0
  935. package/lib/esm/utils/getCardDetails.d.ts +16 -0
  936. package/lib/esm/utils/getCardDetails.js +2 -0
  937. package/lib/esm/utils/getCustomerIdByToken.d.ts +6 -0
  938. package/lib/esm/utils/getCustomerIdByToken.js +2 -0
  939. package/lib/esm/utils/getDomain.d.ts +4 -0
  940. package/lib/esm/utils/getDomain.js +2 -0
  941. package/lib/esm/utils/getErrors.d.ts +19 -0
  942. package/lib/esm/utils/getErrors.js +2 -0
  943. package/lib/esm/utils/getLineItemsCount.d.ts +10 -0
  944. package/lib/esm/utils/getLineItemsCount.js +2 -0
  945. package/lib/esm/utils/getLoaderComponent.d.ts +3 -0
  946. package/lib/esm/utils/getLoaderComponent.js +2 -0
  947. package/lib/esm/utils/getPaymentAttributes.d.ts +17 -0
  948. package/lib/esm/utils/getPaymentAttributes.js +2 -0
  949. package/lib/esm/utils/getPrices.d.ts +6 -0
  950. package/lib/esm/utils/getPrices.js +2 -0
  951. package/lib/esm/utils/getPublicIp.d.ts +1 -0
  952. package/lib/esm/utils/getPublicIp.js +2 -0
  953. package/lib/esm/utils/getSdk.d.ts +3 -0
  954. package/lib/esm/utils/getSdk.js +2 -0
  955. package/lib/esm/utils/getSkus.d.ts +3 -0
  956. package/lib/esm/utils/getSkus.js +2 -0
  957. package/lib/esm/utils/hasSubscriptions.d.ts +7 -0
  958. package/lib/esm/utils/hasSubscriptions.js +2 -0
  959. package/lib/esm/utils/hooks/useCustomContext.d.ts +21 -0
  960. package/lib/esm/utils/hooks/useCustomContext.js +2 -0
  961. package/lib/esm/utils/hooks/useExternalScript.d.ts +1 -0
  962. package/lib/esm/utils/hooks/useExternalScript.js +2 -0
  963. package/lib/esm/utils/icons.d.ts +2 -0
  964. package/lib/esm/utils/icons.js +2 -0
  965. package/lib/esm/utils/isDate.d.ts +1 -0
  966. package/lib/esm/utils/isDate.js +2 -0
  967. package/lib/esm/utils/isEmpty.d.ts +1 -0
  968. package/lib/esm/utils/isEmpty.js +2 -0
  969. package/lib/esm/utils/isGuestToken.d.ts +6 -0
  970. package/lib/esm/utils/isGuestToken.js +2 -0
  971. package/lib/esm/utils/isJSON.d.ts +1 -0
  972. package/lib/esm/utils/isJSON.js +2 -0
  973. package/lib/esm/utils/jwt.d.ts +27 -0
  974. package/lib/esm/utils/jwt.js +2 -0
  975. package/lib/esm/utils/localStorage.d.ts +11 -0
  976. package/lib/esm/utils/localStorage.js +2 -0
  977. package/lib/esm/utils/omit.d.ts +1 -0
  978. package/lib/esm/utils/omit.js +2 -0
  979. package/lib/esm/utils/organization.d.ts +18 -0
  980. package/lib/esm/utils/organization.js +2 -0
  981. package/lib/esm/utils/payment-methods/sortPaymentMethods.d.ts +2 -0
  982. package/lib/esm/utils/payment-methods/sortPaymentMethods.js +2 -0
  983. package/lib/esm/utils/pick.d.ts +1 -0
  984. package/lib/esm/utils/pick.js +2 -0
  985. package/lib/esm/utils/placeholderImages.d.ts +2 -0
  986. package/lib/esm/utils/placeholderImages.js +2 -0
  987. package/lib/esm/utils/promisify.d.ts +1 -0
  988. package/lib/esm/utils/promisify.js +2 -0
  989. package/lib/esm/utils/replace.d.ts +2 -0
  990. package/lib/esm/utils/replace.js +2 -0
  991. package/lib/esm/utils/scrollbarWidth.d.ts +1 -0
  992. package/lib/esm/utils/scrollbarWidth.js +2 -0
  993. package/lib/esm/utils/shipments.d.ts +3 -0
  994. package/lib/esm/utils/shipments.js +2 -0
  995. package/lib/esm/utils/snakeToCamelCase.d.ts +5 -0
  996. package/lib/esm/utils/snakeToCamelCase.js +2 -0
  997. package/lib/esm/utils/stripe/retrievePaymentIntent.d.ts +14 -0
  998. package/lib/esm/utils/stripe/retrievePaymentIntent.js +2 -0
  999. package/lib/esm/utils/triggerAttributeHelper.d.ts +31 -0
  1000. package/lib/esm/utils/triggerAttributeHelper.js +2 -0
  1001. package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +8 -0
  1002. package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.js +2 -0
  1003. package/lib/esm/utils/validateFormFields.d.ts +16 -0
  1004. package/lib/esm/utils/validateFormFields.js +2 -0
  1005. package/lib/tsconfig.prod.esm.tsbuildinfo +1 -0
  1006. package/lib/tsconfig.prod.tsbuildinfo +1 -0
  1007. package/package.json +152 -13
  1008. package/lib/index.cjs +0 -3
  1009. package/lib/index.cjs.map +0 -1
  1010. package/lib/index.d.cts +0 -3266
  1011. package/lib/index.d.ts +0 -3266
  1012. package/lib/index.js +0 -3
  1013. package/lib/index.js.map +0 -1
@@ -0,0 +1,4 @@
1
+ import type { BaseAmountComponent } from '../../typings/index';
2
+ import type { JSX } from "react";
3
+ export declare function SubTotalAmount(props: BaseAmountComponent): JSX.Element;
4
+ export default SubTotalAmount;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"../utils/BaseOrderPrice";export function SubTotalAmount(props){return _jsx(BaseOrderPrice,{base:"amount",type:"subtotal",...props})}export default SubTotalAmount;
@@ -0,0 +1,4 @@
1
+ import type { BaseAmountComponent } from '../../typings/index';
2
+ import type { JSX } from "react";
3
+ export declare function TaxesAmount(props: BaseAmountComponent): JSX.Element;
4
+ export default TaxesAmount;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"../utils/BaseOrderPrice";export function TaxesAmount(props){return _jsx(BaseOrderPrice,{base:"amount",type:"total_tax",...props})}export default TaxesAmount;
@@ -0,0 +1,4 @@
1
+ import type { BaseAmountComponent } from "../../typings/index";
2
+ import { type JSX } from "react";
3
+ export declare function TotalAmount(props: BaseAmountComponent): JSX.Element | null;
4
+ export default TotalAmount;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"../utils/BaseOrderPrice";import{useContext}from"react";import Parent from"../utils/Parent";import OrderContext from"../../context/OrderContext";import{manageGiftCard}from"../../utils/adyen/manageGiftCard";export function TotalAmount(props){const{manageAdyenGiftCard,order}=useContext(OrderContext);if(manageAdyenGiftCard){const giftCardData=manageGiftCard({order});if(!giftCardData)return _jsx(BaseOrderPrice,{base:"total_amount",type:"with_taxes",...props});const parentProps={price:`${giftCardData?.formattedOrderTotal}`,...props};return props.children?_jsx(Parent,{...parentProps,children:props.children}):_jsx("span",{...props,children:`${giftCardData?.formattedOrderTotal}`})}return _jsx(BaseOrderPrice,{base:"total_amount",type:"with_taxes",...props})}export default TotalAmount;
@@ -0,0 +1,14 @@
1
+ import type { ConditionalElement } from '../../typings/index';
2
+ import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
3
+ import type { JSX } from "react";
4
+ type ParcelFieldChildrenProps = TGenericChildrenProps<TResources['Parcel']>;
5
+ type TCondition = ConditionalElement<Exclude<TResources['Parcel'], 'resource'>>;
6
+ type Props = {
7
+ children?: (props: ParcelFieldChildrenProps) => JSX.Element;
8
+ } & TCondition;
9
+ /**
10
+ * @param props {@link Props}
11
+ * @returns
12
+ */
13
+ export declare function ParcelField<P extends Props>(props: P): JSX.Element;
14
+ export default ParcelField;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import GenericFieldComponent from"../utils/GenericFieldComponent";import ParcelChildrenContext from"../../context/ParcelChildrenContext";export function ParcelField(props){const{attribute,tagElement="span",children,...p}=props;return _jsx(GenericFieldComponent,{resource:"parcel",attribute,tagElement,context:ParcelChildrenContext,...p,children})}export default ParcelField;
@@ -0,0 +1,7 @@
1
+ import type { DefaultChildrenType } from '../../typings/globals';
2
+ import { type JSX } from 'react';
3
+ interface Props {
4
+ children: DefaultChildrenType;
5
+ }
6
+ export declare function ParcelLineItem({ children }: Props): JSX.Element;
7
+ export default ParcelLineItem;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import ParcelChildrenContext from"../../context/ParcelChildrenContext";import ParcelLineItemChildrenContext from"../../context/ParcelLineItemChildrenContext";import{useContext}from"react";export function ParcelLineItem({children}){const{parcel}=useContext(ParcelChildrenContext),components=parcel?.parcel_line_items?.map((parcelLineItem,key)=>_jsx(ParcelLineItemChildrenContext.Provider,{value:{parcelLineItem},children},key));return _jsx(_Fragment,{children:components})}export default ParcelLineItem;
@@ -0,0 +1,14 @@
1
+ import type { ConditionalElement } from '../../typings/index';
2
+ import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
3
+ import type { JSX } from "react";
4
+ type ParcelLineItemFieldChildrenProps = TGenericChildrenProps<TResources['ParcelLineItem']>;
5
+ type TCondition = ConditionalElement<Exclude<TResources['ParcelLineItem'], 'resource'>>;
6
+ type Props = {
7
+ children?: (props: ParcelLineItemFieldChildrenProps) => JSX.Element;
8
+ } & TCondition;
9
+ /**
10
+ * @param props {@link Props}
11
+ * @returns
12
+ */
13
+ export declare function ParcelLineItemField<P extends Props>(props: P): JSX.Element;
14
+ export default ParcelLineItemField;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import GenericFieldComponent from"../utils/GenericFieldComponent";import ParcelLineItemChildrenContext from"../../context/ParcelLineItemChildrenContext";export function ParcelLineItemField(props){const{attribute,tagElement="span",children,...p}=props;return _jsx(GenericFieldComponent,{resource:"parcelLineItem",attribute,tagElement,context:ParcelLineItemChildrenContext,...p,children})}export default ParcelLineItemField;
@@ -0,0 +1,18 @@
1
+ import type { ChildrenFunction } from '../../typings/index';
2
+ import type { Parcel } from '@commercelayer/sdk';
3
+ import type { JSX } from "react";
4
+ interface ChildrenProps extends Omit<Props, 'children'> {
5
+ /**
6
+ * Parcel of the current shipment
7
+ */
8
+ parcel?: Parcel;
9
+ /**
10
+ * Quantity of the parcel line items
11
+ */
12
+ quantity: number;
13
+ }
14
+ interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
15
+ children?: ChildrenFunction<ChildrenProps>;
16
+ }
17
+ export declare function ParcelLineItemsCount({ children, ...p }: Props): JSX.Element;
18
+ export default ParcelLineItemsCount;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import ParcelChildrenContext from"../../context/ParcelChildrenContext";import useCustomContext from"../../utils/hooks/useCustomContext";export function ParcelLineItemsCount({children,...p}){const{parcel}=useCustomContext({context:ParcelChildrenContext,contextComponentName:"Parcels",currentComponentName:"ParcelLineItemsCount",key:"parcel"}),quantity=parcel?.parcel_line_items?.length??0,childrenProps={...p,quantity,parcel};return children?_jsx(Parent,{...childrenProps,children}):_jsx("span",{...p,children:quantity})}export default ParcelLineItemsCount;
@@ -0,0 +1,7 @@
1
+ import { type JSX } from 'react';
2
+ interface Props {
3
+ children: JSX.Element | JSX.Element[];
4
+ filterBy?: string[];
5
+ }
6
+ export declare function Parcels({ children, filterBy }: Props): JSX.Element;
7
+ export default Parcels;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import ParcelChildrenContext from"../../context/ParcelChildrenContext";import ShipmentChildrenContext from"../../context/ShipmentChildrenContext";import{useContext}from"react";export function Parcels({children,filterBy}){const{parcels}=useContext(ShipmentChildrenContext),components=parcels?.filter(parcel=>filterBy?.includes(parcel.id)??!0).map((parcel,key)=>_jsx(ParcelChildrenContext.Provider,{value:{parcel},children},key));return _jsx(_Fragment,{children:components})}export default Parcels;
@@ -0,0 +1,18 @@
1
+ import type { ChildrenFunction } from '../../typings/index';
2
+ import type { Parcel } from '@commercelayer/sdk';
3
+ import type { JSX } from "react";
4
+ interface ChildrenProps extends Omit<Props, 'children'> {
5
+ /**
6
+ * Shipments of the current order
7
+ */
8
+ parcels?: Parcel[] | null;
9
+ /**
10
+ * Quantity of the parcels
11
+ */
12
+ quantity: number;
13
+ }
14
+ interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
15
+ children?: ChildrenFunction<ChildrenProps>;
16
+ }
17
+ export declare function ParcelsCount({ children, ...p }: Props): JSX.Element;
18
+ export default ParcelsCount;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import ShipmentChildrenContext from"../../context/ShipmentChildrenContext";import useCustomContext from"../../utils/hooks/useCustomContext";export function ParcelsCount({children,...p}){const{parcels}=useCustomContext({context:ShipmentChildrenContext,contextComponentName:"ShipmentsContainer",currentComponentName:"ParcelsCount",key:"parcels"}),quantity=parcels?.length??0,childrenProps={...p,quantity,parcels};return children?_jsx(Parent,{...childrenProps,children}):_jsx("span",{...p,children:quantity})}export default ParcelsCount;
@@ -0,0 +1,5 @@
1
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
2
+ import { type JSX } from 'react';
3
+ type Props = GatewayBaseType;
4
+ export declare function AdyenGateway(props: Props): JSX.Element | null;
5
+ export default AdyenGateway;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import CommerceLayerContext from"../../context/CommerceLayerContext";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import isEmpty from"lodash/isEmpty";import{useContext}from"react";import AdyenPayment from"../payment_source/AdyenPayment";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import{jwt}from"../../utils/jwt";import getCardDetails from"../../utils/getCardDetails";import{getPaymentAttributes}from"../../utils/getPaymentAttributes";export function AdyenGateway(props){const{readonly,showCard,handleEditClick,children,templateCustomerCards,loading,loaderComponent,templateCustomerSaveToWallet,...p}=props,{order}=useContext(OrderContext),{accessToken}=useContext(CommerceLayerContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="adyen_payments",locale=order?.language_code;if(!readonly&&payment?.id!==currentPaymentMethodId)return null;const clientKey=paymentSource?.public_key,environment=accessToken&&jwt(accessToken).test?"test":"live",paymentConfig=getPaymentAttributes({resource:paymentResource,config:config??{},keys:["adyen_payments"]})?.adyenPayment,customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>customerPayment.payment_source?.type==="adyen_payments"||customerPayment.payment_method!=null):[];if(readonly||showCard){const card=getCardDetails({customerPayment:{payment_source:paymentSource},paymentType:paymentResource}),value={...card,showCard,handleEditClick,readonly};return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,{value,children})}const hasStoredPaymentMethods=paymentSource?.payment_methods?.storedPaymentMethods!=null&&paymentSource?.payment_methods?.storedPaymentMethods.length>0;return!isGuest&&templateCustomerCards?_jsxs(_Fragment,{children:[hasStoredPaymentMethods||isEmpty(customerPayments)?null:_jsx("div",{className:p.className,children:_jsx(PaymentCardsTemplate,{paymentResource,customerPayments,children:templateCustomerCards})}),_jsx(AdyenPayment,{templateCustomerSaveToWallet,clientKey,locale,environment,config:paymentConfig})]}):_jsx(AdyenPayment,{clientKey,locale,config:paymentConfig,environment})}export default AdyenGateway;
@@ -0,0 +1,5 @@
1
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
2
+ import { type JSX } from 'react';
3
+ type Props = GatewayBaseType;
4
+ export declare function BraintreeGateway(props: Props): JSX.Element | null;
5
+ export default BraintreeGateway;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import BraintreePayment from"../payment_source/BraintreePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import getCardDetails from"../../utils/getCardDetails";import isEmpty from"lodash/isEmpty";import{useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import{getPaymentAttributes}from"../../utils/getPaymentAttributes";export function BraintreeGateway(props){const{readonly,showCard,handleEditClick,children,templateCustomerCards,loading,loaderComponent,templateCustomerSaveToWallet,...p}=props,{order}=useContext(OrderContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="braintree_payments",locale=order?.language_code;if(!readonly&&payment?.id!==currentPaymentMethodId)return null;const authorization=paymentSource?.client_token,paymentConfig=getPaymentAttributes({resource:paymentResource,config:config??{},keys:["braintree_payments"]})?.braintreePayment,customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>customerPayment.payment_source?.type==="braintree_payments"):[];if(readonly||showCard){const card=getCardDetails({customerPayment:{payment_source:paymentSource},paymentType:paymentResource}),value={...card,showCard,handleEditClick,readonly};return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,{value,children})}return!isGuest&&templateCustomerCards?_jsxs(_Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",{className:p.className,children:_jsx(PaymentCardsTemplate,{paymentResource,customerPayments,children:templateCustomerCards})}),_jsx(BraintreePayment,{templateCustomerSaveToWallet,authorization,locale,config:paymentConfig})]}):_jsx(BraintreePayment,{locale,authorization,config:paymentConfig})}export default BraintreeGateway;
@@ -0,0 +1,5 @@
1
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
2
+ import { type JSX } from 'react';
3
+ type Props = GatewayBaseType;
4
+ export declare function CheckoutComGateway(props: Props): JSX.Element | null;
5
+ export default CheckoutComGateway;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import CheckoutComPayment from"../payment_source/CheckoutComPayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import React from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import getCardDetails from"../../utils/getCardDetails";export function CheckoutComGateway(props){const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,loaderComponent,templateCustomerSaveToWallet,...p}=props,{order}=React.useContext(OrderContext),{payment}=React.useContext(PaymentMethodChildrenContext),{payments,isGuest}=React.useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=React.useContext(PaymentMethodContext),paymentResource="checkout_com_payments",locale=order?.language_code;if(!readonly&&payment?.id!==currentPaymentMethodId)return null;const publicKey=paymentSource?.public_key,paymentConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>customerPayment.payment_source?.type===paymentResource):[];if(readonly||showCard){const card=getCardDetails({customerPayment:{payment_source:paymentSource},paymentType:paymentResource}),value={...card,showCard,handleEditClick,readonly};return card.brand?_jsx(PaymentSourceContext.Provider,{value,children}):null}return!isGuest&&templateCustomerCards?_jsxs(_Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",{className:p.className,children:_jsx(PaymentCardsTemplate,{paymentResource,customerPayments,children:templateCustomerCards})}),_jsx(CheckoutComPayment,{show,templateCustomerSaveToWallet,publicKey,locale,...paymentConfig})]}):_jsx(CheckoutComPayment,{show,publicKey,locale,...paymentConfig})}export default CheckoutComGateway;
@@ -0,0 +1,5 @@
1
+ import type { GatewayBaseType } from "../payment_gateways/PaymentGateway";
2
+ import { type JSX } from "react";
3
+ type Props = GatewayBaseType;
4
+ export declare function ExternalGateway(props: Props): JSX.Element | null;
5
+ export default ExternalGateway;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import ExternalPayment from"../payment_source/ExternalPayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import getCardDetails from"../../utils/getCardDetails";import isEmpty from"lodash/isEmpty";import React from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export function ExternalGateway(props){const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,loaderComponent,templateCustomerSaveToWallet,...p}=props,{order}=React.useContext(OrderContext),{payment}=React.useContext(PaymentMethodChildrenContext),{payments,isGuest}=React.useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=React.useContext(PaymentMethodContext),paymentResource="external_payments",locale=order?.language_code;if(!readonly&&payment?.id!==currentPaymentMethodId)return null;const paymentSourceToken=paymentSource?.payment_source_token,paymentConfig=(config?getPaymentConfig(paymentResource,config):{})?.externalPayment,customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>customerPayment.payment_source?.type===paymentResource):[];if(readonly){const card=getCardDetails({customerPayment:{payment_source:paymentSource},paymentType:paymentResource}),value={...card,showCard,handleEditClick,readonly};return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,{value,children})}return!isGuest&&templateCustomerCards?_jsxs(_Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",{className:p.className,children:_jsx(PaymentCardsTemplate,{paymentResource,customerPayments,children:templateCustomerCards})}),_jsx(ExternalPayment,{show,templateCustomerSaveToWallet,paymentSourceToken,locale,...paymentConfig})]}):_jsx(ExternalPayment,{show,paymentSourceToken,locale,...paymentConfig})}export default ExternalGateway;
@@ -0,0 +1,5 @@
1
+ import { type JSX } from 'react';
2
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
+ type Props = GatewayBaseType;
4
+ export declare function KlarnaGateway(props: Props): JSX.Element | null;
5
+ export default KlarnaGateway;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import React from"react";import KlarnaPayment from"../payment_source/KlarnaPayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import getCardDetails from"../../utils/getCardDetails";export function KlarnaGateway(props){const{readonly,showCard,handleEditClick,children,templateCustomerCards,loading,loaderComponent,...p}=props,{order}=React.useContext(OrderContext),{payment}=React.useContext(PaymentMethodChildrenContext),{payments,isGuest}=React.useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=React.useContext(PaymentMethodContext),paymentResource="klarna_payments",locale=order?.language_code;if(!readonly&&payment?.id!==currentPaymentMethodId)return null;const clientToken=paymentSource?.client_token,klarnaConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>customerPayment.payment_source?.type===paymentResource):[];if(readonly||showCard){const card=getCardDetails({customerPayment:{payment_source:paymentSource},paymentType:paymentResource}),value={...card,showCard,handleEditClick,readonly};return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,{value,children})}return!isGuest&&templateCustomerCards?_jsxs(_Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",{className:p.className,children:_jsx(PaymentCardsTemplate,{paymentResource,customerPayments,children:templateCustomerCards})}),_jsx(KlarnaPayment,{clientToken,locale,...klarnaConfig})]}):_jsx(KlarnaPayment,{clientToken,locale,...klarnaConfig})}export default KlarnaGateway;
@@ -0,0 +1,16 @@
1
+ import type { LoaderType } from '../../typings/index';
2
+ import { type JSX } from 'react';
3
+ import type { PaymentSourceProps } from '../payment_source/PaymentSource';
4
+ export type GatewayBaseType = Props & {
5
+ show: boolean;
6
+ loading: boolean;
7
+ loaderComponent: JSX.Element;
8
+ };
9
+ type Props = PaymentSourceProps & {
10
+ showCard: boolean;
11
+ handleEditClick: (e: MouseEvent) => void;
12
+ show: boolean;
13
+ loader?: LoaderType;
14
+ };
15
+ export declare function PaymentGateway({ readonly, showCard, handleEditClick, children, templateCustomerCards, templateCustomerSaveToWallet, onClickCustomerCards, show, loader, ...p }: Props): JSX.Element | null;
16
+ export default PaymentGateway;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import{useContext,useEffect,useState}from"react";import getLoaderComponent from"../../utils/getLoaderComponent";import AdyenGateway from"./AdyenGateway";import StripeGateway from"./StripeGateway";import BraintreeGateway from"./BraintreeGateway";import PaypalGateway from"./PaypalGateway";import WireTransferGateway from"./WireTransferGateway";import CustomerContext from"../../context/CustomerContext";import CheckoutComGateway from"./CheckoutComGateway";import KlarnaGateway from"./KlarnaGateway";import{getExternalPaymentAttributes,getPaypalAttributes,getStripeAttributes}from"../../utils/getPaymentAttributes";import ExternalGateway from"./ExternalGateway";import PlaceOrderContext from"../../context/PlaceOrderContext";export function PaymentGateway({readonly,showCard,handleEditClick,children,templateCustomerCards,templateCustomerSaveToWallet,onClickCustomerCards,show,loader="Loading...",...p}){const loaderComponent=getLoaderComponent(loader),[loading,setLoading]=useState(!0),{payment,expressPayments}=useContext(PaymentMethodChildrenContext),{order}=useContext(OrderContext),{getCustomerPaymentSources}=useContext(CustomerContext),{status}=useContext(PlaceOrderContext),{currentPaymentMethodId,config,currentPaymentMethodType,setPaymentSource,paymentSource}=useContext(PaymentMethodContext),paymentResource=readonly?currentPaymentMethodType:payment?.payment_source_type;useEffect(()=>{if(payment?.id===currentPaymentMethodId&&paymentResource&&order?.payment_method?.payment_source_type===paymentResource&&!expressPayments){let attributes={};config!=null&&paymentResource==="paypal_payments"&&(attributes=getPaypalAttributes(paymentResource,config)),config!=null&&paymentResource==="external_payments"&&(attributes=getExternalPaymentAttributes(paymentResource,config)),config!=null&&paymentResource==="stripe_payments"&&(attributes=getStripeAttributes(paymentResource,config),attributes!=null&&attributes.return_url==null&&(attributes.return_url=window.location.href));const setPaymentSources=async()=>{order!=null&&await setPaymentSource({paymentResource,order,attributes}),getCustomerPaymentSources&&getCustomerPaymentSources()};(!paymentSource&&order?.payment_method.id&&show&&!expressPayments||(!paymentSource&&!expressPayments||paymentSource?.type!==paymentResource)&&show)&&setPaymentSources(),paymentSource?.mismatched_amounts&&show&&setPaymentSources(),order?.payment_source?.id!=null&&setLoading(!1)}return expressPayments&&show&&setLoading(!1),order?.status!=null&&!["draft","pending"].includes(order?.status)&&show&&order?.payment_source?.id!=null&&setLoading(!1),()=>{setLoading(!0)}},[order?.payment_method?.id,show,paymentSource]),useEffect(()=>(status==="placing"&&setLoading(!0),status==="standby"&&loading&&setLoading(!1),()=>{setLoading(!0)}),[status]);const gatewayConfig={readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet,...p};if(currentPaymentMethodType!==paymentResource)return null;if(loading)return loaderComponent;switch(paymentResource){case"adyen_payments":return _jsx(AdyenGateway,{...gatewayConfig,children});case"braintree_payments":return _jsx(BraintreeGateway,{...gatewayConfig,children});case"checkout_com_payments":return _jsx(CheckoutComGateway,{...gatewayConfig,children});case"external_payments":return _jsx(ExternalGateway,{...gatewayConfig,children});case"klarna_payments":return _jsx(KlarnaGateway,{...gatewayConfig,children});case"stripe_payments":return _jsx(StripeGateway,{...gatewayConfig,children});case"wire_transfers":return _jsx(WireTransferGateway,{...gatewayConfig,children});case"paypal_payments":return _jsx(PaypalGateway,{...gatewayConfig,children});default:return null}}export default PaymentGateway;
@@ -0,0 +1,5 @@
1
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
2
+ import { type JSX } from 'react';
3
+ type Props = Partial<GatewayBaseType>;
4
+ export declare function PaypalGateway(props: Props): JSX.Element | null;
5
+ export default PaypalGateway;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import PaypalPayment from"../payment_source/PaypalPayment";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import getCardDetails from"../../utils/getCardDetails";import{getPaymentAttributes}from"../../utils/getPaymentAttributes";import isEmpty from"lodash/isEmpty";import{useContext}from"react";export function PaypalGateway(props){const{readonly,showCard,handleEditClick,children,...p}=props,{order}=useContext(OrderContext),{payment}=useContext(PaymentMethodChildrenContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="paypal_payments";if(!readonly&&payment?.id!==currentPaymentMethodId)return null;if(readonly){const card=getCardDetails({customerPayment:{payment_source:order?.payment_source||paymentSource},paymentType:paymentResource}),value={...card,showCard,handleEditClick,readonly};return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,{value,children})}const infoMessage=getPaymentAttributes({resource:paymentResource,config:config??{},keys:["paypal_payments"]})?.paypalPayment?.infoMessage;return delete p.show,delete p.templateCustomerCards,delete p.templateCustomerSaveToWallet,delete p.loading,delete p.loaderComponent,delete p.onClickCustomerCards,_jsx(PaypalPayment,{...p,infoMessage})}export default PaypalGateway;
@@ -0,0 +1,5 @@
1
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
2
+ import { type JSX } from 'react';
3
+ type Props = GatewayBaseType;
4
+ export declare function StripeGateway(props: Props): JSX.Element | null;
5
+ export default StripeGateway;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import StripePayment from"../payment_source/StripePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import getCardDetails from"../../utils/getCardDetails";import isEmpty from"lodash/isEmpty";import{useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export function StripeGateway(props){const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,loaderComponent,templateCustomerSaveToWallet,...p}=props,{order}=useContext(OrderContext),{payment,expressPayments}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="stripe_payments",locale=order?.language_code;if(!readonly&&payment?.id!==currentPaymentMethodId)return null;const publishableKey=paymentSource?.publishable_key,clientSecret=paymentSource?.client_secret,stripeConfig=config?getPaymentConfig(paymentResource,config).stripePayment:{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>customerPayment.payment_source?.type===paymentResource):[];if(readonly||showCard){const card=getCardDetails({customerPayment:{payment_source:paymentSource},paymentType:paymentResource});card?.brand===""&&(card.brand=paymentSource?.payment_instrument?.issuer_type??"credit-card");const value={...card,showCard,handleEditClick,readonly,paymentSource};return card?.brand==null?null:_jsx(PaymentSourceContext.Provider,{value,children})}return!isGuest&&templateCustomerCards?_jsxs(_Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",{className:p.className,children:_jsx(PaymentCardsTemplate,{paymentResource,customerPayments,children:templateCustomerCards})}),_jsx(StripePayment,{show,templateCustomerSaveToWallet,publishableKey,clientSecret,expressPayments,locale,...stripeConfig})]}):_jsx(StripePayment,{show,publishableKey,clientSecret,locale,expressPayments,...stripeConfig})}export default StripeGateway;
@@ -0,0 +1,5 @@
1
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
2
+ import { type JSX } from 'react';
3
+ type Props = GatewayBaseType;
4
+ export declare function WireTransferGateway(props: Props): JSX.Element | null;
5
+ export default WireTransferGateway;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import WireTransferPayment from"../payment_source/WireTransferPayment";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import getCardDetails from"../../utils/getCardDetails";import isEmpty from"lodash/isEmpty";import{useContext}from"react";export function WireTransferGateway(props){const{readonly,showCard,handleEditClick,children,...p}=props,{payment}=useContext(PaymentMethodChildrenContext),{order}=useContext(OrderContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="wire_transfers";if(!readonly&&payment?.id!==currentPaymentMethodId)return null;if(readonly){const card=getCardDetails({customerPayment:{payment_source:order?.payment_source||paymentSource},paymentType:paymentResource}),value={...card,showCard,handleEditClick,readonly};return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,{value,children})}const wireTransferConfig=config&&paymentResource?getPaymentConfig(paymentResource,config):{};return _jsx(WireTransferPayment,{...p,...wireTransferConfig?.wireTransfer})}export default WireTransferGateway;
@@ -0,0 +1,45 @@
1
+ import { type JSX } from 'react';
2
+ import type { LoaderType } from '../../typings/index';
3
+ import type { Order, PaymentMethod as PaymentMethodType } from '@commercelayer/sdk';
4
+ import type { PaymentResource } from '../../reducers/PaymentMethodReducer';
5
+ import type { DefaultChildrenType } from '../../typings/globals';
6
+ export interface PaymentMethodOnClickParams {
7
+ payment?: PaymentMethodType | Record<string, any>;
8
+ order?: Order;
9
+ paymentSource?: Order['payment_source'];
10
+ }
11
+ type Props = {
12
+ /**
13
+ * Hide payment methods by an array of strings or a function that returns a boolean
14
+ */
15
+ hide?: PaymentResource[] | ((payment: PaymentMethodType) => boolean);
16
+ children: DefaultChildrenType;
17
+ /**
18
+ * Set CSS classes when the payment method is selected
19
+ */
20
+ activeClass?: string;
21
+ /**
22
+ * Customize the loader component
23
+ */
24
+ loader?: LoaderType;
25
+ /**
26
+ * Auto select the payment method when there is only one available
27
+ */
28
+ autoSelectSinglePaymentMethod?: boolean | (() => void);
29
+ /**
30
+ * Enable express payment. Other payment methods will be disabled.
31
+ */
32
+ expressPayments?: boolean;
33
+ /**
34
+ * Sort payment methods by an array of strings
35
+ */
36
+ sortBy?: Array<PaymentMethodType['payment_source_type']>;
37
+ } & Omit<JSX.IntrinsicElements['div'], 'onClick' | 'children'> & ({
38
+ clickableContainer: true;
39
+ onClick?: (params: PaymentMethodOnClickParams) => void;
40
+ } | {
41
+ clickableContainer?: never;
42
+ onClick?: never;
43
+ });
44
+ export declare function PaymentMethod({ children, className, activeClass, loader, clickableContainer, autoSelectSinglePaymentMethod, expressPayments, hide, onClick, sortBy, ...p }: Props): JSX.Element;
45
+ export default PaymentMethod;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import{useState,useEffect,useContext}from"react";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import getLoaderComponent from"../../utils/getLoaderComponent";import useCustomContext from"../../utils/hooks/useCustomContext";import OrderContext from"../../context/OrderContext";import CustomerContext from"../../context/CustomerContext";import{getExternalPaymentAttributes,getPaypalAttributes}from"../../utils/getPaymentAttributes";import{isEmpty}from"../../utils/isEmpty";import{getAvailableExpressPayments}from"../../utils/expressPaymentHelper";import PlaceOrderContext from"../../context/PlaceOrderContext";import{sortPaymentMethods}from"../../utils/payment-methods/sortPaymentMethods";let loadingResource=!1;export function PaymentMethod({children,className,activeClass,loader="Loading...",clickableContainer,autoSelectSinglePaymentMethod,expressPayments,hide,onClick,sortBy,...p}){const[loading,setLoading]=useState(!0),[paymentSelected,setPaymentSelected]=useState(""),[paymentSourceCreated,setPaymentSourceCreated]=useState(!1),{paymentMethods,currentPaymentMethodId,setPaymentMethod,setLoading:setLoadingPlaceOrder,paymentSource,setPaymentSource,config}=useCustomContext({context:PaymentMethodContext,contextComponentName:"PaymentMethodsContainer",currentComponentName:"PaymentMethod",key:"paymentMethods"}),{order}=useContext(OrderContext),{getCustomerPaymentSources}=useContext(CustomerContext),{status}=useContext(PlaceOrderContext);useEffect(()=>{if(paymentMethods!=null&&!isEmpty(paymentMethods)&&expressPayments){const[paymentMethod]=getAvailableExpressPayments(paymentMethods);!paymentSource&&paymentMethod!=null&&(async()=>{setLoadingPlaceOrder({loading:!0}),setPaymentSelected(paymentMethod.id);const paymentMethodId=paymentMethod?.id,paymentResource=paymentMethod?.payment_source_type;await setPaymentMethod({paymentResource,paymentMethodId});const ps=await setPaymentSource({paymentResource,order});ps&&paymentMethod&&onClick!=null&&(onClick({payment:paymentMethod,order,paymentSource:ps}),setTimeout(()=>{setLoading(!1)},200)),setLoadingPlaceOrder({loading:!1})})()}},[!isEmpty(paymentMethods),expressPayments]),useEffect(()=>{paymentMethods!=null&&!paymentSourceCreated&&!loadingResource&&!isEmpty(paymentMethods)&&(loadingResource=!0,autoSelectSinglePaymentMethod!=null&&!expressPayments&&(async()=>{if(paymentMethods.length===1){const[paymentMethod]=paymentMethods??[];if(paymentMethod&&!paymentSource){setLoadingPlaceOrder({loading:!0}),setPaymentSelected(paymentMethod.id);const paymentMethodId=paymentMethod?.id,paymentResource=paymentMethod?.payment_source_type;await setPaymentMethod({paymentResource,paymentMethodId});let attributes={};config!=null&&paymentResource==="paypal_payments"&&(attributes=getPaypalAttributes(paymentResource,config)),config!=null&&paymentResource==="external_payments"&&(attributes=getExternalPaymentAttributes(paymentResource,config));const ps=await setPaymentSource({paymentResource,order,attributes});ps&&paymentMethod&&onClick!=null&&(setPaymentSourceCreated(!0),onClick({payment:paymentMethod,order,paymentSource:ps}),setTimeout(()=>{setLoading(!1)},200)),getCustomerPaymentSources&&getCustomerPaymentSources(),setLoadingPlaceOrder({loading:!1})}typeof autoSelectSinglePaymentMethod=="function"&&autoSelectSinglePaymentMethod()}else setTimeout(()=>{setLoading(!1)},200)})())},[!isEmpty(paymentMethods),order?.payment_source!=null]),useEffect(()=>(paymentMethods&&(paymentMethods.length===1&&autoSelectSinglePaymentMethod?paymentSource&&setTimeout(()=>{setLoading(!1)},200):setLoading(!1)),currentPaymentMethodId&&setPaymentSelected(currentPaymentMethodId),()=>{setLoading(!0),setPaymentSelected("")}),[paymentMethods,currentPaymentMethodId]);const components=(paymentMethods!=null&&sortBy!=null?sortPaymentMethods(paymentMethods,sortBy):paymentMethods)?.filter(payment=>{if(Array.isArray(hide)){const source=payment?.payment_source_type;return!hide?.includes(source)}else if(typeof hide=="function")return hide(payment);return!0}).map((payment,k)=>{const isActive=currentPaymentMethodId===payment?.id,paymentMethodProps={payment,clickableContainer,paymentSelected,setPaymentSelected,expressPayments},paymentResource=payment?.payment_source_type,onClickable=clickableContainer?async e=>{e.stopPropagation();const paymentMethodId=payment?.id,currentPaymentMethodId2=order?.payment_method?.id;if(paymentMethodId===currentPaymentMethodId2||status==="placing")return;setLoadingPlaceOrder({loading:!0}),setPaymentSelected(payment.id);const{order:updatedOrder}=await setPaymentMethod({paymentResource,paymentMethodId});onClick&&onClick({payment,order:updatedOrder}),setLoadingPlaceOrder({loading:!1})}:void 0;return _jsx("div",{"data-testid":paymentResource,className:`${className??""} ${isActive&&activeClass!=null?activeClass:""}`,onClick:e=>{onClickable?.(e)},...p,children:_jsx(PaymentMethodChildrenContext.Provider,{value:paymentMethodProps,children})},k)});return loading?getLoaderComponent(loader):_jsx(_Fragment,{children:components})}export default PaymentMethod;
@@ -0,0 +1,10 @@
1
+ import type { ChildrenFunction } from '../../typings/index';
2
+ import type { JSX } from "react";
3
+ interface ChildrenProps extends Omit<Props, 'children'> {
4
+ labelName: string;
5
+ }
6
+ interface Props extends Omit<JSX.IntrinsicElements['label'], 'children'> {
7
+ children?: ChildrenFunction<ChildrenProps>;
8
+ }
9
+ export declare function PaymentMethodName(props: Props): JSX.Element;
10
+ export default PaymentMethodName;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import Parent from"../utils/Parent";import useCustomContext from"../../utils/hooks/useCustomContext";export function PaymentMethodName(props){const{payment}=useCustomContext({context:PaymentMethodChildrenContext,contextComponentName:"PaymentMethod",currentComponentName:"PaymentMethodName",key:"payment"}),labelName=payment?.name,htmlFor=payment?.payment_source_type,paymentGateway=payment?.payment_gateway,parentProps={htmlFor,labelName,paymentGateway,...props};return props.children?_jsx(Parent,{...parentProps,children:props.children}):_jsx("label",{htmlFor,...props,children:labelName})}export default PaymentMethodName;
@@ -0,0 +1,8 @@
1
+ import { type JSX } from 'react';
2
+ import type { BaseAmountComponent } from '../../typings/index';
3
+ interface Props extends BaseAmountComponent {
4
+ type?: 'amount';
5
+ labelFree?: string;
6
+ }
7
+ export declare function PaymentMethodPrice(props: Props): JSX.Element;
8
+ export default PaymentMethodPrice;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import{useState,useEffect}from"react";import getAmount from"../../utils/getAmount";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import Parent from"../utils/Parent";import useCustomContext from"../../utils/hooks/useCustomContext";export function PaymentMethodPrice(props){const{format="formatted",type="amount",labelFree="Free",...p}=props,{payment}=useCustomContext({context:PaymentMethodChildrenContext,contextComponentName:"PaymentMethod",currentComponentName:"PaymentMethodPrice",key:"payment"}),[price,setPrice]=useState(""),[priceCents,setPriceCents]=useState(0);useEffect(()=>{if(payment){const p2=getAmount({base:"price",type,format,obj:payment});setPrice(p2);const c=getAmount({base:"price",type,format:"cents",obj:payment});setPriceCents(c)}return()=>{setPrice(""),setPriceCents(0)}},[payment]);const parentProps={labelFree,price,priceCents,...p};return props.children?_jsx(Parent,{...parentProps,children:props.children}):_jsx("span",{...p,children:priceCents===0?labelFree:price})}export default PaymentMethodPrice;
@@ -0,0 +1,17 @@
1
+ import { type ChangeEvent, type JSX } from 'react';
2
+ import type { Order, PaymentMethod } from '@commercelayer/sdk';
3
+ import type { ChildrenFunction } from '../../typings/index';
4
+ interface ChildrenProps extends Omit<Props, 'children'> {
5
+ checked: boolean;
6
+ handleOnChange: (event: ChangeEvent<HTMLInputElement>) => Promise<void>;
7
+ }
8
+ interface TOnChangeParams {
9
+ payment?: PaymentMethod | Record<string, any>;
10
+ order?: Order;
11
+ }
12
+ type Props = {
13
+ children?: ChildrenFunction<ChildrenProps>;
14
+ onChange?: (params: TOnChangeParams) => void;
15
+ } & JSX.IntrinsicElements['input'];
16
+ export declare function PaymentMethodRadioButton(props: Props): JSX.Element;
17
+ export default PaymentMethodRadioButton;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useEffect,useState}from"react";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import Parent from"../utils/Parent";import PaymentMethodContext from"../../context/PaymentMethodContext";import OrderContext from"../../context/OrderContext";import useCustomContext from"../../utils/hooks/useCustomContext";import PlaceOrderContext from"../../context/PlaceOrderContext";export function PaymentMethodRadioButton(props){const{onChange,...p}=props,{payment,paymentSelected,setPaymentSelected,clickableContainer}=useCustomContext({context:PaymentMethodChildrenContext,contextComponentName:"PaymentMethod",currentComponentName:"PaymentMethodRadioButton",key:"payment"}),{order}=useContext(OrderContext),{setPaymentMethod,setLoading}=useContext(PaymentMethodContext),{status}=useContext(PlaceOrderContext),[disabled,setDisabled]=useState(!1),orderId=order?.id||"",paymentResource=payment?.payment_source_type,paymentMethodId=payment?.id??"",name=`payment-${orderId}`,checked=paymentSelected===payment?.id;useEffect(()=>{setDisabled(status==="placing")},[status]);const handleOnChange=async e=>{if(e.stopPropagation(),!checked){if(setPaymentSelected&&setPaymentSelected(paymentMethodId),setLoading({loading:!0}),!clickableContainer){const{order:order2}=await setPaymentMethod({paymentResource,paymentMethodId});onChange&&onChange({payment,order:order2})}setLoading({loading:!1})}},id=payment?.payment_source_type,parentProps={handleOnChange,checked,id,name,disabled,...props};return props.children?_jsx(Parent,{...parentProps,children:props.children}):_jsx("input",{title:name,type:"radio",id,onChange:e=>{handleOnChange(e)},checked,disabled,...p})}export default PaymentMethodRadioButton;
@@ -0,0 +1,8 @@
1
+ import { type ReactNode, type JSX } from 'react';
2
+ import { type PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
3
+ interface Props {
4
+ children: ReactNode;
5
+ config?: PaymentMethodConfig;
6
+ }
7
+ export declare function PaymentMethodsContainer(props: Props): JSX.Element;
8
+ export default PaymentMethodsContainer;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx}from"react/jsx-runtime";import PaymentMethodContext,{defaultPaymentMethodContext}from"../../context/PaymentMethodContext";import{useContext,useEffect,useReducer,useMemo}from"react";import paymentMethodReducer,{paymentMethodInitialState,getPaymentMethods,setPaymentMethodConfig,setPaymentRef}from"../../reducers/PaymentMethodReducer";import OrderContext from"../../context/OrderContext";import CommerceLayerContext from"../../context/CommerceLayerContext";import useCustomContext from"../../utils/hooks/useCustomContext";import{isEmpty}from"../../utils/isEmpty";import{setCustomerOrderParam}from"../../utils/localStorage";export function PaymentMethodsContainer(props){const{children,config}=props,[state,dispatch]=useReducer(paymentMethodReducer,paymentMethodInitialState),{order,getOrder,setOrderErrors,include,addResourceToInclude,updateOrder,includeLoaded}=useCustomContext({context:OrderContext,contextComponentName:"OrderContainer",currentComponentName:"PaymentMethodsContainer",key:"order"}),credentials=useContext(CommerceLayerContext);async function getPayMethods(){order&&await getPaymentMethods({order,dispatch})}useEffect(()=>{include?.includes("available_payment_methods")?includeLoaded?.available_payment_methods||addResourceToInclude({newResourceLoaded:{available_payment_methods:!0,payment_source:!0,payment_method:!0,"line_items.line_item_options.sku_option":!0,"line_items.item":!0}}):addResourceToInclude({newResource:["available_payment_methods","payment_source","payment_method","line_items.line_item_options.sku_option","line_items.item"]}),config&&isEmpty(state.config)&&setPaymentMethodConfig(config,dispatch),credentials&&order&&!state.paymentMethods&&getPayMethods(),order?.payment_source&&dispatch({type:"setPaymentSource",payload:{paymentSource:order?.payment_source}}),order?.payment_source===null&&(setCustomerOrderParam("_save_payment_source_to_customer_wallet","false"),dispatch({type:"setPaymentSource",payload:{paymentSource:void 0}}))},[order,credentials,include?.length,Object.keys(includeLoaded??[]).length]);const contextValue=useMemo(()=>({...state,setLoading:({loading})=>{defaultPaymentMethodContext.setLoading({loading,dispatch})},setPaymentRef:({ref})=>{setPaymentRef({ref,dispatch})},setPaymentMethodErrors:errors=>{defaultPaymentMethodContext.setPaymentMethodErrors(errors,dispatch)},setPaymentMethod:async args=>await defaultPaymentMethodContext.setPaymentMethod({...args,config:credentials,updateOrder,order,dispatch,setOrderErrors}),setPaymentSource:async args=>await defaultPaymentMethodContext.setPaymentSource({...state,...args,config:credentials,dispatch,getOrder,updateOrder,order}),updatePaymentSource:async args=>{await defaultPaymentMethodContext.updatePaymentSource({...args,config:credentials,dispatch})},destroyPaymentSource:async args=>{await defaultPaymentMethodContext.destroyPaymentSource({...args,dispatch,config:credentials,updateOrder,orderId:order?.id})}}),[state]);return _jsx(PaymentMethodContext.Provider,{value:contextValue,children})}export default PaymentMethodsContainer;
@@ -0,0 +1,66 @@
1
+ import { type JSX } from "react";
2
+ import type { PaymentSourceProps } from "./PaymentSource";
3
+ import { type CardConfiguration, type CoreConfiguration, type DropinConfiguration, type PayPalConfiguration, type UIElement, type UIElementProps } from "@adyen/adyen-web/auto";
4
+ interface PaymentMethodsStyle {
5
+ card?: CardConfiguration["styles"];
6
+ paypal?: PayPalConfiguration["style"];
7
+ }
8
+ /**
9
+ * Configuration options for the Adyen payment component.
10
+ */
11
+ export interface AdyenPaymentConfig {
12
+ /**
13
+ * Optional CSS class name for the card container.
14
+ */
15
+ cardContainerClassName?: string;
16
+ /**
17
+ * Optional CSS class name for the 3D Secure container.
18
+ * @deprecated
19
+ */
20
+ threeDSecureContainerClassName?: string;
21
+ /**
22
+ * Callback function to be called when an order is placed.
23
+ * @param response - An object containing the placement status.
24
+ */
25
+ placeOrderCallback?: (response: {
26
+ placed: boolean;
27
+ }) => void;
28
+ /**
29
+ * Optional styles for the payment methods.
30
+ */
31
+ styles?: PaymentMethodsStyle;
32
+ /**
33
+ * Configuration options for the payment methods.
34
+ */
35
+ paymentMethodsConfiguration?: DropinConfiguration["paymentMethodsConfiguration"];
36
+ /**
37
+ * Callback function to disable a stored payment method.
38
+ * @param props - An object containing the recurring detail reference and shopper reference.
39
+ * @returns A promise that resolves to a boolean indicating whether the stored payment method was disabled.
40
+ */
41
+ onDisableStoredPaymentMethod?: (props: {
42
+ recurringDetailReference: string;
43
+ shopperReference: string | undefined;
44
+ }) => Promise<boolean>;
45
+ /**
46
+ * Callback function to be called when the Adyen component is ready.
47
+ * @returns void.
48
+ */
49
+ onReady?: () => void;
50
+ /**
51
+ * onSelect callback function to be called when a payment method is selected.
52
+ * @param component - The selected payment method component.
53
+ * @returns void.
54
+ */
55
+ onSelect?: (component: UIElement<UIElementProps>) => void;
56
+ giftcardErrorComponent?: (message: string) => JSX.Element;
57
+ }
58
+ interface Props {
59
+ clientKey?: string;
60
+ config?: AdyenPaymentConfig;
61
+ templateCustomerSaveToWallet?: PaymentSourceProps["templateCustomerSaveToWallet"];
62
+ locale?: CoreConfiguration["locale"];
63
+ environment?: CoreConfiguration["environment"];
64
+ }
65
+ export declare function AdyenPayment({ clientKey, config, templateCustomerSaveToWallet, environment, locale, }: Props): JSX.Element | null;
66
+ export default AdyenPayment;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext,useEffect,useRef,useState}from"react";import PaymentMethodContext from"../../context/PaymentMethodContext";import{setCustomerOrderParam}from"../../utils/localStorage";import{AdyenCheckout,Dropin}from"@adyen/adyen-web/auto";import Parent from"../utils/Parent";import browserInfo,{cleanUrlBy}from"../../utils/browserInfo";import PlaceOrderContext from"../../context/PlaceOrderContext";import OrderContext from"../../context/OrderContext";import{getPublicIP}from"../../utils/getPublicIp";import CustomerContext from"../../context/CustomerContext";const defaultConfig={};export function AdyenPayment({clientKey,config,templateCustomerSaveToWallet,environment="test",locale="en_US"}){const{cardContainerClassName,styles,onDisableStoredPaymentMethod,giftcardErrorComponent,onReady,onSelect}={...defaultConfig,...config},[loadAdyen,setLoadAdyen]=useState(!1),[checkout,setCheckout]=useState(),[giftcardError,setGiftcardError]=useState(null),{setPaymentSource,paymentSource,setPaymentMethodErrors,currentPaymentMethodType,setPaymentRef,currentCustomerPaymentSourceId}=useContext(PaymentMethodContext),{order,updateOrder}=useContext(OrderContext),{placeOrderButtonRef,setPlaceOrder}=useContext(PlaceOrderContext),{customers}=useContext(CustomerContext),ref=useRef(null),dropinRef=useRef(null),handleSubmit=async e=>{const savePaymentSourceToCustomerWallet=e?.elements?.save_payment_source_to_customer_wallet?.checked;return savePaymentSourceToCustomerWallet&&setCustomerOrderParam("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),dropinRef.current&&dropinRef.current.submit(),!1},handleChange=async state=>{state.isValid&&ref.current&&(ref.current.onsubmit=async()=>await handleSubmit(ref.current),setPaymentRef({ref}))},handleOnAdditionalDetails=async(state,component)=>{const attributes={payment_request_details:state.data,_details:1};try{const pSource=paymentSource&&await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:"adyen_payments",attributes}),resultCode=pSource?.payment_response?.resultCode;if(["Authorised","Pending","Received"].includes(resultCode))return placeOrderButtonRef?.current!=null&&(placeOrderButtonRef.current.disabled&&(placeOrderButtonRef.current.disabled=!1),placeOrderButtonRef.current.click()),{resultCode};if(["Cancelled","Refused"].includes(resultCode)){const message=pSource?.payment_response?.refusalReason;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message}]),component&&component.mount("#adyen-dropin")}return{resultCode}}catch(error){return console.error("Adyen additional details error:",error),{resultCode:"Error"}}},onSubmit=async(state,component)=>{const url=cleanUrlBy(),{type:currentPaymentMethodType2}=state.data.paymentMethod,shopperIp=await getPublicIP(),control=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments"}),controlCode=control?.payment_response?.resultCode,paymentMethodType=control?.payment_response?.paymentMethod?.type??control?.payment_request_data?.payment_method?.type;if(controlCode==="Authorised"&&paymentMethodType!=="giftcard")return{resultCode:controlCode};const attributes={payment_request_data:{...state.data,payment_method:state.data.paymentMethod,return_url:url,origin:window.location.origin,redirect_from_issuer_method:"GET",shopper_ip:shopperIp,shopperInteraction:"Ecommerce",recurringProcessingModel:"CardOnFile",browser_info:{...browserInfo()}}};delete attributes.payment_request_data.paymentMethod;try{if(await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes}),order?.id==null)return console.error("Order id is missing"),{resultCode:"Error"};if(["Cancelled","Refused"].includes(controlCode)&&paymentMethodType==="giftcard"&&currentPaymentMethodType2!=="giftcard"){const availableGiftCardAmount=Number.parseInt(control?.payment_response?.additionalData?.currentBalanceValue),totalPartialAmount=order?.total_amount_with_taxes_cents!=null&&availableGiftCardAmount!=null?order?.total_amount_with_taxes_cents-availableGiftCardAmount:0;return await updateOrder({id:order.id,attributes:{_authorization_amount_cents:totalPartialAmount,_place:!0}}),await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{payment_request_data:control?.payment_request_data}}),await updateOrder({id:order.id,attributes:{_authorize:!0}}),{resultCode:"Authorised",paymentMethodType:currentPaymentMethodType2}}if(currentPaymentMethodType2==="giftcard"){const firstAuthorization=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{_authorize:1}}),resultCode2=firstAuthorization?.payment_response?.resultCode,refusalReasonCode=firstAuthorization?.payment_response?.refusalReasonCode,errorCode=firstAuthorization?.payment_response?.errorCode;if(["Cancelled","Refused"].includes(resultCode2)&&refusalReasonCode!=="12"||errorCode){const message=firstAuthorization?.payment_response?.refusalReason??firstAuthorization?.payment_response?.message;return{resultCode:errorCode?"Refused":resultCode2,message}}return{resultCode:"Authorised",paymentMethodType:currentPaymentMethodType2}}const res=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{_authorize:1}}),action=res?.payment_response?.action,resultCode=res?.payment_response?.resultCode;if(action!=null)return{resultCode,action};const issuerType=res?.payment_instrument?.issuer_type;if(["Authorised","Pending","Received"].includes(resultCode))return["apple pay","google pay"].includes(issuerType)&&setPlaceOrder!=null?(await setPlaceOrder({paymentSource:res,currentCustomerPaymentSourceId}),{resultCode}):(placeOrderButtonRef?.current!=null&&(placeOrderButtonRef.current.disabled&&(placeOrderButtonRef.current.disabled=!1),placeOrderButtonRef.current.click()),{resultCode});if(["Cancelled","Refused"].includes(resultCode)){const message=res?.payment_response?.refusalReason;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType2,message}]),component&&component.mount("#adyen-dropin")}if(res?.payment_response?.errorType)if(res?.payment_response?.errorCode==="14_006")onSubmit(state,component);else{const message=res?.payment_response?.message;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType2,message}])}return{resultCode,paymentMethodType:currentPaymentMethodType2}}catch(error){const{message}=error;return setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType2,message:message??"An error occurred"}]),{resultCode:"Error"}}};return useEffect(()=>{const paymentMethodsResponse={paymentMethods:paymentSource?.payment_methods?.paymentMethods?paymentSource?.payment_methods.paymentMethods:[],storedPaymentMethods:paymentSource?.payment_methods?.storedPaymentMethods?paymentSource?.payment_methods.storedPaymentMethods:[]};paymentMethodsResponse.paymentMethods.length===0&&console.error("Payment methods are not available. Please, check your Adyen configuration.");const showStoredPaymentMethods=paymentSource?.payment_methods?.storedPaymentMethods!=null,options={locale:order?.language_code??locale,environment,clientKey,amount:{currency:order?.currency_code||"",value:order?.total_amount_with_taxes_cents||0},countryCode:order?.country_code||"",paymentMethodsResponse,showPayButton:!1,onAdditionalDetails:(state,element,actions)=>{(async()=>{const{resultCode}=await handleOnAdditionalDetails(state,element);["Cancelled","Refused"].includes(resultCode)?actions.reject():actions.resolve({resultCode})})()},onChange:state=>{handleChange(state)},onSubmit:(state,element,actions)=>{(async()=>{const{resultCode,action,message}=await onSubmit(state,element);["Cancelled","Refused"].includes(resultCode)?(actions.reject(),message&&setGiftcardError(message)):action!=null?dropinRef.current?.handleAction(action):(actions.resolve({resultCode}),dropinRef.current?.mount("#adyen-dropin"),setGiftcardError(null))})()}};if(!ref&&clientKey&&setCustomerOrderParam("_save_payment_source_to_customer_wallet","false"),clientKey&&!loadAdyen&&window&&!checkout){const initializeAdyen=async()=>{const checkout2=await AdyenCheckout(options),dropin=new Dropin(checkout2,{disableFinalAnimation:!0,showRemovePaymentMethodButton:showStoredPaymentMethods,instantPaymentTypes:["applepay","googlepay"],paymentMethodsConfiguration:{showStoredPaymentMethods,paypal:{showPayButton:!0,style:styles?.paypal,...config?.paymentMethodsConfiguration?.paypal},card:{enableStoreDetails:showStoredPaymentMethods,styles:styles?.card,holderNameRequired:!1,...config?.paymentMethodsConfiguration?.card},giftcard:{showPayButton:!0,...config?.paymentMethodsConfiguration?.giftcard},...config?.paymentMethodsConfiguration},onDisableStoredPaymentMethod:state=>{const recurringDetailReference=state,shopperReference=customers?.shopper_reference??void 0;onDisableStoredPaymentMethod?.({recurringDetailReference,shopperReference}).then(response=>{response?setPaymentSource({paymentResource:"adyen_payments",order,attributes:{}}):console.error("onDisableStoredPaymentMethod error")}).catch(error=>{console.error("onDisableStoredPaymentMethod error",error)})},onSelect:component=>{const id=component._id;id.search("scheme")===-1&&ref.current&&(id.search("paypal")===-1?ref.current.onsubmit=async()=>await handleSubmit(ref.current):ref.current.onsubmit=null,setPaymentRef({ref})),onSelect&&onSelect(component)},onReady(){onReady&&onReady()}}).mount("#adyen-dropin");dropin&&checkout2&&(dropinRef.current=dropin,setCheckout(dropin),setLoadAdyen(!0))};dropinRef.current||initializeAdyen()}return()=>{setPaymentRef({ref:{current:null}}),setLoadAdyen(!1)}},[clientKey,ref!=null]),!clientKey&&!loadAdyen&&!checkout?null:_jsxs("form",{ref,onSubmit:e=>{handleSubmit(e)},children:[_jsx("div",{className:cardContainerClassName,id:"adyen-dropin"}),giftcardError!=null&&giftcardErrorComponent?giftcardErrorComponent(giftcardError):null,templateCustomerSaveToWallet&&_jsx(Parent,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})]})}export default AdyenPayment;
@@ -0,0 +1,32 @@
1
+ import { type JSX } from 'react';
2
+ import type { PaymentSourceProps } from './PaymentSource';
3
+ import type { HostedFieldFieldOptions } from 'braintree-web';
4
+ type BraintreeHostedFields<Type> = {
5
+ [Property in keyof Type]: {
6
+ label?: string;
7
+ } & Type[Property];
8
+ };
9
+ export interface BraintreeConfig {
10
+ containerClassName?: string;
11
+ cardContainerClassName?: string;
12
+ expDateContainerClassName?: string;
13
+ fieldsContainerClassName?: string;
14
+ cvvContainerClassName?: string;
15
+ cardDetailsContainerClassName?: string;
16
+ fieldLabelClassName?: string;
17
+ inputWrapperClassName?: string;
18
+ fields?: BraintreeHostedFields<HostedFieldFieldOptions>;
19
+ styles?: Record<string, Record<string, string>>;
20
+ /**
21
+ * Force challenge request for 3D Secure authentication. Default is true.
22
+ */
23
+ challengeRequested?: boolean;
24
+ }
25
+ interface Props {
26
+ authorization: string;
27
+ config?: BraintreeConfig;
28
+ templateCustomerSaveToWallet?: PaymentSourceProps['templateCustomerSaveToWallet'];
29
+ locale?: string;
30
+ }
31
+ export declare function BraintreePayment({ authorization, config, templateCustomerSaveToWallet }: Props): JSX.Element | null;
32
+ export default BraintreePayment;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext,useEffect,useRef,useState}from"react";import PaymentMethodContext from"../../context/PaymentMethodContext";import isEmpty from"lodash/isEmpty";import OrderContext from"../../context/OrderContext";import Parent from"../utils/Parent";import{setCustomerOrderParam}from"../../utils/localStorage";import promisify from"../../utils/promisify";const defaultConfig={styles:{input:{"font-size":"16px",color:"#3A3A3A"},".number":{"font-family":"monospace"},":focus":{color:"blue"},".valid":{color:"green"},".invalid":{color:"red"},"@media screen and (max-width: 700px)":{input:{"font-size":"14px"}}},fields:{number:{label:"Card Number",selector:"#card-number",placeholder:"4111 1111 1111 1111"},cvv:{label:"CVV",selector:"#cvv",placeholder:"123"},expirationDate:{label:"Expiration Date",selector:"#expiration-date",placeholder:"10/2022"}},submitLabel:"Set payment method"};export function BraintreePayment({authorization,config,templateCustomerSaveToWallet}){const{fields,styles,containerClassName,cardContainerClassName,fieldsContainerClassName,expDateContainerClassName,fieldLabelClassName,cvvContainerClassName,inputWrapperClassName,cardDetailsContainerClassName}={...defaultConfig,...config},[loadBraintree,setLoadBraintree]=useState(!1),{setPaymentSource,paymentSource,setPaymentMethodErrors,currentPaymentMethodType,setPaymentRef}=useContext(PaymentMethodContext),{order}=useContext(OrderContext),ref=useRef(null),handleSubmitForm=async({event,hostedFieldsInstance,threeDSInstance})=>{const savePaymentSourceToCustomerWallet=event?.elements?.save_payment_source_to_customer_wallet?.checked;if(savePaymentSourceToCustomerWallet&&setCustomerOrderParam("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),hostedFieldsInstance)try{const payload=await promisify(hostedFieldsInstance).then(payload2=>payload2),billingAddress=order?.billing_address,verifyCardOptions={nonce:payload.nonce,bin:payload.details.bin,amount:`${order?.total_amount_with_taxes_float}`,email:order?.customer_email??"",billingAddress:{givenName:billingAddress?.first_name??"",surname:billingAddress?.last_name??"",phoneNumber:billingAddress?.phone,streetAddress:billingAddress?.line_1,countryCodeAlpha2:billingAddress?.country_code,postalCode:billingAddress?.zip_code??"",region:billingAddress?.state_code,locality:billingAddress?.city},onLookupComplete:(_data,next)=>{next()}},response=await threeDSInstance.verifyCard(verifyCardOptions);if(response?.liabilityShiftPossible===!0&&response?.liabilityShifted===!0&&paymentSource!=null)return await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:"braintree_payments",attributes:{payment_method_nonce:response.nonce,options:{id:response.nonce,card:{last4:response.details.lastFour,exp_year:response.details.expirationYear,exp_month:response.details.expirationMonth,brand:response.details.cardType.toLowerCase()}}}}),!0;throw new Error(`3D Secure authentication failed - ${response?.threeDSecureInfo?.status}`)}catch(error){return console.error(error),setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:error.message}]),!1}return!1};return useEffect(()=>{if(!ref&&authorization&&setCustomerOrderParam("_save_payment_source_to_customer_wallet","false"),authorization&&!loadBraintree&&!isEmpty(window)){const braintreeClient=require("braintree-web/client"),hostedFields=require("braintree-web/hosted-fields"),threeDSecure=require("braintree-web/three-d-secure");braintreeClient.create({authorization,challengeRequested:config?.challengeRequested??!0},(clientErr,clientInstance)=>{if(clientErr){console.error(clientErr);return}hostedFields.create({client:clientInstance,fields,styles},(hostedFieldsErr,hostedFieldsInstance)=>{if(hostedFieldsErr){console.error(hostedFieldsErr);return}setLoadBraintree(!0),threeDSecure.create({authorization,version:2},(threeDSecureErr,threeDSInstance)=>{threeDSecureErr&&(console.error("3DSecure error",threeDSecureErr),setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:threeDSecureErr.message}])),ref.current&&(ref.current.onsubmit=async paymentSource2=>await handleSubmitForm({event:ref.current,hostedFieldsInstance,threeDSInstance,paymentSource:paymentSource2}),setPaymentRef({ref}))})})})}return()=>{setPaymentRef({ref:{current:null}}),setLoadBraintree(!1)}},[authorization,ref]),!authorization&&!loadBraintree?null:_jsx("div",{className:containerClassName,children:_jsxs("form",{ref,id:"braintree-form",onSubmit:handleSubmitForm,className:containerClassName,children:[_jsxs("div",{className:fieldsContainerClassName,children:[_jsxs("div",{className:cardContainerClassName,children:[_jsx("label",{className:fieldLabelClassName,htmlFor:"card-number",children:fields?.number?.label}),_jsx("div",{className:inputWrapperClassName,id:"card-number"})]}),_jsxs("div",{className:cardDetailsContainerClassName,children:[_jsxs("div",{className:expDateContainerClassName,children:[_jsx("label",{className:fieldLabelClassName,htmlFor:"expiration-date",children:fields?.expirationDate?.label}),_jsx("div",{className:inputWrapperClassName,id:"expiration-date"})]}),_jsxs("div",{className:cvvContainerClassName,children:[_jsx("label",{className:fieldLabelClassName,htmlFor:"cvv",children:fields?.cvv?.label}),_jsx("div",{className:inputWrapperClassName,id:"cvv"})]})]})]}),_jsx("div",{className:fieldsContainerClassName,children:templateCustomerSaveToWallet&&_jsx(Parent,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})})]})})}export default BraintreePayment;