@commercelayer/react-components 4.17.0 → 4.19.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 (349) hide show
  1. package/lib/cjs/components/ExternalFunction.d.ts +1 -1
  2. package/lib/cjs/components/MetadataInput.d.ts +1 -1
  3. package/lib/cjs/components/SubmitButton.d.ts +2 -2
  4. package/lib/cjs/components/addresses/Address.d.ts +1 -1
  5. package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +1 -1
  6. package/lib/cjs/components/addresses/AddressField.d.ts +2 -2
  7. package/lib/cjs/components/addresses/AddressInput.d.ts +1 -1
  8. package/lib/cjs/components/addresses/AddressInputSelect.d.ts +1 -1
  9. package/lib/cjs/components/addresses/AddressStateSelector.d.ts +1 -1
  10. package/lib/cjs/components/addresses/AddressesEmpty.d.ts +1 -1
  11. package/lib/cjs/components/addresses/BillingAddressForm.d.ts +1 -1
  12. package/lib/cjs/components/addresses/SaveAddressesButton.d.ts +1 -1
  13. package/lib/cjs/components/addresses/ShippingAddressForm.d.ts +1 -1
  14. package/lib/cjs/components/customers/CustomerContainer.d.ts +1 -1
  15. package/lib/cjs/components/customers/CustomerField.d.ts +1 -1
  16. package/lib/cjs/components/customers/CustomerInput.d.ts +1 -1
  17. package/lib/cjs/components/customers/CustomerPaymentSource.d.ts +1 -1
  18. package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.d.ts +1 -1
  19. package/lib/cjs/components/customers/MyAccountLink.d.ts +1 -1
  20. package/lib/cjs/components/customers/MyIdentityLink.d.ts +1 -1
  21. package/lib/cjs/components/customers/SaveCustomerButton.d.ts +1 -1
  22. package/lib/cjs/components/errors/Errors.d.ts +1 -1
  23. package/lib/cjs/components/gift_cards/GiftCard.d.ts +1 -1
  24. package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +1 -1
  25. package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +1 -1
  26. package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.d.ts +1 -1
  27. package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +2 -2
  28. package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +2 -2
  29. package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.d.ts +2 -2
  30. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +1 -1
  31. package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +1 -1
  32. package/lib/cjs/components/line_items/LineItemAmount.d.ts +1 -1
  33. package/lib/cjs/components/line_items/LineItemCode.d.ts +2 -2
  34. package/lib/cjs/components/line_items/LineItemField.d.ts +1 -1
  35. package/lib/cjs/components/line_items/LineItemImage.d.ts +2 -2
  36. package/lib/cjs/components/line_items/LineItemName.d.ts +1 -1
  37. package/lib/cjs/components/line_items/LineItemOption.d.ts +2 -2
  38. package/lib/cjs/components/line_items/LineItemQuantity.d.ts +2 -2
  39. package/lib/cjs/components/line_items/LineItemRemoveLink.d.ts +2 -2
  40. package/lib/cjs/components/line_items/LineItemsCount.d.ts +1 -1
  41. package/lib/cjs/components/line_items/LineItemsEmpty.d.ts +1 -1
  42. package/lib/cjs/components/orders/AddToCartButton.d.ts +2 -2
  43. package/lib/cjs/components/orders/AdjustmentAmount.d.ts +1 -1
  44. package/lib/cjs/components/orders/CartLink.d.ts +1 -1
  45. package/lib/cjs/components/orders/CheckoutLink.d.ts +1 -1
  46. package/lib/cjs/components/orders/DiscountAmount.d.ts +1 -1
  47. package/lib/cjs/components/orders/GiftCardAmount.d.ts +1 -1
  48. package/lib/cjs/components/orders/OrderContainer.d.ts +1 -1
  49. package/lib/cjs/components/orders/OrderList.d.ts +1 -1
  50. package/lib/cjs/components/orders/OrderListEmpty.d.ts +1 -1
  51. package/lib/cjs/components/orders/OrderListPaginationButtons.d.ts +1 -1
  52. package/lib/cjs/components/orders/OrderListPaginationInfo.d.ts +1 -1
  53. package/lib/cjs/components/orders/OrderStorage.d.ts +1 -1
  54. package/lib/cjs/components/orders/PaymentMethodAmount.d.ts +1 -1
  55. package/lib/cjs/components/orders/PlaceOrderButton.d.ts +1 -1
  56. package/lib/cjs/components/orders/PlaceOrderButton.js +1 -1
  57. package/lib/cjs/components/orders/ShippingAmount.d.ts +1 -1
  58. package/lib/cjs/components/orders/SubTotalAmount.d.ts +1 -1
  59. package/lib/cjs/components/orders/TaxesAmount.d.ts +1 -1
  60. package/lib/cjs/components/orders/TotalAmount.d.ts +1 -1
  61. package/lib/cjs/components/parcels/ParcelField.d.ts +1 -1
  62. package/lib/cjs/components/parcels/ParcelLineItemField.d.ts +1 -1
  63. package/lib/cjs/components/parcels/ParcelLineItemsCount.d.ts +1 -1
  64. package/lib/cjs/components/parcels/ParcelsCount.d.ts +1 -1
  65. package/lib/cjs/components/payment_gateways/AdyenGateway.d.ts +1 -1
  66. package/lib/cjs/components/payment_gateways/AdyenGateway.js +1 -1
  67. package/lib/cjs/components/payment_gateways/BraintreeGateway.d.ts +1 -1
  68. package/lib/cjs/components/payment_gateways/CheckoutComGateway.d.ts +1 -1
  69. package/lib/cjs/components/payment_gateways/ExternalGateway.d.ts +1 -1
  70. package/lib/cjs/components/payment_gateways/KlarnaGateway.d.ts +1 -1
  71. package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +2 -2
  72. package/lib/cjs/components/payment_gateways/PaypalGateway.d.ts +1 -1
  73. package/lib/cjs/components/payment_gateways/StripeGateway.d.ts +1 -1
  74. package/lib/cjs/components/payment_gateways/WireTransferGateway.d.ts +1 -1
  75. package/lib/cjs/components/payment_methods/PaymentMethod.d.ts +5 -1
  76. package/lib/cjs/components/payment_methods/PaymentMethod.js +1 -1
  77. package/lib/cjs/components/payment_methods/PaymentMethodName.d.ts +1 -1
  78. package/lib/cjs/components/payment_methods/PaymentMethodPrice.d.ts +1 -1
  79. package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.d.ts +1 -1
  80. package/lib/cjs/components/payment_source/AdyenPayment.d.ts +11 -42
  81. package/lib/cjs/components/payment_source/AdyenPayment.js +1 -1
  82. package/lib/cjs/components/payment_source/BraintreePayment.d.ts +2 -2
  83. package/lib/cjs/components/payment_source/CheckoutComPayment.d.ts +2 -2
  84. package/lib/cjs/components/payment_source/ExternalPayment.d.ts +2 -2
  85. package/lib/cjs/components/payment_source/KlarnaPayment.d.ts +2 -2
  86. package/lib/cjs/components/payment_source/PaymentSource.d.ts +2 -2
  87. package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.d.ts +1 -1
  88. package/lib/cjs/components/payment_source/PaymentSourceBrandName.d.ts +1 -1
  89. package/lib/cjs/components/payment_source/PaymentSourceEditButton.d.ts +1 -1
  90. package/lib/cjs/components/payment_source/StripePayment.d.ts +3 -3
  91. package/lib/cjs/components/prices/Price.d.ts +2 -2
  92. package/lib/cjs/components/prices/PricesContainer.d.ts +2 -2
  93. package/lib/cjs/components/shipments/ShipmentField.d.ts +1 -1
  94. package/lib/cjs/components/shipments/ShipmentsCount.d.ts +1 -1
  95. package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +1 -1
  96. package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +1 -1
  97. package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +2 -2
  98. package/lib/cjs/components/skus/SkuField.d.ts +1 -1
  99. package/lib/cjs/components/stock_transfers/StockTransferField.d.ts +1 -1
  100. package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +1 -1
  101. package/lib/cjs/components/utils/BaseInput.d.ts +1 -1
  102. package/lib/cjs/components/utils/BaseOrderPrice.d.ts +2 -2
  103. package/lib/cjs/components/utils/BaseSelect.d.ts +1 -1
  104. package/lib/cjs/components/utils/GenericFieldComponent.d.ts +6 -6
  105. package/lib/cjs/components/utils/Parent.d.ts +1 -1
  106. package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +3 -3
  107. package/lib/cjs/components/utils/PriceTemplate.d.ts +1 -1
  108. package/lib/cjs/components/utils/getAllErrors.d.ts +3 -3
  109. package/lib/cjs/context/AddressChildrenContext.d.ts +1 -1
  110. package/lib/cjs/context/AddressContext.d.ts +1 -1
  111. package/lib/cjs/context/BillingAddressContext.d.ts +1 -1
  112. package/lib/cjs/context/CouponAndGiftCardFormContext.d.ts +1 -1
  113. package/lib/cjs/context/CustomerAddressFormContext.d.ts +2 -2
  114. package/lib/cjs/context/CustomerContext.d.ts +1 -1
  115. package/lib/cjs/context/CustomerPaymentSourceContext.d.ts +1 -1
  116. package/lib/cjs/context/GiftCardContext.d.ts +1 -1
  117. package/lib/cjs/context/InStockSubscriptionContext.d.ts +1 -1
  118. package/lib/cjs/context/LineItemChildrenContext.d.ts +1 -1
  119. package/lib/cjs/context/LineItemContext.d.ts +2 -2
  120. package/lib/cjs/context/OrderContext.d.ts +2 -2
  121. package/lib/cjs/context/OrderListChildrenContext.d.ts +3 -3
  122. package/lib/cjs/context/PaymentMethodChildrenContext.d.ts +1 -1
  123. package/lib/cjs/context/ShippingAddressContext.d.ts +1 -1
  124. package/lib/cjs/context/ShippingAddressFormContext.d.ts +1 -1
  125. package/lib/cjs/context/ShippingMethodChildrenContext.d.ts +1 -1
  126. package/lib/cjs/context/SkuChildrenContext.d.ts +1 -1
  127. package/lib/cjs/context/SkuContext.d.ts +1 -1
  128. package/lib/cjs/context/StockTransferChildrenContext.d.ts +1 -1
  129. package/lib/cjs/hooks/useCommerceLayer.d.ts +1 -1
  130. package/lib/cjs/hooks/useCustomerContainer.d.ts +1 -1
  131. package/lib/cjs/hooks/useOrderContainer.d.ts +1 -1
  132. package/lib/cjs/reducers/AddressReducer.d.ts +9 -9
  133. package/lib/cjs/reducers/AvailabilityReducer.d.ts +5 -5
  134. package/lib/cjs/reducers/BillingAddressReducer.d.ts +4 -4
  135. package/lib/cjs/reducers/CustomerReducer.d.ts +4 -4
  136. package/lib/cjs/reducers/GiftCardReducer.d.ts +6 -6
  137. package/lib/cjs/reducers/InStockSubscriptionReducer.d.ts +3 -3
  138. package/lib/cjs/reducers/LineItemReducer.d.ts +6 -6
  139. package/lib/cjs/reducers/OrderReducer.d.ts +6 -6
  140. package/lib/cjs/reducers/PaymentMethodReducer.d.ts +12 -12
  141. package/lib/cjs/reducers/PlaceOrderReducer.d.ts +1 -1
  142. package/lib/cjs/reducers/PlaceOrderReducer.js +1 -1
  143. package/lib/cjs/reducers/PriceReducer.d.ts +5 -5
  144. package/lib/cjs/reducers/ShipmentReducer.d.ts +5 -5
  145. package/lib/cjs/reducers/ShippingAddressReducer.d.ts +4 -4
  146. package/lib/cjs/reducers/SkuListsReducer.d.ts +2 -2
  147. package/lib/cjs/reducers/SkuReducer.d.ts +4 -4
  148. package/lib/cjs/typings/errors.d.ts +1 -1
  149. package/lib/cjs/typings/index.d.ts +2 -2
  150. package/lib/cjs/utils/addressesManager.d.ts +3 -3
  151. package/lib/cjs/utils/baseReducer.d.ts +1 -1
  152. package/lib/cjs/utils/canPlaceOrder.d.ts +1 -1
  153. package/lib/cjs/utils/checkIncludeResource.d.ts +1 -1
  154. package/lib/cjs/utils/customMessages.d.ts +1 -1
  155. package/lib/cjs/utils/expressPaymentHelper.d.ts +4 -4
  156. package/lib/cjs/utils/filterChildren.d.ts +1 -1
  157. package/lib/cjs/utils/formCleaner.d.ts +1 -1
  158. package/lib/cjs/utils/getCardDetails.d.ts +3 -3
  159. package/lib/cjs/utils/getErrors.d.ts +2 -2
  160. package/lib/cjs/utils/getLoaderComponent.d.ts +1 -1
  161. package/lib/cjs/utils/getPaymentAttributes.d.ts +2 -2
  162. package/lib/cjs/utils/getPrices.d.ts +1 -1
  163. package/lib/cjs/utils/getSdk.d.ts +1 -1
  164. package/lib/cjs/utils/getSkus.d.ts +1 -1
  165. package/lib/cjs/utils/hasSubscriptions.d.ts +1 -1
  166. package/lib/cjs/utils/organization.d.ts +4 -4
  167. package/lib/cjs/utils/organization.js +1 -1
  168. package/lib/cjs/utils/payment-methods/sortPaymentMethods.d.ts +2 -0
  169. package/lib/cjs/utils/payment-methods/sortPaymentMethods.js +2 -0
  170. package/lib/cjs/utils/shipments.d.ts +1 -1
  171. package/lib/cjs/utils/triggerAttributeHelper.d.ts +2 -2
  172. package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +2 -2
  173. package/lib/cjs/utils/validateFormFields.d.ts +5 -5
  174. package/lib/esm/components/ExternalFunction.d.ts +1 -1
  175. package/lib/esm/components/MetadataInput.d.ts +1 -1
  176. package/lib/esm/components/SubmitButton.d.ts +2 -2
  177. package/lib/esm/components/addresses/Address.d.ts +1 -1
  178. package/lib/esm/components/addresses/AddressCountrySelector.d.ts +1 -1
  179. package/lib/esm/components/addresses/AddressField.d.ts +2 -2
  180. package/lib/esm/components/addresses/AddressInput.d.ts +1 -1
  181. package/lib/esm/components/addresses/AddressInputSelect.d.ts +1 -1
  182. package/lib/esm/components/addresses/AddressStateSelector.d.ts +1 -1
  183. package/lib/esm/components/addresses/AddressesEmpty.d.ts +1 -1
  184. package/lib/esm/components/addresses/BillingAddressForm.d.ts +1 -1
  185. package/lib/esm/components/addresses/SaveAddressesButton.d.ts +1 -1
  186. package/lib/esm/components/addresses/ShippingAddressForm.d.ts +1 -1
  187. package/lib/esm/components/customers/CustomerContainer.d.ts +1 -1
  188. package/lib/esm/components/customers/CustomerField.d.ts +1 -1
  189. package/lib/esm/components/customers/CustomerInput.d.ts +1 -1
  190. package/lib/esm/components/customers/CustomerPaymentSource.d.ts +1 -1
  191. package/lib/esm/components/customers/CustomerPaymentSourceEmpty.d.ts +1 -1
  192. package/lib/esm/components/customers/MyAccountLink.d.ts +1 -1
  193. package/lib/esm/components/customers/MyIdentityLink.d.ts +1 -1
  194. package/lib/esm/components/customers/SaveCustomerButton.d.ts +1 -1
  195. package/lib/esm/components/errors/Errors.d.ts +1 -1
  196. package/lib/esm/components/gift_cards/GiftCard.d.ts +1 -1
  197. package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +1 -1
  198. package/lib/esm/components/gift_cards/GiftCardInput.d.ts +1 -1
  199. package/lib/esm/components/gift_cards/GiftCardOrCouponCode.d.ts +1 -1
  200. package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +2 -2
  201. package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +2 -2
  202. package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.d.ts +2 -2
  203. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +1 -1
  204. package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +1 -1
  205. package/lib/esm/components/line_items/LineItemAmount.d.ts +1 -1
  206. package/lib/esm/components/line_items/LineItemCode.d.ts +2 -2
  207. package/lib/esm/components/line_items/LineItemField.d.ts +1 -1
  208. package/lib/esm/components/line_items/LineItemImage.d.ts +2 -2
  209. package/lib/esm/components/line_items/LineItemName.d.ts +1 -1
  210. package/lib/esm/components/line_items/LineItemOption.d.ts +2 -2
  211. package/lib/esm/components/line_items/LineItemQuantity.d.ts +2 -2
  212. package/lib/esm/components/line_items/LineItemRemoveLink.d.ts +2 -2
  213. package/lib/esm/components/line_items/LineItemsCount.d.ts +1 -1
  214. package/lib/esm/components/line_items/LineItemsEmpty.d.ts +1 -1
  215. package/lib/esm/components/orders/AddToCartButton.d.ts +2 -2
  216. package/lib/esm/components/orders/AdjustmentAmount.d.ts +1 -1
  217. package/lib/esm/components/orders/CartLink.d.ts +1 -1
  218. package/lib/esm/components/orders/CheckoutLink.d.ts +1 -1
  219. package/lib/esm/components/orders/DiscountAmount.d.ts +1 -1
  220. package/lib/esm/components/orders/GiftCardAmount.d.ts +1 -1
  221. package/lib/esm/components/orders/OrderContainer.d.ts +1 -1
  222. package/lib/esm/components/orders/OrderList.d.ts +1 -1
  223. package/lib/esm/components/orders/OrderListEmpty.d.ts +1 -1
  224. package/lib/esm/components/orders/OrderListPaginationButtons.d.ts +1 -1
  225. package/lib/esm/components/orders/OrderListPaginationInfo.d.ts +1 -1
  226. package/lib/esm/components/orders/OrderStorage.d.ts +1 -1
  227. package/lib/esm/components/orders/PaymentMethodAmount.d.ts +1 -1
  228. package/lib/esm/components/orders/PlaceOrderButton.d.ts +1 -1
  229. package/lib/esm/components/orders/PlaceOrderButton.js +1 -1
  230. package/lib/esm/components/orders/ShippingAmount.d.ts +1 -1
  231. package/lib/esm/components/orders/SubTotalAmount.d.ts +1 -1
  232. package/lib/esm/components/orders/TaxesAmount.d.ts +1 -1
  233. package/lib/esm/components/orders/TotalAmount.d.ts +1 -1
  234. package/lib/esm/components/parcels/ParcelField.d.ts +1 -1
  235. package/lib/esm/components/parcels/ParcelLineItemField.d.ts +1 -1
  236. package/lib/esm/components/parcels/ParcelLineItemsCount.d.ts +1 -1
  237. package/lib/esm/components/parcels/ParcelsCount.d.ts +1 -1
  238. package/lib/esm/components/payment_gateways/AdyenGateway.d.ts +1 -1
  239. package/lib/esm/components/payment_gateways/AdyenGateway.js +1 -1
  240. package/lib/esm/components/payment_gateways/BraintreeGateway.d.ts +1 -1
  241. package/lib/esm/components/payment_gateways/CheckoutComGateway.d.ts +1 -1
  242. package/lib/esm/components/payment_gateways/ExternalGateway.d.ts +1 -1
  243. package/lib/esm/components/payment_gateways/KlarnaGateway.d.ts +1 -1
  244. package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +2 -2
  245. package/lib/esm/components/payment_gateways/PaypalGateway.d.ts +1 -1
  246. package/lib/esm/components/payment_gateways/StripeGateway.d.ts +1 -1
  247. package/lib/esm/components/payment_gateways/WireTransferGateway.d.ts +1 -1
  248. package/lib/esm/components/payment_methods/PaymentMethod.d.ts +5 -1
  249. package/lib/esm/components/payment_methods/PaymentMethod.js +1 -1
  250. package/lib/esm/components/payment_methods/PaymentMethodName.d.ts +1 -1
  251. package/lib/esm/components/payment_methods/PaymentMethodPrice.d.ts +1 -1
  252. package/lib/esm/components/payment_methods/PaymentMethodRadioButton.d.ts +1 -1
  253. package/lib/esm/components/payment_source/AdyenPayment.d.ts +11 -42
  254. package/lib/esm/components/payment_source/AdyenPayment.js +1 -1
  255. package/lib/esm/components/payment_source/BraintreePayment.d.ts +2 -2
  256. package/lib/esm/components/payment_source/CheckoutComPayment.d.ts +2 -2
  257. package/lib/esm/components/payment_source/ExternalPayment.d.ts +2 -2
  258. package/lib/esm/components/payment_source/KlarnaPayment.d.ts +2 -2
  259. package/lib/esm/components/payment_source/PaymentSource.d.ts +2 -2
  260. package/lib/esm/components/payment_source/PaymentSourceBrandIcon.d.ts +1 -1
  261. package/lib/esm/components/payment_source/PaymentSourceBrandName.d.ts +1 -1
  262. package/lib/esm/components/payment_source/PaymentSourceEditButton.d.ts +1 -1
  263. package/lib/esm/components/payment_source/StripePayment.d.ts +3 -3
  264. package/lib/esm/components/prices/Price.d.ts +2 -2
  265. package/lib/esm/components/prices/PricesContainer.d.ts +2 -2
  266. package/lib/esm/components/shipments/ShipmentField.d.ts +1 -1
  267. package/lib/esm/components/shipments/ShipmentsCount.d.ts +1 -1
  268. package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +1 -1
  269. package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +1 -1
  270. package/lib/esm/components/skus/AvailabilityTemplate.d.ts +2 -2
  271. package/lib/esm/components/skus/SkuField.d.ts +1 -1
  272. package/lib/esm/components/stock_transfers/StockTransferField.d.ts +1 -1
  273. package/lib/esm/components/utils/AddressCardsTemplate.d.ts +1 -1
  274. package/lib/esm/components/utils/BaseInput.d.ts +1 -1
  275. package/lib/esm/components/utils/BaseOrderPrice.d.ts +2 -2
  276. package/lib/esm/components/utils/BaseSelect.d.ts +1 -1
  277. package/lib/esm/components/utils/GenericFieldComponent.d.ts +6 -6
  278. package/lib/esm/components/utils/Parent.d.ts +1 -1
  279. package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +3 -3
  280. package/lib/esm/components/utils/PriceTemplate.d.ts +1 -1
  281. package/lib/esm/components/utils/getAllErrors.d.ts +3 -3
  282. package/lib/esm/context/AddressChildrenContext.d.ts +1 -1
  283. package/lib/esm/context/AddressContext.d.ts +1 -1
  284. package/lib/esm/context/BillingAddressContext.d.ts +1 -1
  285. package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +1 -1
  286. package/lib/esm/context/CustomerAddressFormContext.d.ts +2 -2
  287. package/lib/esm/context/CustomerContext.d.ts +1 -1
  288. package/lib/esm/context/CustomerPaymentSourceContext.d.ts +1 -1
  289. package/lib/esm/context/GiftCardContext.d.ts +1 -1
  290. package/lib/esm/context/InStockSubscriptionContext.d.ts +1 -1
  291. package/lib/esm/context/LineItemChildrenContext.d.ts +1 -1
  292. package/lib/esm/context/LineItemContext.d.ts +2 -2
  293. package/lib/esm/context/OrderContext.d.ts +2 -2
  294. package/lib/esm/context/OrderListChildrenContext.d.ts +3 -3
  295. package/lib/esm/context/PaymentMethodChildrenContext.d.ts +1 -1
  296. package/lib/esm/context/ShippingAddressContext.d.ts +1 -1
  297. package/lib/esm/context/ShippingAddressFormContext.d.ts +1 -1
  298. package/lib/esm/context/ShippingMethodChildrenContext.d.ts +1 -1
  299. package/lib/esm/context/SkuChildrenContext.d.ts +1 -1
  300. package/lib/esm/context/SkuContext.d.ts +1 -1
  301. package/lib/esm/context/StockTransferChildrenContext.d.ts +1 -1
  302. package/lib/esm/hooks/useCommerceLayer.d.ts +1 -1
  303. package/lib/esm/hooks/useCustomerContainer.d.ts +1 -1
  304. package/lib/esm/hooks/useOrderContainer.d.ts +1 -1
  305. package/lib/esm/reducers/AddressReducer.d.ts +9 -9
  306. package/lib/esm/reducers/AvailabilityReducer.d.ts +5 -5
  307. package/lib/esm/reducers/BillingAddressReducer.d.ts +4 -4
  308. package/lib/esm/reducers/CustomerReducer.d.ts +4 -4
  309. package/lib/esm/reducers/GiftCardReducer.d.ts +6 -6
  310. package/lib/esm/reducers/InStockSubscriptionReducer.d.ts +3 -3
  311. package/lib/esm/reducers/LineItemReducer.d.ts +6 -6
  312. package/lib/esm/reducers/OrderReducer.d.ts +6 -6
  313. package/lib/esm/reducers/PaymentMethodReducer.d.ts +12 -12
  314. package/lib/esm/reducers/PlaceOrderReducer.d.ts +1 -1
  315. package/lib/esm/reducers/PlaceOrderReducer.js +1 -1
  316. package/lib/esm/reducers/PriceReducer.d.ts +5 -5
  317. package/lib/esm/reducers/ShipmentReducer.d.ts +5 -5
  318. package/lib/esm/reducers/ShippingAddressReducer.d.ts +4 -4
  319. package/lib/esm/reducers/SkuListsReducer.d.ts +2 -2
  320. package/lib/esm/reducers/SkuReducer.d.ts +4 -4
  321. package/lib/esm/typings/errors.d.ts +1 -1
  322. package/lib/esm/typings/index.d.ts +2 -2
  323. package/lib/esm/utils/addressesManager.d.ts +3 -3
  324. package/lib/esm/utils/baseReducer.d.ts +1 -1
  325. package/lib/esm/utils/canPlaceOrder.d.ts +1 -1
  326. package/lib/esm/utils/checkIncludeResource.d.ts +1 -1
  327. package/lib/esm/utils/customMessages.d.ts +1 -1
  328. package/lib/esm/utils/expressPaymentHelper.d.ts +4 -4
  329. package/lib/esm/utils/filterChildren.d.ts +1 -1
  330. package/lib/esm/utils/formCleaner.d.ts +1 -1
  331. package/lib/esm/utils/getCardDetails.d.ts +3 -3
  332. package/lib/esm/utils/getErrors.d.ts +2 -2
  333. package/lib/esm/utils/getLoaderComponent.d.ts +1 -1
  334. package/lib/esm/utils/getPaymentAttributes.d.ts +2 -2
  335. package/lib/esm/utils/getPrices.d.ts +1 -1
  336. package/lib/esm/utils/getSdk.d.ts +1 -1
  337. package/lib/esm/utils/getSkus.d.ts +1 -1
  338. package/lib/esm/utils/hasSubscriptions.d.ts +1 -1
  339. package/lib/esm/utils/organization.d.ts +4 -4
  340. package/lib/esm/utils/organization.js +1 -1
  341. package/lib/esm/utils/payment-methods/sortPaymentMethods.d.ts +2 -0
  342. package/lib/esm/utils/payment-methods/sortPaymentMethods.js +2 -0
  343. package/lib/esm/utils/shipments.d.ts +1 -1
  344. package/lib/esm/utils/triggerAttributeHelper.d.ts +2 -2
  345. package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +2 -2
  346. package/lib/esm/utils/validateFormFields.d.ts +5 -5
  347. package/lib/tsconfig.prod.esm.tsbuildinfo +1 -1
  348. package/lib/tsconfig.prod.tsbuildinfo +1 -1
  349. package/package.json +45 -25
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useEffect,useRef,useState}from"react";import Parent from"../utils/Parent";import PlaceOrderContext from"../../context/PlaceOrderContext";import isFunction from"lodash/isFunction";import PaymentMethodContext from"../../context/PaymentMethodContext";import OrderContext from"../../context/OrderContext";import getCardDetails from"../../utils/getCardDetails";import{checkPaymentIntent}from"../../utils/stripe/retrievePaymentIntent";export function PlaceOrderButton(props){const ref=useRef(null),{children,label="Place order",loadingLabel="Placing...",autoPlaceOrder=!0,disabled,onClick,...p}=props,{isPermitted,setPlaceOrder,options,paymentType,setButtonRef,setPlaceOrderStatus}=useContext(PlaceOrderContext),[notPermitted,setNotPermitted]=useState(!0),[forceDisable,setForceDisable]=useState(disabled),[isLoading,setIsLoading]=useState(!1),{currentPaymentMethodRef,loading,currentPaymentMethodType,paymentSource,setPaymentSource,setPaymentMethodErrors,currentCustomerPaymentSourceId}=useContext(PaymentMethodContext),{order}=useContext(OrderContext),isFree=order?.total_amount_with_taxes_cents===0;useEffect(()=>{if(loading)setNotPermitted(loading);else if(paymentType===currentPaymentMethodType&&paymentType){const card=getCardDetails({customerPayment:{payment_source:paymentSource},paymentType});currentCustomerPaymentSourceId!=null&&paymentSource?.id===currentCustomerPaymentSourceId&&card.brand===""&&(card.brand="credit-card"),(isFree&&isPermitted||currentPaymentMethodRef?.current?.onsubmit||card.brand)&&isPermitted&&setNotPermitted(!1)}else setNotPermitted(!(isFree&&isPermitted));return()=>{setNotPermitted(!0)}},[isPermitted,paymentType,currentPaymentMethodRef?.current?.onsubmit,loading,currentPaymentMethodType,order,paymentSource]),useEffect(()=>{paymentType==="paypal_payments"&&options?.paypalPayerId&&order?.status&&["draft","pending"].includes(order?.status)&&autoPlaceOrder&&handleClick()},[options?.paypalPayerId,paymentType]),useEffect(()=>{if(paymentType==="stripe_payments"&&options?.stripe?.paymentIntentClientSecret&&order?.payment_source?.publishable_key&&order?.status&&["draft","pending"].includes(order?.status)&&autoPlaceOrder){const publicApiKey=order?.payment_source?.publishable_key,paymentIntentClientSecret=options?.stripe?.paymentIntentClientSecret,getPaymentIntent=async()=>{const paymentIntentResult=await checkPaymentIntent({publicApiKey,paymentIntentClientSecret});switch(paymentIntentResult.status){case"valid":handleClick();break;case"processing":setTimeout(()=>{getPaymentIntent()},1e3);break;case"invalid":setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:paymentIntentResult.message}]);break}};getPaymentIntent()}},[options?.stripe?.paymentIntentClientSecret!=null,paymentType!=null,order?.payment_source!=null]),useEffect(()=>{if(order?.status!=null&&["draft","pending"].includes(order?.status)){const resultCode=order?.payment_source?.payment_response?.resultCode==="Authorised",paymentDetails=order?.payment_source?.payment_request_details?.details!=null;if(paymentType==="adyen_payments"&&options?.adyen?.redirectResult&&!paymentDetails){const attributes={payment_request_details:{details:{redirectResult:options?.adyen?.redirectResult}},_details:1};setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes}).then(res=>{const resultCode2=res?.payment_response?.resultCode,errorCode=res?.payment_response?.errorCode,message=res?.payment_response?.message;["Authorised","Pending","Received"].includes(resultCode2)&&autoPlaceOrder?handleClick():errorCode!=null&&setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message}])})}else(paymentType==="adyen_payments"&&options?.adyen?.MD&&options?.adyen?.PaRes&&autoPlaceOrder||paymentType==="adyen_payments"&&resultCode&&ref?.current?.disabled===!1&&currentCustomerPaymentSourceId==null&&autoPlaceOrder&&order?.payment_source?.payment_response?.merchantReference?.includes(order?.number))&&handleClick()}},[options?.adyen,paymentType,order?.payment_source?.payment_response?.resultCode]),useEffect(()=>{paymentType==="checkout_com_payments"&&options?.checkoutCom?.session_id&&order?.status&&["draft","pending"].includes(order?.status)&&autoPlaceOrder&&handleClick()},[options?.checkoutCom,paymentType]),useEffect(()=>{ref?.current!=null&&setButtonRef!=null&&setButtonRef(ref)},[ref]);const handleClick=async e=>{e?.preventDefault(),e?.stopPropagation(),setIsLoading(!0);let isValid=!0;setForceDisable(!0);const checkPaymentSource=paymentType!=="stripe_payments"?await setPaymentSource({paymentResource:paymentType,paymentSourceId:paymentSource?.id}):paymentSource,card=paymentType&&getCardDetails({paymentType,customerPayment:{payment_source:checkPaymentSource}});currentPaymentMethodRef?.current?.onsubmit&&[!options?.paypalPayerId,!options?.adyen?.MD,!options?.checkoutCom?.session_id].every(Boolean)?(isValid=await currentPaymentMethodRef.current?.onsubmit({paymentSource:checkPaymentSource,setPlaceOrder,onclickCallback:onClick}),!isValid&&checkPaymentSource?.payment_response?.resultCode==="Authorised"&&(isValid=!0)):card?.brand&&(isValid=!0),isValid&&setPlaceOrderStatus!=null&&setPlaceOrderStatus({status:"placing"});const placed=isValid&&setPlaceOrder&&(checkPaymentSource||isFree)&&await setPlaceOrder({paymentSource:checkPaymentSource,currentCustomerPaymentSourceId});setForceDisable(!1),onClick&&placed&&onClick(placed),setIsLoading(!1),setPlaceOrderStatus?.({status:"standby"})},disabledButton=disabled!==void 0?disabled:notPermitted,labelButton=isLoading?loadingLabel:isFunction(label)?label():label,parentProps={...p,label,disabled:disabledButton,handleClick,parentRef:ref,isLoading};return children?_jsx(Parent,{...parentProps,children}):_jsx("button",{ref,type:"button",disabled:disabledButton||forceDisable,onClick:e=>{handleClick(e)},...p,children:labelButton})}export default PlaceOrderButton;
2
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useEffect,useRef,useState}from"react";import Parent from"../utils/Parent";import PlaceOrderContext from"../../context/PlaceOrderContext";import isFunction from"lodash/isFunction";import PaymentMethodContext from"../../context/PaymentMethodContext";import OrderContext from"../../context/OrderContext";import getCardDetails from"../../utils/getCardDetails";import{checkPaymentIntent}from"../../utils/stripe/retrievePaymentIntent";export function PlaceOrderButton(props){const ref=useRef(null),{children,label="Place order",loadingLabel="Placing...",autoPlaceOrder=!0,disabled,onClick,...p}=props,{isPermitted,setPlaceOrder,options,paymentType,setButtonRef,setPlaceOrderStatus,status}=useContext(PlaceOrderContext),[notPermitted,setNotPermitted]=useState(!0),[forceDisable,setForceDisable]=useState(disabled),[isLoading,setIsLoading]=useState(!1),{currentPaymentMethodRef,loading,currentPaymentMethodType,paymentSource,setPaymentSource,setPaymentMethodErrors,currentCustomerPaymentSourceId}=useContext(PaymentMethodContext),{order}=useContext(OrderContext),isFree=order?.total_amount_with_taxes_cents===0;useEffect(()=>{if(loading)setNotPermitted(loading);else if(paymentType===currentPaymentMethodType&&paymentType){const card=getCardDetails({customerPayment:{payment_source:paymentSource},paymentType});currentCustomerPaymentSourceId!=null&&paymentSource?.id===currentCustomerPaymentSourceId&&card.brand===""&&(card.brand="credit-card"),(isFree&&isPermitted||currentPaymentMethodRef?.current?.onsubmit||card.brand)&&isPermitted&&setNotPermitted(!1)}else setNotPermitted(!(isFree&&isPermitted));return()=>{setNotPermitted(!0)}},[isPermitted,paymentType,currentPaymentMethodRef?.current?.onsubmit,loading,currentPaymentMethodType,order,paymentSource]),useEffect(()=>{paymentType==="paypal_payments"&&options?.paypalPayerId&&order?.status&&["draft","pending"].includes(order?.status)&&autoPlaceOrder&&handleClick()},[options?.paypalPayerId,paymentType]),useEffect(()=>{if(paymentType==="stripe_payments"&&options?.stripe?.paymentIntentClientSecret&&order?.payment_source?.publishable_key&&order?.status&&["draft","pending"].includes(order?.status)&&autoPlaceOrder){const publicApiKey=order?.payment_source?.publishable_key,paymentIntentClientSecret=options?.stripe?.paymentIntentClientSecret,getPaymentIntent=async()=>{const paymentIntentResult=await checkPaymentIntent({publicApiKey,paymentIntentClientSecret});switch(paymentIntentResult.status){case"valid":handleClick();break;case"processing":setTimeout(()=>{getPaymentIntent()},1e3);break;case"invalid":setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:paymentIntentResult.message}]);break}};getPaymentIntent()}},[options?.stripe?.paymentIntentClientSecret!=null,paymentType!=null,order?.payment_source!=null]),useEffect(()=>{if(order?.status!=null&&["draft","pending"].includes(order?.status)){const resultCode=order?.payment_source?.payment_response?.resultCode==="Authorised",paymentDetails=order?.payment_source?.payment_request_details?.details!=null;if(paymentType==="adyen_payments"&&options?.adyen?.redirectResult&&!paymentDetails){const attributes={payment_request_details:{details:{redirectResult:options?.adyen?.redirectResult}},_details:1};setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes}).then(res=>{const resultCode2=res?.payment_response?.resultCode,errorCode=res?.payment_response?.errorCode,message=res?.payment_response?.message;["Authorised","Pending","Received"].includes(resultCode2)&&autoPlaceOrder?handleClick():errorCode!=null&&setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message}])})}else(paymentType==="adyen_payments"&&options?.adyen?.MD&&options?.adyen?.PaRes&&autoPlaceOrder||paymentType==="adyen_payments"&&resultCode&&ref?.current?.disabled===!1&&currentCustomerPaymentSourceId==null&&autoPlaceOrder&&status==="standby"&&order?.payment_source?.payment_response?.merchantReference?.includes(order?.number))&&handleClick()}},[options?.adyen,paymentType,order?.payment_source?.payment_response?.resultCode]),useEffect(()=>{paymentType==="checkout_com_payments"&&options?.checkoutCom?.session_id&&order?.status&&["draft","pending"].includes(order?.status)&&autoPlaceOrder&&handleClick()},[options?.checkoutCom,paymentType]),useEffect(()=>{ref?.current!=null&&setButtonRef!=null&&setButtonRef(ref)},[ref]);const handleClick=async e=>{e?.preventDefault(),e?.stopPropagation(),setIsLoading(!0);let isValid=!0;setForceDisable(!0);const checkPaymentSource=paymentType!=="stripe_payments"?await setPaymentSource({paymentResource:paymentType,paymentSourceId:paymentSource?.id}):paymentSource,card=paymentType&&getCardDetails({paymentType,customerPayment:{payment_source:checkPaymentSource}});currentPaymentMethodRef?.current?.onsubmit&&[!options?.paypalPayerId,!options?.adyen?.MD,!options?.checkoutCom?.session_id].every(Boolean)?(isValid=await currentPaymentMethodRef.current?.onsubmit({paymentSource:checkPaymentSource,setPlaceOrder,onclickCallback:onClick}),!isValid&&checkPaymentSource?.payment_response?.resultCode==="Authorised"&&(isValid=!0)):card?.brand&&(isValid=!0),isValid&&setPlaceOrderStatus!=null&&setPlaceOrderStatus({status:"placing"});const placed=isValid&&setPlaceOrder&&(checkPaymentSource||isFree)&&await setPlaceOrder({paymentSource:checkPaymentSource,currentCustomerPaymentSourceId});placed&&setPlaceOrderStatus!=null?placed.placed?(setPlaceOrderStatus({status:"placing"}),onClick&&placed&&onClick(placed)):(setForceDisable(!1),onClick&&placed&&onClick(placed),setIsLoading(!1),setPlaceOrderStatus({status:"standby"})):(setForceDisable(!1),setIsLoading(!1))},disabledButton=disabled!==void 0?disabled:notPermitted,labelButton=isLoading?loadingLabel:isFunction(label)?label():label,parentProps={...p,label,disabled:disabledButton,handleClick,parentRef:ref,isLoading};return children?_jsx(Parent,{...parentProps,children}):_jsx("button",{ref,type:"button",disabled:disabledButton||forceDisable,onClick:e=>{handleClick(e)},...p,children:labelButton})}export default PlaceOrderButton;
@@ -1,4 +1,4 @@
1
- import { type BaseAmountComponent } from '../../typings/index';
1
+ import type { BaseAmountComponent } from '../../typings/index';
2
2
  import type { JSX } from "react";
