@commercelayer/react-components 4.21.0-beta.2 → 4.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +154 -19
  1008. package/dist/index.cjs +0 -3
  1009. package/dist/index.cjs.map +0 -1
  1010. package/dist/index.d.cts +0 -3271
  1011. package/dist/index.d.ts +0 -3271
  1012. package/dist/index.js +0 -3
  1013. package/dist/index.js.map +0 -1
@@ -0,0 +1,10 @@
1
+ import { type JSX } from "react";
2
+ import type { PaymentMethodConfig } from "../../reducers/PaymentMethodReducer";
3
+ import type { PaymentSourceProps } from "./PaymentSource";
4
+ type KlarnaPaymentProps = PaymentMethodConfig["klarnaPayment"] & JSX.IntrinsicElements["div"] & Partial<PaymentSourceProps["templateCustomerSaveToWallet"]> & {
5
+ show?: boolean;
6
+ clientToken: string;
7
+ locale?: string | null;
8
+ };
9
+ export default function KlarnaPayment({ clientToken, placeOrderCallback, locale, ...p }: KlarnaPaymentProps): JSX.Element | null;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=KlarnaPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),useExternalScript_1=tslib_1.__importDefault(require("../../utils/hooks/useExternalScript"));function typeOfLine(lineItemType){switch(lineItemType){case"percentage_discount_promotions":return"discount";case"shipments":return"shipping_fee";case"skus":return"physical";case"payment_methods":default:return null}}function klarnaOrderLines(lineItems){return lineItems?lineItems?.map(item=>{const type=item.item_type?typeOfLine(item.item_type):null;return{quantity:item.quantity,total_amount:item.total_amount_cents,unit_price:item.unit_amount_cents,type}}):[]}function KlarnaPayment(_a){var{clientToken,placeOrderCallback,locale="EN"}=_a,p=tslib_1.__rest(_a,["clientToken","placeOrderCallback","locale"]);const ref=(0,react_1.useRef)(null),{paymentSource,currentPaymentMethodType,setPaymentRef,setPaymentSource}=(0,react_1.useContext)(PaymentMethodContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),loaded=(0,useExternalScript_1.default)("https://x.klarnacdn.net/kp/lib/v1/api.js"),[klarna,setKlarna]=(0,react_1.useState)(),{containerClassName}=p,divProps=tslib_1.__rest(p,["containerClassName"]);(0,react_1.useEffect)(()=>{loaded&&window?.Klarna!==void 0&&setKlarna(window.Klarna)},[loaded,window.Klarna]),(0,react_1.useEffect)(()=>(ref.current&&paymentSource&&currentPaymentMethodType&&loaded&&klarna&&(ref.current.onsubmit=props=>tslib_1.__awaiter(this,void 0,void 0,function*(){handleClick(klarna,props)}),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,paymentSource,currentPaymentMethodType,loaded,klarna]);const handleClick=(kl,props)=>{var _a2,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q,_r;const[first]=paymentSource?.payment_methods||void 0,paymentMethodCategories=first?.identifier,billingAddress={given_name:(_a2=order?.billing_address)===null||_a2===void 0?void 0:_a2.first_name,family_name:(_b=order?.billing_address)===null||_b===void 0?void 0:_b.last_name,email:order?.customer_email,street_address:(_c=order?.billing_address)===null||_c===void 0?void 0:_c.line_1,street_address2:null,organization_name:null,postal_code:(_d=order?.billing_address)===null||_d===void 0?void 0:_d.zip_code,city:(_e=order?.billing_address)===null||_e===void 0?void 0:_e.city,region:(_f=order?.billing_address)===null||_f===void 0?void 0:_f.state_code,phone:(_g=order?.billing_address)===null||_g===void 0?void 0:_g.phone,country:(_h=order?.billing_address)===null||_h===void 0?void 0:_h.country_code},shippingAddress={given_name:(_j=order?.shipping_address)===null||_j===void 0?void 0:_j.first_name,family_name:(_k=order?.shipping_address)===null||_k===void 0?void 0:_k.last_name,email:order?.customer_email,street_address:(_l=order?.shipping_address)===null||_l===void 0?void 0:_l.line_1,street_address2:null,postal_code:(_m=order?.shipping_address)===null||_m===void 0?void 0:_m.zip_code,organization_name:null,city:(_o=order?.shipping_address)===null||_o===void 0?void 0:_o.city,region:(_p=order?.shipping_address)===null||_p===void 0?void 0:_p.state_code,phone:(_q=order?.shipping_address)===null||_q===void 0?void 0:_q.phone,country:(_r=order?.shipping_address)===null||_r===void 0?void 0:_r.country_code},klarnaData={merchant_data:order?.id,purchase_country:order?.country_code,purchase_currency:order?.currency_code,locale,shipping_address:shippingAddress,billing_address:billingAddress,order_amount:order?.total_amount_cents,order_lines:klarnaOrderLines(order?.line_items),order_tax_amount:order?.total_tax_amount_cents};kl.Payments.authorize(Object.assign({payment_method_category:paymentMethodCategories},klarnaData),res=>tslib_1.__awaiter(this,void 0,void 0,function*(){if(res.approved&&paymentSource&&currentPaymentMethodType){const ps=yield setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{auth_token:res.authorization_token}});if(props.setPlaceOrder!=null){const placed=yield props.setPlaceOrder({paymentSource:ps});placed&&props.onclickCallback!=null&&props.onclickCallback(placed)}}}))};if(klarna&&clientToken){const[first]=paymentSource?.payment_methods||void 0;klarna.Payments.init({client_token:clientToken}),klarna.Payments.load({container:"#klarna-payments-container",payment_method_category:first?.identifier})}return(0,jsx_runtime_1.jsx)("form",{ref,children:(0,jsx_runtime_1.jsx)("div",Object.assign({className:containerClassName},divProps,{children:(0,jsx_runtime_1.jsx)("div",{id:"klarna-payments-container"})}))})}
@@ -0,0 +1,19 @@
1
+ import { type JSX } from "react";
2
+ import type { LoaderType } from "../../typings/index";
3
+ import type { CustomerCardsTemplateChildren } from "../utils/PaymentCardsTemplate";
4
+ export interface CustomerCardsProps {
5
+ handleClick: () => void;
6
+ }
7
+ export interface CustomerSaveToWalletProps {
8
+ name: "save_payment_source_to_customer_wallet";
9
+ }
10
+ export interface PaymentSourceProps extends Omit<JSX.IntrinsicElements["div"], "children"> {
11
+ children?: JSX.Element | JSX.Element[];
12
+ readonly?: boolean;
13
+ templateCustomerCards?: CustomerCardsTemplateChildren;
14
+ onClickCustomerCards?: () => void;
15
+ templateCustomerSaveToWallet?: (props: CustomerSaveToWalletProps) => JSX.Element;
16
+ loader?: LoaderType;
17
+ }
18
+ export declare function PaymentSource(props: PaymentSourceProps): JSX.Element;
19
+ export default PaymentSource;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSource=PaymentSource;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),PaymentMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodChildrenContext")),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),PaymentGateway_1=tslib_1.__importDefault(require("../payment_gateways/PaymentGateway")),getCardDetails_1=tslib_1.__importDefault(require("../../utils/getCardDetails")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext"));function PaymentSource(props){const{readonly}=props,{payment,expressPayments}=(0,react_1.useContext)(PaymentMethodChildrenContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),{payments}=(0,react_1.useContext)(CustomerContext_1.default),{currentPaymentMethodId,paymentSource,destroyPaymentSource,currentPaymentMethodType,currentCustomerPaymentSourceId}=(0,react_1.useContext)(PaymentMethodContext_1.default),[show,setShow]=(0,react_1.useState)(!1),[showCard,setShowCard]=(0,react_1.useState)(!1);(0,react_1.useEffect)(()=>{const isCustomerPaymentSource=currentCustomerPaymentSourceId!=null&&currentCustomerPaymentSourceId===paymentSource?.id;if(readonly)setShow(!0),setShowCard(!0);else if((payment?.id===currentPaymentMethodId||isCustomerPaymentSource)&&!expressPayments){const card=(0,getCardDetails_1.default)({paymentType:payment?.payment_source_type,customerPayment:{payment_source:paymentSource}});isCustomerPaymentSource&&card.brand===""&&(card.brand=card.issuer_type!=null&&card.issuer_type!==""?card.issuer_type:"credit-card"),card.brand&&setShowCard(!0),setShow(!0)}else expressPayments&&currentPaymentMethodType==="stripe_payments"&&setShow(!0);return()=>{setShow(!1),setShowCard(!1)}},[currentPaymentMethodId,paymentSource?.id,payments!=null,payment!=null,readonly,order?.status,expressPayments]);const handleEditClick=e=>tslib_1.__awaiter(this,void 0,void 0,function*(){if(e.stopPropagation(),paymentSource){const paymentSourceId=paymentSource?.id;yield destroyPaymentSource({paymentSourceId,paymentResource:payment?.payment_source_type})}setShowCard(!showCard),setShow(!0)}),gatewayProps=Object.assign(Object.assign({},props),{show,showCard,handleEditClick,readonly});return(0,jsx_runtime_1.jsx)(PaymentGateway_1.default,Object.assign({},gatewayProps))}exports.default=PaymentSource;
@@ -0,0 +1,15 @@
1
+ import { type IconBrand } from '../../context/PaymentSourceContext';
2
+ import { type JSX } from 'react';
3
+ import type { ChildrenFunction } from '../../typings/index';
4
+ interface ChildrenProps extends Omit<Props, 'children'> {
5
+ brand: IconBrand;
6
+ defaultSrc: string;
7
+ url: string;
8
+ }
9
+ interface Props extends Omit<JSX.IntrinsicElements['img'], 'children'> {
10
+ children?: ChildrenFunction<ChildrenProps>;
11
+ width?: number;
12
+ height?: number;
13
+ }
14
+ export declare function PaymentSourceBrandIcon({ src, width, children, ...p }: Props): JSX.Element;
15
+ export default PaymentSourceBrandIcon;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSourceBrandIcon=PaymentSourceBrandIcon;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentSourceContext_1=tslib_1.__importDefault(require("../../context/PaymentSourceContext")),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CustomerPaymentSourceContext_1=tslib_1.__importDefault(require("../../context/CustomerPaymentSourceContext"));function PaymentSourceBrandIcon(_a){var _b,_c,{src,width=32,children}=_a,p=tslib_1.__rest(_a,["src","width","children"]);const{brand,issuer_type:issuerType}=(0,react_1.useContext)(PaymentSourceContext_1.default),{brand:customerCardBrand,issuer_type:customerIssuerType}=(0,react_1.useContext)(CustomerPaymentSourceContext_1.default),cardBrand=(_c=(_b=brand??customerCardBrand)!==null&&_b!==void 0?_b:issuerType)!==null&&_c!==void 0?_c:customerIssuerType,ref=(0,react_1.useRef)(null),defaultSrc="//data.commercelayer.app/assets/images/icons/credit-cards/color/credit-card.svg",url=src||`//data.commercelayer.app/assets/images/icons/credit-cards/color/${cardBrand??"credit-card"}.svg`,handleError=()=>{ref.current&&(ref.current.src=defaultSrc)},parentProps=Object.assign({brand:cardBrand,defaultSrc,url,width},p);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("img",Object.assign({ref,src:url,onError:handleError,width},p))}exports.default=PaymentSourceBrandIcon;
@@ -0,0 +1,12 @@
1
+ import { type IconBrand } from '../../context/PaymentSourceContext';
2
+ import { type JSX } from 'react';
3
+ import type { ChildrenFunction } from '../../typings/index';
4
+ interface CustomComponent extends Omit<Props, 'children'> {
5
+ brand: IconBrand;
6
+ }
7
+ interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
8
+ children?: ChildrenFunction<CustomComponent>;
9
+ label?: string;
10
+ }
11
+ export declare function PaymentSourceBrandName({ children, label, ...props }: Props): JSX.Element;
12
+ export default PaymentSourceBrandName;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSourceBrandName=PaymentSourceBrandName;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentSourceContext_1=tslib_1.__importDefault(require("../../context/PaymentSourceContext")),capitalize_1=tslib_1.__importDefault(require("lodash/capitalize")),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CustomerPaymentSourceContext_1=tslib_1.__importDefault(require("../../context/CustomerPaymentSourceContext"));function PaymentSourceBrandName(_a){var{children,label}=_a,props=tslib_1.__rest(_a,["children","label"]);const{brand}=(0,react_1.useContext)(PaymentSourceContext_1.default),{brand:customerCardBrand}=(0,react_1.useContext)(CustomerPaymentSourceContext_1.default),cardBrand=brand??customerCardBrand,brandName=cardBrand&&(0,capitalize_1.default)(cardBrand.replace(/_|-/gm," ")),parentProps=Object.assign({brand:brandName,label},props);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},props,{children:label||(0,capitalize_1.default)(brandName)}))}exports.default=PaymentSourceBrandName;
@@ -0,0 +1,15 @@
1
+ import { type JSX } from 'react';
2
+ import type { ChildrenFunction } from '../../typings/index';
3
+ export type PaymentSourceDetailType = 'last4' | 'exp_year' | 'exp_month';
4
+ interface ChildrenProps extends Omit<Props, 'children'> {
5
+ text: string;
6
+ }
7
+ interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
8
+ children?: ChildrenFunction<ChildrenProps>;
9
+ /**
10
+ * Type of detail to display
11
+ */
12
+ type: PaymentSourceDetailType;
13
+ }
14
+ export declare function PaymentSourceDetail({ type, children, ...p }: Props): JSX.Element;
15
+ export default PaymentSourceDetail;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSourceDetail=PaymentSourceDetail;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentSourceContext_1=tslib_1.__importDefault(require("../../context/PaymentSourceContext")),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CustomerPaymentSourceContext_1=tslib_1.__importDefault(require("../../context/CustomerPaymentSourceContext"));function PaymentSourceDetail(_a){var{type,children}=_a,p=tslib_1.__rest(_a,["type","children"]);const card=(0,react_1.useContext)(PaymentSourceContext_1.default),customerCard=(0,react_1.useContext)(CustomerPaymentSourceContext_1.default),cardObj=Object.keys(card).length>0?card:customerCard,text=type in cardObj&&cardObj[type]!=null?cardObj[type]:type==="last4"?"****":"**",parentProps=Object.assign({type,text},p);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},p,{children:text}))}exports.default=PaymentSourceDetail;
@@ -0,0 +1,10 @@
1
+ import { type ReactNode, type JSX } from 'react';
2
+ import type { ChildrenFunction } from '../../typings/index';
3
+ interface CustomComponent extends Omit<Props, 'children'> {
4
+ }
5
+ type Props = {
6
+ children?: ChildrenFunction<CustomComponent>;
7
+ label?: string | ReactNode;
8
+ } & Omit<JSX.IntrinsicElements['button'], 'onClick'>;
9
+ export declare function PaymentSourceEditButton({ children, label, ...props }: Props): JSX.Element | null;
10
+ export default PaymentSourceEditButton;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSourceEditButton=PaymentSourceEditButton;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentSourceContext_1=tslib_1.__importDefault(require("../../context/PaymentSourceContext")),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function PaymentSourceEditButton(_a){var{children,label="Edit"}=_a,props=tslib_1.__rest(_a,["children","label"]);const{showCard,handleEditClick,readonly}=(0,react_1.useContext)(PaymentSourceContext_1.default),parentProps=Object.assign({showCard,label,handleEditClick},props);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):readonly?null:(0,jsx_runtime_1.jsx)("button",Object.assign({},props,{onClick:handleEditClick,children:label}))}exports.default=PaymentSourceEditButton;
@@ -0,0 +1,12 @@
1
+ import { type ReactNode, type JSX } from 'react';
2
+ export interface PaypalConfig {
3
+ return_url: string;
4
+ cancel_url: string;
5
+ infoMessage?: {
6
+ text?: string | ReactNode;
7
+ className?: string;
8
+ };
9
+ }
10
+ type Props = Omit<PaypalConfig, 'return_url' | 'cancel_url'> & JSX.IntrinsicElements['div'];
11
+ export declare function PaypalPayment({ infoMessage, ...p }: Props): JSX.Element | null;
12
+ export default PaypalPayment;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaypalPayment=PaypalPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),isFunction_1=tslib_1.__importDefault(require("lodash/isFunction")),react_1=require("react"),defaultMessage="by placing the order, you will be redirected to the PayPal website to sign in and authorize the payment";function PaypalPayment(_a){var{infoMessage}=_a,p=tslib_1.__rest(_a,["infoMessage"]);const ref=(0,react_1.useRef)(null),{setPaymentSource,paymentSource,currentPaymentMethodType,setPaymentRef}=(0,react_1.useContext)(PaymentMethodContext_1.default);(0,react_1.useEffect)(()=>(ref.current&&paymentSource&&currentPaymentMethodType&&paymentSource?.approval_url&&(ref.current.onsubmit=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield handleClick()}),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,paymentSource,currentPaymentMethodType]);const handleClick=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){if(paymentSource&&currentPaymentMethodType)try{return yield setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{metadata:{card:{id:paymentSource.id,brand:"paypal",last4:""}}}}),!0}catch{return!1}return!1});return(0,jsx_runtime_1.jsx)("form",{ref,children:(0,jsx_runtime_1.jsx)("div",Object.assign({},p,{children:(0,jsx_runtime_1.jsx)("span",{className:infoMessage?.className,children:(0,isFunction_1.default)(infoMessage?.text)?infoMessage?.text():infoMessage?.text||defaultMessage})}))})}exports.default=PaypalPayment;
@@ -0,0 +1,6 @@
1
+ import { type JSX } from "react";
2
+ interface Props {
3
+ clientSecret: string;
4
+ }
5
+ export declare function StripeExpressPayment({ clientSecret, }: Props): JSX.Element | null;
6
+ export {};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StripeExpressPayment=StripeExpressPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),expressPaymentHelper_1=require("../../utils/expressPaymentHelper"),isEmpty_1=require("../../utils/isEmpty"),react_stripe_js_1=require("@stripe/react-stripe-js"),react_1=require("react");function StripeExpressPayment({clientSecret}){const stripe=(0,react_stripe_js_1.useStripe)(),[paymentRequest,setPaymentRequest]=(0,react_1.useState)(null),{accessToken,endpoint}=(0,react_1.useContext)(CommerceLayerContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),{paymentMethods,paymentSource}=(0,react_1.useContext)(PaymentMethodContext_1.default);return(0,react_1.useEffect)(()=>{var _a,_b,_c,_d,_e;if(stripe==null||order==null)return;const pr=stripe.paymentRequest({country:(_a=order?.country_code)!==null&&_a!==void 0?_a:"US",currency:(_c=(_b=order?.currency_code)===null||_b===void 0?void 0:_b.toLowerCase())!==null&&_c!==void 0?_c:"",total:{label:`#${(_d=order?.number)!==null&&_d!==void 0?_d:""}`,amount:(_e=order?.total_amount_with_taxes_cents)!==null&&_e!==void 0?_e:0},requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:!0});pr.canMakePayment().then(result=>{result&&setPaymentRequest(pr)}).catch(err=>{console.error("Can make payment:",err)})},[(0,isEmpty_1.isEmpty)(stripe),(0,isEmpty_1.isEmpty)(order)]),paymentRequest!=null&&stripe!=null?(paymentRequest.on("shippingaddresschange",ev=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a,_b,_c,_d,_e,_f,_g;if(order!=null&&accessToken!=null&&endpoint!=null){const requiresBillingInfo=(_a=order?.requires_billing_info)!==null&&_a!==void 0?_a:!1,orderWithShipments=yield(0,expressPaymentHelper_1.setExpressFakeAddress)({orderId:order.id,config:{accessToken,endpoint},address:{first_name:"Fake name",last_name:"Fake lastname",country_code:(_b=ev.shippingAddress.country)!==null&&_b!==void 0?_b:"",line_1:"Fake street 123",city:(_c=ev.shippingAddress.city)!==null&&_c!==void 0?_c:"Fake city",zip_code:(_d=ev.shippingAddress.postalCode)!==null&&_d!==void 0?_d:"12345",state_code:(_e=ev.shippingAddress.region)!==null&&_e!==void 0?_e:"Fake state",phone:"1234567890",billing_info:requiresBillingInfo?"Fake billing info":void 0}}),shippingOptions=(0,expressPaymentHelper_1.getExpressShippingMethods)(orderWithShipments);shippingOptions!=null&&!(0,isEmpty_1.isEmpty)(shippingOptions)?ev.updateWith({status:"success",shippingOptions,total:{label:`#${(_f=orderWithShipments?.number)!==null&&_f!==void 0?_f:""}`,amount:(_g=orderWithShipments?.total_amount_with_taxes_cents)!==null&&_g!==void 0?_g:0}}):ev.updateWith({status:"invalid_shipping_address"})}else ev.updateWith({status:"fail"})})),paymentRequest.on("shippingoptionchange",ev=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a,_b;if(order!=null&&accessToken!=null&&endpoint!=null){const updatedOrder=yield(0,expressPaymentHelper_1.setExpressShippingMethod)({orderId:order.id,config:{accessToken,endpoint},selectFirst:!1,selectedShippingMethodId:ev.shippingOption.id,params:{include:["shipments.available_shipping_methods"]}});ev.updateWith({status:"success",total:{label:`#${(_a=updatedOrder?.number)!==null&&_a!==void 0?_a:""}`,amount:(_b=updatedOrder?.total_amount_with_taxes_cents)!==null&&_b!==void 0?_b:0}})}else ev.updateWith({status:"fail"})})),paymentRequest.on("paymentmethod",ev=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q,_r;if(order?.id==null)throw new Error("Order is null");if(paymentMethods==null)throw new Error("Payment methods are null");const[paymentMethod]=(0,expressPaymentHelper_1.getAvailableExpressPayments)(paymentMethods);if(paymentMethod==null)throw new Error("Payment method is null");if(paymentSource==null)throw new Error("Payment source is null");const requiresBillingInfo=(_a=order?.requires_billing_info)!==null&&_a!==void 0?_a:!1,paymentResource=paymentMethod?.payment_source_type;if(accessToken!=null&&endpoint!=null){const[firstName,lastName]=(_c=(_b=ev.payerName)===null||_b===void 0?void 0:_b.split(" "))!==null&&_c!==void 0?_c:[],[line]=(_e=(_d=ev.shippingAddress)===null||_d===void 0?void 0:_d.addressLine)!==null&&_e!==void 0?_e:"",email=(_f=ev.payerEmail)!==null&&_f!==void 0?_f:"";yield(0,expressPaymentHelper_1.setExpressFakeAddress)({orderId:order.id,config:{accessToken,endpoint},address:{first_name:firstName??"Fake name",last_name:lastName??"Fake lastname",country_code:(_h=(_g=ev?.shippingAddress)===null||_g===void 0?void 0:_g.country)!==null&&_h!==void 0?_h:"",line_1:line??"Fake street 123",city:(_k=(_j=ev?.shippingAddress)===null||_j===void 0?void 0:_j.city)!==null&&_k!==void 0?_k:"Fake city",zip_code:(_m=(_l=ev?.shippingAddress)===null||_l===void 0?void 0:_l.postalCode)!==null&&_m!==void 0?_m:"12345",state_code:(_p=(_o=ev?.shippingAddress)===null||_o===void 0?void 0:_o.region)!==null&&_p!==void 0?_p:"Fake state",phone:(_q=ev?.payerPhone)!==null&&_q!==void 0?_q:"1234567890",billing_info:requiresBillingInfo?"Fake billing info":void 0},email}),yield(0,expressPaymentHelper_1.setExpressShippingMethod)({orderId:order.id,config:{accessToken,endpoint},selectFirst:!1,selectedShippingMethodId:(_r=ev?.shippingOption)===null||_r===void 0?void 0:_r.id,params:{include:["shipments.available_shipping_methods"]}});const placeOrderParams={config:{accessToken,endpoint},orderId:order?.id,paymentResource,paymentSourceId:paymentSource?.id};yield(0,expressPaymentHelper_1.setExpressPlaceOrder)(placeOrderParams);const{paymentIntent,error:confirmError}=yield stripe.confirmCardPayment(clientSecret,{payment_method:ev.paymentMethod.id},{handleActions:!1});if(confirmError)ev.complete("fail"),console.error("Confirm card payment:",confirmError);else if(ev.complete("success"),paymentIntent.status==="requires_action"){const{error}=yield stripe.confirmCardPayment(clientSecret);if(error)console.error("Confirm card payment:",error);else{const placeOrderParams2={config:{accessToken,endpoint},orderId:order?.id,placeTheOrder:!0};try{const order2=yield(0,expressPaymentHelper_1.setExpressPlaceOrder)(placeOrderParams2);ev.complete("success"),yield(0,expressPaymentHelper_1.expressRedirectUrl)({order:order2,config:{accessToken,endpoint}})}catch(err){console.error("Place order:",err),ev.complete("fail")}}}else{const placeOrderParams2={config:{accessToken,endpoint},orderId:order?.id,placeTheOrder:!0};try{const order2=yield(0,expressPaymentHelper_1.setExpressPlaceOrder)(placeOrderParams2);ev.complete("success"),yield(0,expressPaymentHelper_1.expressRedirectUrl)({order:order2,config:{accessToken,endpoint}})}catch(err){console.error("Place order:",err),ev.complete("fail")}}}})),(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:(0,jsx_runtime_1.jsx)(react_stripe_js_1.PaymentRequestButtonElement,{className:"",options:{paymentRequest}})})):null}
@@ -0,0 +1,21 @@
1
+ import { type JSX } from 'react';
2
+ import type { StripeElementLocale, StripeElementsOptions, StripePaymentElementOptions } from '@stripe/stripe-js';
3
+ import type { PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
4
+ import type { PaymentSourceProps } from './PaymentSource';
5
+ export interface StripeConfig {
6
+ containerClassName?: string;
7
+ hintLabel?: string;
8
+ name?: string;
9
+ options?: StripePaymentElementOptions;
10
+ appearance?: StripeElementsOptions['appearance'];
11
+ [key: string]: any;
12
+ }
13
+ type Props = PaymentMethodConfig['stripePayment'] & Omit<JSX.IntrinsicElements['div'], 'ref'> & Partial<PaymentSourceProps['templateCustomerSaveToWallet']> & {
14
+ show?: boolean;
15
+ publishableKey: string;
16
+ locale?: StripeElementLocale;
17
+ clientSecret: string;
18
+ expressPayments?: boolean;
19
+ };
20
+ export declare function StripePayment({ publishableKey, show, options, clientSecret, locale, expressPayments, ...p }: Props): JSX.Element | null;
21
+ export default StripePayment;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StripePayment=StripePayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),react_stripe_js_1=require("@stripe/react-stripe-js"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),localStorage_1=require("../../utils/localStorage"),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),StripeExpressPayment_1=require("./StripeExpressPayment"),defaultOptions={layout:{type:"accordion",defaultCollapsed:!1,radios:!0,spacedAccordionItems:!1},fields:{billingDetails:"never"}},defaultAppearance={theme:"stripe",variables:{colorText:"#32325d",fontFamily:'"Helvetica Neue", Helvetica, sans-serif'}};function StripePaymentForm({options=defaultOptions,templateCustomerSaveToWallet}){const ref=(0,react_1.useRef)(null),{currentPaymentMethodType,setPaymentMethodErrors,setPaymentRef}=(0,react_1.useContext)(PaymentMethodContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),stripe=(0,react_stripe_js_1.useStripe)(),elements=(0,react_stripe_js_1.useElements)();(0,react_1.useEffect)(()=>(ref.current&&stripe&&elements&&(ref.current.onsubmit=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield onSubmit({event:ref.current,stripe,elements})}),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,stripe,elements]);const onSubmit=_a=>tslib_1.__awaiter(this,[_a],void 0,function*({event,stripe:stripe2,elements:elements2}){var _b,_c,_d,_e,_f,_g,_h;if(!stripe2)return!1;const savePaymentSourceToCustomerWallet=(_c=(_b=event?.elements)===null||_b===void 0?void 0:_b.save_payment_source_to_customer_wallet)===null||_c===void 0?void 0:_c.checked;if(savePaymentSourceToCustomerWallet&&(0,localStorage_1.setCustomerOrderParam)("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),elements2!=null){const billingInfo=order?.billing_address,email=(_d=order?.customer_email)!==null&&_d!==void 0?_d:"",billingDetails={name:(_e=billingInfo?.full_name)!==null&&_e!==void 0?_e:"",email,phone:billingInfo?.phone,address:{city:billingInfo?.city,country:billingInfo?.country_code,line1:billingInfo?.line_1,line2:(_f=billingInfo?.line_2)!==null&&_f!==void 0?_f:"",postal_code:(_g=billingInfo?.zip_code)!==null&&_g!==void 0?_g:"",state:billingInfo?.state_code}},url=new URL(window.location.href),cleanUrl=`${url.origin}${url.pathname}?accessToken=${url.searchParams.get("accessToken")}`,{error}=yield stripe2.confirmPayment({elements:elements2,confirmParams:{return_url:cleanUrl,payment_method_data:{billing_details:billingDetails}},redirect:"if_required"});return error?(console.error(error),setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:(_h=error.message)!==null&&_h!==void 0?_h:""}]),!1):!0}return!1});return(0,jsx_runtime_1.jsxs)("form",{ref,children:[(0,jsx_runtime_1.jsx)(react_stripe_js_1.PaymentElement,{id:"payment-element",options:Object.assign(Object.assign({},defaultOptions),options)}),templateCustomerSaveToWallet&&(0,jsx_runtime_1.jsx)(Parent_1.default,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})]})}function StripePayment(_a){var{publishableKey,show,options,clientSecret,locale="auto",expressPayments=!1}=_a,p=tslib_1.__rest(_a,["publishableKey","show","options","clientSecret","locale","expressPayments"]);const[isLoaded,setIsLoaded]=(0,react_1.useState)(!1),[stripe,setStripe]=(0,react_1.useState)(null),{containerClassName,templateCustomerSaveToWallet,fonts=[],appearance}=p,divProps=tslib_1.__rest(p,["containerClassName","templateCustomerSaveToWallet","fonts","appearance"]);(0,react_1.useEffect)(()=>(show&&publishableKey&&Promise.resolve().then(()=>tslib_1.__importStar(require("@stripe/stripe-js"))).then(({loadStripe})=>{(()=>tslib_1.__awaiter(this,void 0,void 0,function*(){const res=yield loadStripe(publishableKey,{locale});res!=null&&(setStripe(res),setIsLoaded(!0))}))()}),()=>{setIsLoaded(!1)}),[show,publishableKey]);const elementsOptions={clientSecret,appearance:Object.assign(Object.assign({},defaultAppearance),appearance),fonts};return isLoaded&&stripe!=null&&clientSecret!=null?(0,jsx_runtime_1.jsx)("div",Object.assign({className:containerClassName},divProps,{children:(0,jsx_runtime_1.jsx)(react_stripe_js_1.Elements,{stripe,options:elementsOptions,children:expressPayments?(0,jsx_runtime_1.jsx)(StripeExpressPayment_1.StripeExpressPayment,{clientSecret}):(0,jsx_runtime_1.jsx)(StripePaymentForm,{options,templateCustomerSaveToWallet})})})):null}exports.default=StripePayment;
@@ -0,0 +1,12 @@
1
+ import { type JSX } from 'react';
2
+ export interface WireTransferConfig {
3
+ infoMessage?: {
4
+ text?: string | JSX.Element[];
5
+ className?: string;
6
+ };
7
+ }
8
+ type Props = WireTransferConfig & JSX.IntrinsicElements['div'] & {
9
+ 'data-testid'?: string;
10
+ };
11
+ export declare function WireTransferPayment({ infoMessage, ...p }: Props): JSX.Element;
12
+ export default WireTransferPayment;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WireTransferPayment=WireTransferPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),react_1=require("react"),defaultMessage="after placing the order, you will need to manually complete the payment with your bank";function WireTransferPayment(_a){var _b,{infoMessage}=_a,p=tslib_1.__rest(_a,["infoMessage"]);const{className,"data-testid":dataTestId}=p,ref=(0,react_1.useRef)(null),{setPaymentSource,paymentSource,currentPaymentMethodType,setPaymentRef}=(0,react_1.useContext)(PaymentMethodContext_1.default);(0,react_1.useEffect)(()=>(ref.current&&paymentSource&&currentPaymentMethodType&&(ref.current.onsubmit=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield handleClick()}),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,paymentSource,currentPaymentMethodType]);const handleClick=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){if(paymentSource&&currentPaymentMethodType)try{return yield setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{metadata:{card:{id:paymentSource.id,brand:"wire-transfer",last4:""}}}}),!0}catch{return!1}return!1});return(0,jsx_runtime_1.jsx)("form",{ref,children:(0,jsx_runtime_1.jsx)("div",{className,"data-testid":dataTestId,children:(0,jsx_runtime_1.jsx)("span",{className:infoMessage?.className,children:(_b=infoMessage?.text)!==null&&_b!==void 0?_b:defaultMessage})})})}exports.default=WireTransferPayment;
@@ -0,0 +1,35 @@
1
+ import { type JSX } from 'react';
2
+ import type { Price as PriceType } from '@commercelayer/sdk';
3
+ import type { ChildrenFunction, LoaderType } from '../../typings/index';
4
+ interface PriceChildrenProps extends Omit<PriceProps, 'children'> {
5
+ loading: boolean;
6
+ loader: LoaderType;
7
+ prices: PriceType[];
8
+ }
9
+ export interface PriceProps extends Omit<JSX.IntrinsicElements['span'], 'children' | 'ref'> {
10
+ children?: ChildrenFunction<PriceChildrenProps>;
11
+ /**
12
+ * CSS class name to be added for the compare price
13
+ */
14
+ compareClassName?: string;
15
+ /**
16
+ * When `false` the compare_at price will not be displayed
17
+ * @default true
18
+ */
19
+ showCompare?: boolean;
20
+ /**
21
+ * The `sku_code` of the price to be fetched
22
+ */
23
+ skuCode?: string | null;
24
+ }
25
+ /**
26
+ * To display the price of your products with localized currency, discounts, and personalization rules, as shown in the code snippets below.
27
+ *
28
+ * Each price has an amount (the actual selling price) and an optional compare-at amount (the full price that you want to display to the customer — typically with a strikethrough).
29
+ * This component is the owner of the price information. It fetches the price of the specified SKU and dispatches it to the cl-price-amount children.
30
+ * <span type='info'>
31
+ * By default it shows the `formatted_amount` and `formatted_compare_at_amount` of the first price object, but it also allows to access to the full `Price`object via children props.
32
+ * </span>
33
+ */
34
+ export declare function Price(props: PriceProps): JSX.Element;
35
+ export default Price;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Price=Price;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),PricesContext_1=tslib_1.__importDefault(require("../../context/PricesContext")),react_1=require("react"),getPrices_1=require("../../utils/getPrices"),SkuChildrenContext_1=tslib_1.__importDefault(require("../../context/SkuChildrenContext"));function Price(props){const{children,skuCode=""}=props,{prices,skuCode:pricesSkuCode,loading,skuCodes,setSkuCodes,loader}=(0,react_1.useContext)(PricesContext_1.default),{sku}=(0,react_1.useContext)(SkuChildrenContext_1.default),[skuPrices,setSkuPrices]=(0,react_1.useState)([]),sCode=pricesSkuCode||skuCode||sku?.code||"";(0,react_1.useEffect)(()=>(prices!=null&&`${sCode}`in prices?setSkuPrices(prices[sCode]):sCode&&!skuCodes.includes(sCode)&&(skuCodes.push(sCode),setSkuCodes&&setSkuCodes({skuCodes})),()=>{setSkuPrices([])}),[prices,sCode]);const parentProps=Object.assign({loading,loader,prices:skuPrices},props),pricesComponent=prices==null||skuPrices==null?null:(0,getPrices_1.getPricesComponent)(skuPrices,props);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:loading||pricesComponent==null?loader:pricesComponent})}exports.default=Price;
@@ -0,0 +1,41 @@
1
+ import { type JSX } from 'react';
2
+ import type { LoaderType } from '../../typings/index';
3
+ import type { QueryPageSize } from '@commercelayer/sdk';
4
+ interface Props {
5
+ /**
6
+ * Any valid JSX.Element(s).
7
+ * A single `<Price>` component or a list of them is expected to render the prices.
8
+ */
9
+ children: JSX.Element | JSX.Element[];
10
+ /**
11
+ * SDK query filter to fetch the prices when multiple prices are requested.
12
+ */
13
+ filters?: object;
14
+ /**
15
+ * Loader component or string to be rendered while the prices are being fetched.
16
+ * @default 'Loading...'
17
+ */
18
+ loader?: LoaderType;
19
+ /**
20
+ * Prices per page to be fetched
21
+ */
22
+ perPage?: QueryPageSize;
23
+ /**
24
+ * SKU code to fetch the prices for. If not provided, the `sku_code` will be retrieved from the `<Price>` component(s) nested as children.
25
+ */
26
+ skuCode?: string;
27
+ }
28
+ /**
29
+ * Main container for the Prices components. It stores the prices context.
30
+ *
31
+ * It can be used to fetch the prices for a specific `sku_code` passed as prop
32
+ * or for the `sku_code` retrieved from all `<Price>` components nested as children.
33
+ * <span title='Requirements' type='warning'>
34
+ * Must be a child of the `<CommerceLayer>` component.
35
+ * </span>
36
+ * <span title='Children' type='info'>
37
+ * `<Price>`
38
+ * </span>
39
+ */
40
+ export declare function PricesContainer(props: Props): JSX.Element;
41
+ export default PricesContainer;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PricesContainer=PricesContainer;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),PriceReducer_1=tslib_1.__importStar(require("../../reducers/PriceReducer")),PricesContext_1=tslib_1.__importDefault(require("../../context/PricesContext")),SkuContext_1=tslib_1.__importDefault(require("../../context/SkuContext"));function PricesContainer(props){const{children,skuCode="",loader="Loading...",perPage=10,filters={}}=props,[state,dispatch]=(0,react_1.useReducer)(PriceReducer_1.default,PriceReducer_1.priceInitialState),config=(0,react_1.useContext)(CommerceLayerContext_1.default),{skuCodes}=(0,react_1.useContext)(SkuContext_1.default);!state.skuCodes.includes(skuCode)&&skuCode&&state.skuCodes.push(skuCode);const sCode=skuCodes&&skuCodes?.length>0?"":skuCode??"";(0,react_1.useEffect)(()=>{state.skuCodes.length===0&&skuCodes!=null&&skuCodes.length>0&&state.setSkuCodes!=null&&state.setSkuCodes({skuCodes,dispatch}),config.accessToken&&(state.skuCodes.length>0||sCode)&&(0,PriceReducer_1.getSkusPrice)(sCode&&[sCode]||state.skuCodes,{config,dispatch,perPage,filters})},[config.accessToken,sCode,state.skuCodes.length]);const priceValue=Object.assign(Object.assign({},state),{skuCode:sCode,loader,setSkuCodes:params=>{(0,PriceReducer_1.setSkuCodes)(Object.assign(Object.assign({},params),{dispatch}))}});return(0,jsx_runtime_1.jsx)(PricesContext_1.default.Provider,{value:priceValue,children})}exports.default=PricesContainer;
@@ -0,0 +1,10 @@
1
+ import { type ReactNode, type JSX } from 'react';
2
+ import type { LoaderType } from '../../typings/index';
3
+ import type { Order } from '@commercelayer/sdk';
4
+ interface ShipmentProps {
5
+ children: ReactNode;
6
+ loader?: LoaderType;
7
+ autoSelectSingleShippingMethod?: boolean | ((order?: Order) => void);
8
+ }
9
+ export declare function Shipment({ children, loader, autoSelectSingleShippingMethod }: ShipmentProps): JSX.Element;
10
+ export default Shipment;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Shipment=Shipment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ShipmentContext_1=tslib_1.__importDefault(require("../../context/ShipmentContext")),ShipmentChildrenContext_1=tslib_1.__importDefault(require("../../context/ShipmentChildrenContext")),getLoaderComponent_1=tslib_1.__importDefault(require("../../utils/getLoaderComponent")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext"));function Shipment({children,loader="Loading...",autoSelectSingleShippingMethod=!1}){const[loading,setLoading]=(0,react_1.useState)(!0),{shipments,deliveryLeadTimes,setShippingMethod}=(0,react_1.useContext)(ShipmentContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default);(0,react_1.useEffect)(()=>(shipments!=null&&(autoSelectSingleShippingMethod?tslib_1.__awaiter(this,void 0,void 0,function*(){var _a;for(const shipment of shipments){const isSingle=((_a=shipment?.available_shipping_methods)===null||_a===void 0?void 0:_a.length)===1;if(!shipment?.shipping_method&&isSingle){const[shippingMethod]=shipment?.available_shipping_methods||[];if(shippingMethod&&setShippingMethod!=null){const{success,order:order2}=yield setShippingMethod(shipment.id,shippingMethod.id);typeof autoSelectSingleShippingMethod=="function"&&success&&autoSelectSingleShippingMethod(order2)}}else setTimeout(()=>{setLoading(!1)},200)}}):setLoading(!1)),()=>{setLoading(!0)}),[shipments!=null,shipments?.length,order?.gift_card_or_coupon_code]);const components=shipments?.map((shipment,k)=>{var _a,_b;const shipmentLineItems=shipment.stock_line_items,lineItems=shipmentLineItems?.map(shipmentLineItem=>{const l=shipmentLineItem.line_item;return l&&(l.quantity=shipmentLineItem.quantity),l}),shippingMethods=shipment.available_shipping_methods,currentShippingMethodId=autoSelectSingleShippingMethod&&shippingMethods&&shippingMethods.length===1?(_a=shippingMethods[0])===null||_a===void 0?void 0:_a.id:(_b=shipment.shipping_method)===null||_b===void 0?void 0:_b.id,stockTransfers=shipment.stock_transfers,parcels=shipment.parcels,times=deliveryLeadTimes?.filter(time=>{var _a2,_b2;return((_a2=time.stock_location)===null||_a2===void 0?void 0:_a2.id)===((_b2=shipment.stock_location)===null||_b2===void 0?void 0:_b2.id)}),shipmentProps={parcels,lineItems,shippingMethods,currentShippingMethodId,stockTransfers,deliveryLeadTimes:times,shipment,keyNumber:shipment?.id};return(0,jsx_runtime_1.jsx)(ShipmentChildrenContext_1.default.Provider,{value:shipmentProps,children},k)});return loading?(0,getLoaderComponent_1.default)(loader):(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:components})}exports.default=Shipment;
@@ -0,0 +1,12 @@
1
+ import { type JSX } from 'react';
2
+ import type { Shipment } from '@commercelayer/sdk';
3
+ type ShipmentFieldChildrenProps = Omit<Props, 'children'> & {
4
+ shipment: Shipment;
5
+ };
6
+ export type ShipmentAttribute = 'number' | 'currency_code' | 'status' | 'cost_amount_cents' | 'cost_amount_float' | 'formatted_cost_amount' | 'key_number';
7
+ interface Props extends Omit<JSX.IntrinsicElements['span'], 'children' | 'ref'> {
8
+ children?: (props: ShipmentFieldChildrenProps) => JSX.Element;
9
+ name: ShipmentAttribute;
10
+ }
11
+ export declare function ShipmentField(props: Props): JSX.Element;
12
+ export default ShipmentField;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShipmentField=ShipmentField;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),get_1=tslib_1.__importDefault(require("lodash/get")),ShipmentChildrenContext_1=tslib_1.__importDefault(require("../../context/ShipmentChildrenContext"));function ShipmentField(props){const{name}=props,{shipment,keyNumber}=(0,react_1.useContext)(ShipmentChildrenContext_1.default),key=name,text=key!=="key_number"?(0,get_1.default)(shipment,key):keyNumber,parentProps=Object.assign({shipment},props);return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},props,{children:text}))}exports.default=ShipmentField;
@@ -0,0 +1,6 @@
1
+ import { type ReactNode, type JSX } from 'react';
2
+ interface Props {
3
+ children: ReactNode;
4
+ }
5
+ export declare function ShipmentsContainer(props: Props): JSX.Element;
6
+ export default ShipmentsContainer;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShipmentsContainer=ShipmentsContainer;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),ShipmentContext_1=tslib_1.__importStar(require("../../context/ShipmentContext")),react_1=require("react"),ShipmentReducer_1=tslib_1.__importStar(require("../../reducers/ShipmentReducer")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty"));function ShipmentsContainer(props){const{children}=props,[state,dispatch]=(0,react_1.useReducer)(ShipmentReducer_1.default,ShipmentReducer_1.shipmentInitialState),{order,getOrder,include,addResourceToInclude,includeLoaded}=(0,react_1.useContext)(OrderContext_1.default),config=(0,react_1.useContext)(CommerceLayerContext_1.default);(0,react_1.useEffect)(()=>{include?.includes("shipments.available_shipping_methods")?includeLoaded?.["shipments.available_shipping_methods"]||addResourceToInclude({newResourceLoaded:{"shipments.available_shipping_methods":!0,"shipments.stock_line_items.line_item":!0,"shipments.shipping_method":!0,"shipments.stock_transfers.line_item":!0,"shipments.stock_location":!0,"shipments.parcels.parcel_line_items":!0}}):addResourceToInclude({newResource:["shipments.available_shipping_methods","shipments.stock_line_items.line_item","shipments.shipping_method","shipments.stock_transfers.line_item","shipments.stock_location","shipments.parcels.parcel_line_items"]})},[include?.length,includeLoaded!=null]),(0,react_1.useEffect)(()=>{order!=null&&!(0,isEmpty_1.default)(config)&&order.shipments&&(0,ShipmentReducer_1.getShipments)({order,dispatch,config})},[order?.shipments]),(0,react_1.useEffect)(()=>(order&&(order.shipments&&order.shipments.length>0&&order.shipments.map(shipment=>shipment.available_shipping_methods&&shipment.available_shipping_methods.length>0).includes(!1)&&(0,ShipmentReducer_1.setShipmentErrors)([...state.errors||[],{code:"NO_SHIPPING_METHODS",message:"No shipping methods",resource:"shipments"}],dispatch),order.line_items&&order.line_items.length>0&&order.line_items.filter(({item_type:itemType})=>itemType==="skus").map(lineItem=>{var _a,_b,_c,_d;return!!(((_a=lineItem.item)===null||_a===void 0?void 0:_a.do_not_ship)||((_b=lineItem.item)===null||_b===void 0?void 0:_b.do_not_track)||((_d=(_c=lineItem.item)===null||_c===void 0?void 0:_c.inventory)===null||_d===void 0?void 0:_d.quantity)>=lineItem?.quantity)}).includes(!1)&&(0,ShipmentReducer_1.setShipmentErrors)([...state.errors||[],{code:"OUT_OF_STOCK",message:"No stock available",resource:"line_items"}],dispatch)),()=>{(0,ShipmentReducer_1.setShipmentErrors)([],dispatch)}),[order?.shipments]);const contextValue=(0,react_1.useMemo)(()=>Object.assign(Object.assign({},state),{setShipmentErrors:errors=>{ShipmentContext_1.defaultShipmentContext.setShipmentErrors(errors,dispatch)},setShippingMethod:(shipmentId,shippingMethodId)=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield(0,ShipmentReducer_1.setShippingMethod)({shippingMethodId,shipmentId,config,getOrder,order})})}),[state]);return(0,jsx_runtime_1.jsx)(ShipmentContext_1.default.Provider,{value:contextValue,children})}exports.default=ShipmentsContainer;
@@ -0,0 +1,18 @@
1
+ import type { ChildrenFunction } from '../../typings/index';
2
+ import type { Shipment } 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
+ shipments?: Shipment[] | null;
9
+ /**
10
+ * Quantity of the shipments
11
+ */
12
+ quantity: number;
13
+ }
14
+ interface Props extends Omit<JSX.IntrinsicElements['span'], 'children' | 'ref'> {
15
+ children?: ChildrenFunction<ChildrenProps>;
16
+ }
17
+ export declare function ShipmentsCount({ children, ...p }: Props): JSX.Element;
18
+ export default ShipmentsCount;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShipmentsCount=ShipmentsCount;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),ShipmentContext_1=tslib_1.__importDefault(require("../../context/ShipmentContext")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext"));function ShipmentsCount(_a){var _b,{children}=_a,p=tslib_1.__rest(_a,["children"]);const{shipments}=(0,useCustomContext_1.default)({context:ShipmentContext_1.default,contextComponentName:"ShipmentsContainer",currentComponentName:"ShipmentsCount",key:"shipments"}),quantity=(_b=shipments?.length)!==null&&_b!==void 0?_b:0,childrenProps=Object.assign(Object.assign({},p),{quantity,shipments});return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},childrenProps,{children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},p,{children:quantity}))}exports.default=ShipmentsCount;
@@ -0,0 +1,8 @@
1
+ import { type ReactNode, type JSX } from 'react';
2
+ interface Props {
3
+ children: ReactNode;
4
+ readonly?: boolean;
5
+ emptyText?: string;
6
+ }
7
+ export declare function ShippingMethod(props: Props): JSX.Element;
8
+ export default ShippingMethod;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShippingMethod=ShippingMethod;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ShippingMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/ShippingMethodChildrenContext")),ShipmentChildrenContext_1=tslib_1.__importDefault(require("../../context/ShipmentChildrenContext")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty"));function ShippingMethod(props){const{children,readonly,emptyText="There are not any shipping method available"}=props,{shippingMethods,currentShippingMethodId,deliveryLeadTimes,shipment}=(0,react_1.useContext)(ShipmentChildrenContext_1.default),[items,setItems]=(0,react_1.useState)([]);(0,react_1.useEffect)(()=>{const methods=shippingMethods?.filter(s=>readonly?s.id===currentShippingMethodId:!0).map((shippingMethod,k)=>{var _a;const[deliveryLeadTimeForShipment]=(_a=deliveryLeadTimes?.filter(delivery=>{var _a2;const deliveryShippingMethodId=(_a2=delivery.shipping_method)===null||_a2===void 0?void 0:_a2.id;return shippingMethod.id===deliveryShippingMethodId}))!==null&&_a!==void 0?_a:[],shippingProps={shipmentId:shipment?.id,shippingMethod,currentShippingMethodId,deliveryLeadTimeForShipment};return(0,jsx_runtime_1.jsx)(ShippingMethodChildrenContext_1.default.Provider,{value:shippingProps,children},k)});return methods&&setItems(methods),()=>{setItems([])}},[currentShippingMethodId,deliveryLeadTimes,shippingMethods]);const components=!(0,isEmpty_1.default)(items)&&items||emptyText;return(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:components})}exports.default=ShippingMethod;
@@ -0,0 +1,11 @@
1
+ import { type JSX } from 'react';
2
+ import type { ShippingMethod } from '@commercelayer/sdk';
3
+ type ChildrenProps = Omit<Props, 'children'> & {
4
+ label: string;
5
+ shippingMethod: ShippingMethod;
6
+ };
7
+ interface Props extends Omit<JSX.IntrinsicElements['label'], 'children' | 'ref'> {
8
+ children?: (props: ChildrenProps) => JSX.Element;
9
+ }
10
+ export declare function ShippingMethodName(props: Props): JSX.Element;
11
+ export default ShippingMethodName;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShippingMethodName=ShippingMethodName;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ShippingMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/ShippingMethodChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function ShippingMethodName(props){var _a;const{shippingMethod,deliveryLeadTimeForShipment,shipmentId}=(0,react_1.useContext)(ShippingMethodChildrenContext_1.default),htmlFor=`shipment-${shipmentId??""}-${(_a=shippingMethod?.id)!==null&&_a!==void 0?_a:""}`||"",labelName=shippingMethod?.name,parentProps=Object.assign({shippingMethod,deliveryLeadTimeForShipment,label:labelName,htmlFor},props);return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children})):(0,jsx_runtime_1.jsx)("label",Object.assign({htmlFor},props,{children:labelName}))}exports.default=ShippingMethodName;
@@ -0,0 +1,20 @@
1
+ import { type JSX } from 'react';
2
+ import type { BaseAmountComponent } from '../../typings/index';
3
+ type Props = BaseAmountComponent & {
4
+ /**
5
+ * The label to show when the price is free
6
+ */
7
+ labelFreeOver?: string;
8
+ /**
9
+ * The label to show when the price is external
10
+ */
11
+ labelExternal?: string;
12
+ } & ({
13
+ type?: 'amount';
14
+ base?: 'freeOver';
15
+ } | {
16
+ type?: 'amount' | 'amountForShipment';
17
+ base?: 'price';
18
+ });
19
+ export declare function ShippingMethodPrice(props: Props): JSX.Element;
20
+ export default ShippingMethodPrice;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShippingMethodPrice=ShippingMethodPrice;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),getAmount_1=tslib_1.__importDefault(require("../../utils/getAmount")),ShippingMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/ShippingMethodChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function ShippingMethodPrice(props){const{base="price_amount",type="for_shipment",format="formatted",labelFreeOver="Free",labelExternal="Price estimates after the shipping method selection"}=props,p=tslib_1.__rest(props,["base","type","format","labelFreeOver","labelExternal"]),{shippingMethod}=(0,react_1.useContext)(ShippingMethodChildrenContext_1.default),[price,setPrice]=(0,react_1.useState)(""),[priceCents,setPriceCents]=(0,react_1.useState)(0),scheme=shippingMethod?.scheme;(0,react_1.useEffect)(()=>{if(shippingMethod){const p2=(0,getAmount_1.default)({base,type,format,obj:shippingMethod});setPrice(p2);const pCents=(0,getAmount_1.default)({base:"price_amount",type:"for_shipment",format:"cents",obj:shippingMethod});setPriceCents(pCents)}return()=>{setPrice(""),setPriceCents(0)}},[shippingMethod]);const parentProps=Object.assign({price,scheme},p),finalPrice=priceCents===0?labelFreeOver:price;return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},p,{children:scheme==="external"?labelExternal:finalPrice}))}exports.default=ShippingMethodPrice;
@@ -0,0 +1,17 @@
1
+ import { type JSX } from 'react';
2
+ import type { Order, ShippingMethod } from '@commercelayer/sdk';
3
+ interface ShippingMethodRadioButtonType extends Omit<Props, 'children'> {
4
+ shippingMethod: ShippingMethod;
5
+ shipmentId: string;
6
+ }
7
+ interface TOnChange {
8
+ shippingMethod: ShippingMethod;
9
+ shipmentId: string;
10
+ order?: Order;
11
+ }
12
+ type Props = {
13
+ children?: (props: ShippingMethodRadioButtonType) => JSX.Element;
14
+ onChange?: (params: TOnChange) => void;
15
+ } & Omit<JSX.IntrinsicElements['input'], 'onChange' | 'ref' | 'children'>;
16
+ export declare function ShippingMethodRadioButton(props: Props): JSX.Element;
17
+ export default ShippingMethodRadioButton;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShippingMethodRadioButton=ShippingMethodRadioButton;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ShippingMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/ShippingMethodChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),ShipmentContext_1=tslib_1.__importDefault(require("../../context/ShipmentContext"));function ShippingMethodRadioButton(props){const{onChange,children}=props,p=tslib_1.__rest(props,["onChange","children"]),[checked,setChecked]=(0,react_1.useState)(!1),[disabled,setDisabled]=(0,react_1.useState)(!1),{shippingMethod,currentShippingMethodId,shipmentId}=(0,react_1.useContext)(ShippingMethodChildrenContext_1.default),{setShippingMethod}=(0,react_1.useContext)(ShipmentContext_1.default),shippingMethodId=shippingMethod?.id,name=`shipment-${shipmentId??""}`,id=`${name}-${shippingMethodId??""}`;(0,react_1.useEffect)(()=>(setChecked(shippingMethodId===currentShippingMethodId),()=>{setChecked(!1)}),[currentShippingMethodId,shippingMethodId]);const handleOnChange=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){if(setDisabled(!0),shipmentId&&shippingMethodId&&setShippingMethod!=null){const{order}=yield setShippingMethod(shipmentId,shippingMethodId);shippingMethod&&onChange!=null&&onChange({shippingMethod,shipmentId,order})}setDisabled(!1)}),parentProps=Object.assign({shippingMethod,shipmentId,handleOnChange,name,id,disabled},props);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("input",Object.assign({disabled,type:"radio",name,id,onChange:e=>{e.preventDefault(),e.stopPropagation(),handleOnChange()},checked},p))}exports.default=ShippingMethodRadioButton;
@@ -0,0 +1,34 @@
1
+ import { type ReactNode, type JSX } from 'react';
2
+ interface Props {
3
+ /**
4
+ * The children component
5
+ */
6
+ children: ReactNode;
7
+ /**
8
+ * The sku code
9
+ */
10
+ skuCode?: string;
11
+ /**
12
+ * The sku id. If you use this prop, the skuCode will be ignored and the sku will be fetched by id improving the performance
13
+ */
14
+ skuId?: string;
15
+ /**
16
+ * Callback called when the quantity is updated
17
+ */
18
+ getQuantity?: (quantity: number) => void;
19
+ }
20
+ /**
21
+ * Main container for the Availability components.
22
+ * It stores - in its context - the sku quantity returned from the `inventory_model` and the `delivery_lead_time` for the first shipping method found in the inventory model.
23
+ *
24
+ * It can be used to fetch the quantities for a specific `sku_code` passed as prop.
25
+ * <span title='Requirements' type='warning'>
26
+ * Must be a child of the `<CommerceLayer>` component. <br/>
27
+ * Can be a child of the `<SkusContainer>` component and receive the `sku_code` from its context.
28
+ * </span>
29
+ * <span title='Children' type='info'>
30
+ * `<AvailabilityTemplate>`
31
+ * </span>
32
+ */
33
+ export declare function AvailabilityContainer({ children, skuCode, skuId, getQuantity }: Props): JSX.Element;
34
+ export default AvailabilityContainer;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AvailabilityContainer=AvailabilityContainer;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),AvailabilityReducer_1=tslib_1.__importStar(require("../../reducers/AvailabilityReducer")),AvailabilityContext_1=tslib_1.__importDefault(require("../../context/AvailabilityContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),SkuChildrenContext_1=tslib_1.__importDefault(require("../../context/SkuChildrenContext")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext"));function AvailabilityContainer({children,skuCode,skuId,getQuantity}){const{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),{sku}=(0,react_1.useContext)(SkuChildrenContext_1.default),{accessToken,endpoint}=(0,useCustomContext_1.default)({context:CommerceLayerContext_1.default,contextComponentName:"CommerceLayer",currentComponentName:"AvailabilityContainer",key:"accessToken"}),[state,dispatch]=(0,react_1.useReducer)(AvailabilityReducer_1.default,AvailabilityReducer_1.availabilityInitialState),sCode=skuCode||lineItem?.sku_code||sku?.code;(0,react_1.useEffect)(()=>{if(accessToken!=null&&accessToken!==""){const config={accessToken,endpoint};(sCode!=null||skuId!=null)&&(0,AvailabilityReducer_1.getAvailability)({skuCode:sCode,skuId,config,dispatch})}return()=>{dispatch({type:"setAvailability",payload:{}})}},[accessToken,sCode,skuId]),(0,react_1.useEffect)(()=>{getQuantity!=null&&state?.quantity!=null&&getQuantity(state?.quantity)},[state.quantity]);const memoized=(0,react_1.useMemo)(()=>Object.assign(Object.assign({},state),{parent:!0}),[state]);return(0,jsx_runtime_1.jsx)(AvailabilityContext_1.default.Provider,{value:memoized,children})}exports.default=AvailabilityContainer;