3
3
  export declare function ShippingAmount(props: BaseAmountComponent): JSX.Element;
4
4
  export default ShippingAmount;
@@ -1,4 +1,4 @@
1
- import { type BaseAmountComponent } from '../../typings/index';
1
+ import type { BaseAmountComponent } from '../../typings/index';
2
2
  import type { JSX } from "react";
3
3
  export declare function SubTotalAmount(props: BaseAmountComponent): JSX.Element;
4
4
  export default SubTotalAmount;
@@ -1,4 +1,4 @@
1
- import { type BaseAmountComponent } from '../../typings/index';
1
+ import type { BaseAmountComponent } from '../../typings/index';
2
2
  import type { JSX } from "react";
3
3
  export declare function TaxesAmount(props: BaseAmountComponent): JSX.Element;
4
4
  export default TaxesAmount;
@@ -1,4 +1,4 @@
1
- import { type BaseAmountComponent } from '../../typings/index';
1
+ import type { BaseAmountComponent } from '../../typings/index';
2
2
  import type { JSX } from "react";
3
3
  export declare function TotalAmount(props: BaseAmountComponent): JSX.Element;
4
4
  export default TotalAmount;
@@ -1,4 +1,4 @@
1
- import { type ConditionalElement } from '../../typings/index';
1
+ import type { ConditionalElement } from '../../typings/index';
2
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
3
3
  import type { JSX } from "react";
4
4
  type ParcelFieldChildrenProps = TGenericChildrenProps<TResources['Parcel']>;
@@ -1,4 +1,4 @@
1
- import { type ConditionalElement } from '../../typings/index';
1
+ import type { ConditionalElement } from '../../typings/index';
2
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
3
3
  import type { JSX } from "react";
4
4
  type ParcelLineItemFieldChildrenProps = TGenericChildrenProps<TResources['ParcelLineItem']>;
@@ -1,4 +1,4 @@
1
- import { type ChildrenFunction } from '../../typings/index';
1
+ import type { ChildrenFunction } from '../../typings/index';
2
2
  import type { Parcel } from '@commercelayer/sdk';
3
3
  import type { JSX } from "react";
4
4
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,4 @@
1
- import { type ChildrenFunction } from '../../typings/index';
1
+ import type { ChildrenFunction } from '../../typings/index';
2
2
  import type { Parcel } from '@commercelayer/sdk';
3
3
  import type { JSX } from "react";
4
4
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,4 +1,4 @@
1
- import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
1
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
2
2
  import { type JSX } from 'react';
3
3
  type Props = GatewayBaseType;
4
4
  export declare function AdyenGateway(props: Props): JSX.Element | null;
@@ -1,2 +1,2 @@
1
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";import{canPlaceOrder}from"../../utils/canPlaceOrder";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&&order!=null&&!canPlaceOrder(order))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;
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;
@@ -1,4 +1,4 @@
1
- import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
1
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
2
2
  import { type JSX } from 'react';
3
3
  type Props = GatewayBaseType;
4
4
  export declare function BraintreeGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
1
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
2
2
  import { type JSX } from 'react';
3
3
  type Props = GatewayBaseType;
4
4
  export declare function CheckoutComGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
1
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
2
2
  import { type JSX } from 'react';
3
3
  type Props = GatewayBaseType;
4
4
  export declare function ExternalGateway(props: Props): JSX.Element | null;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
2
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
3
  type Props = GatewayBaseType;
4
4
  export declare function KlarnaGateway(props: Props): JSX.Element | null;
5
5
  export default KlarnaGateway;
@@ -1,6 +1,6 @@
1
- import { type LoaderType } from '../../typings/index';
1
+ import type { LoaderType } from '../../typings/index';
2
2
  import { type JSX } from 'react';
3
- import { type PaymentSourceProps } from '../payment_source/PaymentSource';
3
+ import type { PaymentSourceProps } from '../payment_source/PaymentSource';
4
4
  export type GatewayBaseType = Props & {
5
5
  show: boolean;
6
6
  loading: boolean;
@@ -1,4 +1,4 @@
1
- import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
1
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
2
2
  import { type JSX } from 'react';
3
3
  type Props = Partial<GatewayBaseType>;
4
4
  export declare function PaypalGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
1
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
2
2
  import { type JSX } from 'react';
3
3
  type Props = GatewayBaseType;
4
4
  export declare function StripeGateway(props: Props): JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import { type GatewayBaseType } from '../payment_gateways/PaymentGateway';
1
+ import type { GatewayBaseType } from '../payment_gateways/PaymentGateway';
2
2
  import { type JSX } from 'react';
3
3
  type Props = GatewayBaseType;
4
4
  export declare function WireTransferGateway(props: Props): JSX.Element | null;
@@ -30,6 +30,10 @@ type Props = {
30
30
  * Enable express payment. Other payment methods will be disabled.
31
31
  */
32
32
  expressPayments?: boolean;
33
+ /**
34
+ * Sort payment methods by an array of strings
35
+ */
36
+ sortBy?: Array<PaymentMethodType['payment_source_type']>;
33
37
  } & Omit<JSX.IntrinsicElements['div'], 'onClick' | 'children'> & ({
34
38
  clickableContainer: true;
35
39
  onClick?: (params: PaymentMethodOnClickParams) => void;
@@ -37,5 +41,5 @@ type Props = {
37
41
  clickableContainer?: never;
38
42
  onClick?: never;
39
43
  });
40
- export declare function PaymentMethod({ children, className, activeClass, loader, clickableContainer, autoSelectSinglePaymentMethod, expressPayments, hide, onClick, ...p }: Props): JSX.Element;
44
+ export declare function PaymentMethod({ children, className, activeClass, loader, clickableContainer, autoSelectSinglePaymentMethod, expressPayments, hide, onClick, sortBy, ...p }: Props): JSX.Element;
41
45
  export default PaymentMethod;
@@ -1,2 +1,2 @@
1
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";let loadingResource=!1;export function PaymentMethod({children,className,activeClass,loader="Loading...",clickableContainer,autoSelectSinglePaymentMethod,expressPayments,hide,onClick,...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)})())},[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?.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;
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;
@@ -1,4 +1,4 @@
1
- import { type ChildrenFunction } from '../../typings/index';
1
+ import type { ChildrenFunction } from '../../typings/index';
2
2
  import type { JSX } from "react";
3
3
  interface ChildrenProps extends Omit<Props, 'children'> {
4
4
  labelName: string;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type BaseAmountComponent } from '../../typings/index';
2
+ import type { BaseAmountComponent } from '../../typings/index';
3
3
  interface Props extends BaseAmountComponent {
4
4
  type?: 'amount';
5
5
  labelFree?: string;
@@ -1,6 +1,6 @@
1
1
  import { type ChangeEvent, type JSX } from 'react';
2
2
  import type { Order, PaymentMethod } from '@commercelayer/sdk';
3
- import { type ChildrenFunction } from '../../typings/index';
3
+ import type { ChildrenFunction } from '../../typings/index';
4
4
  interface ChildrenProps extends Omit<Props, 'children'> {
5
5
  checked: boolean;
6
6
  handleOnChange: (event: ChangeEvent<HTMLInputElement>) => Promise<void>;
@@ -1,41 +1,9 @@
1
- import { type CSSProperties, type JSX } from 'react';
2
- import { type PaymentSourceProps } from './PaymentSource';
3
- import type { CoreOptions } from '@adyen/adyen-web/dist/types/core/types';
4
- type Styles = Partial<{
5
- base: CSSProperties;
6
- error: CSSProperties;
7
- placeholder: CSSProperties;
8
- validated: CSSProperties;
9
- }>;
10
- type PaypalStyle = Partial<{
11
- /**
12
- * @see {@link https://developer.paypal.com/docs/checkout/integration-features/customize-button/#color}
13
- */
14
- color: 'gold' | 'blue' | 'silver' | 'white' | 'black';
15
- /**
16
- * @see {@link https://developer.paypal.com/docs/checkout/integration-features/customize-button/#shape}
17
- */
18
- shape: 'rect' | 'pill';
19
- /**
20
- * @see {@link https://developer.paypal.com/docs/checkout/integration-features/customize-button/#height}
21
- */
22
- height: string | number;
23
- /**
24
- * @see {@link https://developer.paypal.com/docs/checkout/integration-features/customize-button/#label}
25
- */
26
- label: 'paypal' | 'checkout' | 'buynow' | 'pay';
27
- /**
28
- * @see {@link https://developer.paypal.com/docs/checkout/integration-features/customize-button/#tagline}
29
- */
30
- tagline: boolean;
31
- /**
32
- * @see {@link https://developer.paypal.com/docs/checkout/integration-features/customize-button/#layout}
33
- */
34
- layout: 'vertical' | 'horizontal';
35
- }>;
1
+ import { type JSX } from "react";
2
+ import type { PaymentSourceProps } from "./PaymentSource";
3
+ import { type CardConfiguration, type CoreConfiguration, type DropinConfiguration, type PayPalConfiguration } from "@adyen/adyen-web/auto";
36
4
  interface PaymentMethodsStyle {
37
- card?: Styles;
38
- paypal?: PaypalStyle;
5
+ card?: CardConfiguration["styles"];
6
+ paypal?: PayPalConfiguration["style"];
39
7
  }
40
8
  /**
41
9
  * Configuration options for the Adyen payment component.
@@ -47,6 +15,7 @@ export interface AdyenPaymentConfig {
47
15
  cardContainerClassName?: string;
48
16
  /**
49
17
  * Optional CSS class name for the 3D Secure container.
18
+ * @deprecated
50
19
  */
51
20
  threeDSecureContainerClassName?: string;
52
21
  /**
@@ -63,7 +32,7 @@ export interface AdyenPaymentConfig {
63
32
  /**
64
33
  * Configuration options for the payment methods.
65
34
  */
66
- paymentMethodsConfiguration?: CoreOptions['paymentMethodsConfiguration'];
35
+ paymentMethodsConfiguration?: DropinConfiguration["paymentMethodsConfiguration"];
67
36
  /**
68
37
  * Callback function to disable a stored payment method.
69
38
  * @param props - An object containing the recurring detail reference and shopper reference.
@@ -77,9 +46,9 @@ export interface AdyenPaymentConfig {
77
46
  interface Props {
78
47
  clientKey?: string;
79
48
  config?: AdyenPaymentConfig;
80
- templateCustomerSaveToWallet?: PaymentSourceProps['templateCustomerSaveToWallet'];
81
- locale?: string;
82
- environment?: string;
49
+ templateCustomerSaveToWallet?: PaymentSourceProps["templateCustomerSaveToWallet"];
50
+ locale?: CoreConfiguration["locale"];
51
+ environment?: CoreConfiguration["environment"];
83
52
  }
84
- export declare function AdyenPayment({ clientKey, config, templateCustomerSaveToWallet, environment, locale }: Props): JSX.Element | null;
53
+ export declare function AdyenPayment({ clientKey, config, templateCustomerSaveToWallet, environment, locale, }: Props): JSX.Element | null;
85
54
  export default AdyenPayment;
@@ -1,2 +1,2 @@
1
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 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,threeDSecureContainerClassName,styles,onDisableStoredPaymentMethod}={...defaultConfig,...config},[loadAdyen,setLoadAdyen]=useState(!1),[checkout,setCheckout]=useState(),{setPaymentSource,paymentSource,setPaymentMethodErrors,currentPaymentMethodType,setPaymentRef,currentCustomerPaymentSourceId}=useContext(PaymentMethodContext),{order}=useContext(OrderContext),{placeOrderButtonRef,setPlaceOrder}=useContext(PlaceOrderContext),{customers}=useContext(CustomerContext),ref=useRef(null),handleSubmit=async(e,component)=>{const savePaymentSourceToCustomerWallet=e?.elements?.save_payment_source_to_customer_wallet?.checked;return savePaymentSourceToCustomerWallet&&setCustomerOrderParam("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),component?.submit&&component.submit(),!1},handleChange=async(state,component)=>{state.isValid&&ref.current&&(ref.current.onsubmit=async()=>await handleSubmit(ref.current,component),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}),adyenAction=pSource?.payment_response?.action,resultCode=pSource?.payment_response?.resultCode;if(adyenAction&&component)return component.handleAction(adyenAction),!1;if(["Authorised","Pending","Received"].includes(resultCode))return placeOrderButtonRef?.current!=null&&(placeOrderButtonRef.current.disabled&&(placeOrderButtonRef.current.disabled=!1),placeOrderButtonRef.current.click()),!0;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!1}catch(error){return console.error("Adyen additional details error:",error),!1}},onSubmit=async(state,component)=>{const url=cleanUrlBy(),shopperIp=await getPublicIP();if((await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments"}))?.payment_response?.resultCode==="Authorised")return!0;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"),!1;const res=await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments",attributes:{_authorize:1}}),action=res?.payment_response?.action;if(component&&action)return component.handleAction(action),!1;const resultCode=res?.payment_response?.resultCode,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}),!0):(placeOrderButtonRef?.current!=null&&(placeOrderButtonRef.current.disabled&&(placeOrderButtonRef.current.disabled=!1),placeOrderButtonRef.current.click()),!0);if(["Cancelled","Refused"].includes(resultCode)){const message=res?.payment_response?.refusalReason;setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,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:currentPaymentMethodType,message}])}return!1}catch(error){return setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:error.message}]),!1}};return useEffect(()=>{const paymentMethodsResponse={paymentMethods:paymentSource?.payment_methods?.paymentMethods?paymentSource?.payment_methods.paymentMethods:[],storedPaymentMethods:paymentSource?.payment_methods?.storedPaymentMethods?paymentSource?.payment_methods.storedPaymentMethods:[]},[firstPaymentMethod]=paymentMethodsResponse.paymentMethods,isOnlyCard=paymentMethodsResponse.paymentMethods?.length===1&&firstPaymentMethod.type==="scheme";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,paymentMethodsConfiguration:{showStoredPaymentMethods,paypal:{showPayButton:!0,style:styles?.paypal,...config?.paymentMethodsConfiguration?.paypal},card:{enableStoreDetails:showStoredPaymentMethods,styles:styles?.card,holderNameRequired:!1,...config?.paymentMethodsConfiguration?.card},...config?.paymentMethodsConfiguration},onAdditionalDetails:(state,element)=>{handleOnAdditionalDetails(state,element)},onChange:(state,element)=>{handleChange(state,element)},onSubmit:(state,element)=>{onSubmit(state,element)}};return!ref&&clientKey&&setCustomerOrderParam("_save_payment_source_to_customer_wallet","false"),clientKey&&!loadAdyen&&window&&!checkout&&import("@adyen/adyen-web").then(({default:AdyenCheckout})=>{const type=isOnlyCard?"card":"dropin";AdyenCheckout(options).then(adyenCheckout=>{const component=adyenCheckout.create(type,{showRemovePaymentMethodButton:showStoredPaymentMethods,instantPaymentTypes:["applepay","googlepay"],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")})},onSelect:component2=>{const id=component2._id;id.search("scheme")===-1&&ref.current&&(id.search("paypal")===-1?ref.current.onsubmit=async()=>await handleSubmit(ref.current,component2):ref.current.onsubmit=null,setPaymentRef({ref}))}}).mount("#adyen-dropin");component&&(setCheckout(component),setLoadAdyen(!0))})}),()=>{setPaymentRef({ref:{current:null}}),setLoadAdyen(!1)}},[clientKey,ref!=null]),!clientKey&&!loadAdyen&&!checkout?null:_jsxs("form",{ref,onSubmit:e=>{handleSubmit(e,checkout)},children:[_jsx("div",{className:cardContainerClassName,id:"adyen-dropin"}),templateCustomerSaveToWallet&&_jsx(Parent,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet}),_jsx("div",{className:threeDSecureContainerClassName,id:"adyen-action"})]})}export default AdyenPayment;
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}={...defaultConfig,...config},[loadAdyen,setLoadAdyen]=useState(!1),[checkout,setCheckout]=useState(),{setPaymentSource,paymentSource,setPaymentMethodErrors,currentPaymentMethodType,setPaymentRef,currentCustomerPaymentSourceId}=useContext(PaymentMethodContext),{order}=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(),shopperIp=await getPublicIP(),controlCode=(await setPaymentSource({paymentSourceId:paymentSource?.id,paymentResource:"adyen_payments"}))?.payment_response?.resultCode;if(controlCode==="Authorised")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"};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:currentPaymentMethodType,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:currentPaymentMethodType,message}])}return{resultCode}}catch(error){return setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:error.message}]),{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}=await onSubmit(state,element);["Cancelled","Refused"].includes(resultCode)?actions.reject():action!=null?dropinRef.current?.handleAction(action):actions.resolve({resultCode})})()}};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},...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}))}}).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"}),templateCustomerSaveToWallet&&_jsx(Parent,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})]})}export default AdyenPayment;
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
- import { type PaymentSourceProps } from './PaymentSource';
3
- import { type HostedFieldFieldOptions } from 'braintree-web';
2
+ import type { PaymentSourceProps } from './PaymentSource';
3
+ import type { HostedFieldFieldOptions } from 'braintree-web';
4
4
  type BraintreeHostedFields<Type> = {
5
5
  [Property in keyof Type]: {
6
6
  label?: string;
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
- import { type PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
3
- import { type PaymentSourceProps } from './PaymentSource';
2
+ import type { PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
3
+ import type { PaymentSourceProps } from './PaymentSource';
4
4
  import { type FramesStyle } from 'frames-react';
5
5
  export interface CheckoutComConfig {
6
6
  containerClassName?: string;
@@ -1,7 +1,7 @@
1
- import { type ChildrenFunction } from '../../typings/index';
1
+ import type { ChildrenFunction } from '../../typings/index';
2
2
  import type { StripeElementLocale } from '@stripe/stripe-js';
3
3
  import { type JSX } from 'react';
4
- import { type PaymentSourceProps } from './PaymentSource';
4
+ import type { PaymentSourceProps } from './PaymentSource';
5
5
  export interface ExternalPaymentConfig {
6
6
  /**
7
7
  * Show the component. Default is false
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
- import { type PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
3
- import { type PaymentSourceProps } from './PaymentSource';
2
+ import type { PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
3
+ import type { PaymentSourceProps } from './PaymentSource';
4
4
  type KlarnaPaymentProps = PaymentMethodConfig['klarnaPayment'] & JSX.IntrinsicElements['div'] & Partial<PaymentSourceProps['templateCustomerSaveToWallet']> & {
5
5
  show?: boolean;
6
6
  clientToken: string;
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
- import { type LoaderType } from '../../typings/index';
3
- import { type CustomerCardsTemplateChildren } from '../utils/PaymentCardsTemplate';
2
+ import type { LoaderType } from '../../typings/index';
3
+ import type { CustomerCardsTemplateChildren } from '../utils/PaymentCardsTemplate';
4
4
  export interface CustomerCardsProps {
5
5
  handleClick: () => void;
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import { type IconBrand } from '../../context/PaymentSourceContext';
2
2
  import { type JSX } from 'react';
3
- import { type ChildrenFunction } from '../../typings/index';
3
+ import type { ChildrenFunction } from '../../typings/index';
4
4
  interface ChildrenProps extends Omit<Props, 'children'> {
5
5
  brand: IconBrand;
6
6
  defaultSrc: string;
@@ -1,6 +1,6 @@
1
1
  import { type IconBrand } from '../../context/PaymentSourceContext';
2
2
  import { type JSX } from 'react';
3
- import { type ChildrenFunction } from '../../typings/index';
3
+ import type { ChildrenFunction } from '../../typings/index';
4
4
  interface CustomComponent extends Omit<Props, 'children'> {
5
5
  brand: IconBrand;
6
6
  }
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode, type JSX } from 'react';
2
- import { type ChildrenFunction } from '../../typings/index';
2
+ import type { ChildrenFunction } from '../../typings/index';
3
3
  interface CustomComponent extends Omit<Props, 'children'> {
4
4
  }
5
5
  type Props = {
@@ -1,7 +1,7 @@
1
1
  import { type JSX } from 'react';
2
- import { type StripeElementLocale, type StripeElementsOptions, type StripePaymentElementOptions } from '@stripe/stripe-js';
3
- import { type PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
4
- import { type PaymentSourceProps } from './PaymentSource';
2
+ import type { StripeElementLocale, StripeElementsOptions, StripePaymentElementOptions } from '@stripe/stripe-js';
3
+ import type { PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
4
+ import type { PaymentSourceProps } from './PaymentSource';
5
5
  export interface StripeConfig {
6
6
  containerClassName?: string;
7
7
  hintLabel?: string;
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
- import { type Price as PriceType } from '@commercelayer/sdk';
3
- import { type ChildrenFunction, type LoaderType } from '../../typings/index';
2
+ import type { Price as PriceType } from '@commercelayer/sdk';
3
+ import type { ChildrenFunction, LoaderType } from '../../typings/index';
4
4
  interface PriceChildrenProps extends Omit<PriceProps, 'children'> {
5
5
  loading: boolean;
6
6
  loader: LoaderType;
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
- import { type LoaderType } from '../../typings/index';
3
- import { type QueryPageSize } from '@commercelayer/sdk';
2
+ import type { LoaderType } from '../../typings/index';
3
+ import type { QueryPageSize } from '@commercelayer/sdk';
4
4
  interface Props {
5
5
  /**
6
6
  * Any valid JSX.Element(s).
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type Shipment } from '@commercelayer/sdk';
2
+ import type { Shipment } from '@commercelayer/sdk';
3
3
  type ShipmentFieldChildrenProps = Omit<Props, 'children'> & {
4
4
  shipment: Shipment;
5
5
  };
@@ -1,4 +1,4 @@
1
- import { type ChildrenFunction } from '../../typings/index';
1
+ import type { ChildrenFunction } from '../../typings/index';
2
2
  import type { Shipment } from '@commercelayer/sdk';
3
3
  import type { JSX } from "react";
4
4
  interface ChildrenProps extends Omit<Props, 'children'> {
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type ShippingMethod } from '@commercelayer/sdk';
2
+ import type { ShippingMethod } from '@commercelayer/sdk';
3
3
  type ChildrenProps = Omit<Props, 'children'> & {
4
4
  label: string;
5
5
  shippingMethod: ShippingMethod;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from 'react';
2
- import { type BaseAmountComponent } from '../../typings/index';
2
+ import type { BaseAmountComponent } from '../../typings/index';
3
3
  type Props = BaseAmountComponent & {
4
4
  /**
5
5
  * The label to show when the price is free
@@ -1,5 +1,5 @@
1
- import { type TimeFormat, type ChildrenFunction } from '../../typings/index';
2
- import { type DeliveryLeadTime } from '../../reducers/AvailabilityReducer';
1
+ import type { TimeFormat, ChildrenFunction } from '../../typings/index';
2
+ import type { DeliveryLeadTime } from '../../reducers/AvailabilityReducer';
3
3
  import type { JSX } from "react";
4
4
  interface AvailabilityTemplateChildrenProps extends Omit<Props, 'children'>, DeliveryLeadTime {
5
5
  text: string;
@@ -1,4 +1,4 @@
1
- import { type ConditionalElement } from '../../typings/index';
1
+ import type { ConditionalElement } from '../../typings/index';
2
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
3
3
  import type { JSX } from "react";
4
4
  type SkuFieldChildrenProps = TGenericChildrenProps<TResources['Sku']>;
@@ -1,4 +1,4 @@
1
- import { type ConditionalElement } from '../../typings/index';
1
+ import type { ConditionalElement } from '../../typings/index';
2
2
  import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
3
3
  import type { JSX } from "react";
4
4
  type StockTransferFieldChildrenProps = TGenericChildrenProps<TResources['StockTransfer']>;
@@ -1,7 +1,7 @@
1
1
  import { type JSX } from 'react';
2
2
  import type { Address } from '@commercelayer/sdk';
3
3
  import AddressChildrenContext from '../../context/AddressChildrenContext';
4
- import { type ChildrenFunction } from '../../typings/index';
4
+ import type { ChildrenFunction } from '../../typings/index';
5
5
  export interface TAddressCards extends Pick<Props, 'customerAddresses' | 'className'> {
6
6
  AddressProvider: typeof AddressChildrenContext.Provider;
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import React, { type JSX } from 'react';
2
- import { type BaseInputComponentProps } from '../../typings/index';
2
+ import type { BaseInputComponentProps } from '../../typings/index';
3
3
  export type BaseInputProps = BaseInputComponentProps & Omit<JSX.IntrinsicElements['input'], 'children' | 'pattern'> & Omit<JSX.IntrinsicElements['textarea'], 'children' | 'pattern'>;
4
4
  declare const _default: React.ForwardRefExoticComponent<Omit<BaseInputProps, "ref"> & React.RefAttributes<any>>;
5
5
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { type JSX } from 'react';
2
- import { type PropsType } from '../../utils/PropsType';
3
- import { type baseOrderPricePropTypes } from '../../typings/index';
2
+ import type { PropsType } from '../../utils/PropsType';
3
+ import type { baseOrderPricePropTypes } from '../../typings/index';
4
4
  export type BaseOrderPriceProps = PropsType<typeof baseOrderPricePropTypes, unknown> & Omit<JSX.IntrinsicElements['span'], 'children' | 'ref'>;
5
5
  export declare function BaseOrderPrice(props: BaseOrderPriceProps): JSX.Element;
6
6
  export default BaseOrderPrice;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type BaseSelectComponentProps } from '../../typings/index';
2
+ import type { BaseSelectComponentProps } from '../../typings/index';
3
3
  export type BaseSelectProps = BaseSelectComponentProps;
4
4
  declare const _default: React.ForwardRefExoticComponent<BaseSelectComponentProps & React.RefAttributes<any>>;
5
5
  export default _default;