@commercelayer/react-components 2.46.7 → 2.48.1

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 (775) hide show
  1. package/{dist → lib/cjs}/components/AddToCartButton.d.ts +20 -17
  2. package/lib/cjs/components/AddToCartButton.js +1 -0
  3. package/{dist → lib/cjs}/components/Address.d.ts +13 -13
  4. package/lib/cjs/components/Address.js +1 -0
  5. package/{dist → lib/cjs}/components/AddressCountrySelector.d.ts +9 -9
  6. package/lib/cjs/components/AddressCountrySelector.js +1 -0
  7. package/{dist → lib/cjs}/components/AddressField.d.ts +15 -15
  8. package/lib/cjs/components/AddressField.js +1 -0
  9. package/{dist → lib/cjs}/components/AddressInput.d.ts +7 -7
  10. package/lib/cjs/components/AddressInput.js +1 -0
  11. package/{dist → lib/cjs}/components/AddressStateSelector.d.ts +11 -11
  12. package/lib/cjs/components/AddressStateSelector.js +1 -0
  13. package/{dist → lib/cjs}/components/AddressesContainer.d.ts +7 -7
  14. package/lib/cjs/components/AddressesContainer.js +1 -0
  15. package/{dist → lib/cjs}/components/AdyenPayment.d.ts +25 -25
  16. package/lib/cjs/components/AdyenPayment.js +1 -0
  17. package/{dist → lib/cjs}/components/AvailabilityContainer.d.ts +7 -7
  18. package/lib/cjs/components/AvailabilityContainer.js +1 -0
  19. package/{dist → lib/cjs}/components/AvailabilityTemplate.d.ts +13 -16
  20. package/lib/cjs/components/AvailabilityTemplate.js +1 -0
  21. package/{dist → lib/cjs}/components/BillingAddressContainer.d.ts +6 -6
  22. package/lib/cjs/components/BillingAddressContainer.js +1 -0
  23. package/{dist → lib/cjs}/components/BillingAddressForm.d.ts +8 -8
  24. package/lib/cjs/components/BillingAddressForm.js +1 -0
  25. package/{dist → lib/cjs}/components/BraintreePayment.d.ts +30 -30
  26. package/lib/cjs/components/BraintreePayment.js +1 -0
  27. package/{dist → lib/cjs}/components/CheckoutLink.d.ts +11 -11
  28. package/lib/cjs/components/CheckoutLink.js +1 -0
  29. package/{dist → lib/cjs}/components/CommerceLayer.d.ts +8 -9
  30. package/lib/cjs/components/CommerceLayer.js +1 -0
  31. package/{dist → lib/cjs}/components/CustomerContainer.d.ts +7 -7
  32. package/lib/cjs/components/CustomerContainer.js +1 -0
  33. package/{dist → lib/cjs}/components/CustomerInput.d.ts +11 -11
  34. package/lib/cjs/components/CustomerInput.js +1 -0
  35. package/{dist → lib/cjs}/components/DeliveryLeadTime.d.ts +10 -10
  36. package/lib/cjs/components/DeliveryLeadTime.js +1 -0
  37. package/{dist → lib/cjs}/components/DiscountAmount.d.ts +4 -4
  38. package/lib/cjs/components/DiscountAmount.js +1 -0
  39. package/{dist → lib/cjs}/components/Errors.d.ts +5 -5
  40. package/lib/cjs/components/Errors.js +1 -0
  41. package/{dist → lib/cjs}/components/ExternalFunction.d.ts +7 -7
  42. package/lib/cjs/components/ExternalFunction.js +1 -0
  43. package/{dist → lib/cjs}/components/GiftCard.d.ts +8 -8
  44. package/lib/cjs/components/GiftCard.js +1 -0
  45. package/{dist → lib/cjs}/components/GiftCardAmount.d.ts +4 -4
  46. package/lib/cjs/components/GiftCardAmount.js +1 -0
  47. package/{dist → lib/cjs}/components/GiftCardContainer.d.ts +6 -6
  48. package/lib/cjs/components/GiftCardContainer.js +1 -0
  49. package/{dist → lib/cjs}/components/GiftCardCurrencySelector.d.ts +7 -7
  50. package/lib/cjs/components/GiftCardCurrencySelector.js +1 -0
  51. package/{dist → lib/cjs}/components/GiftCardInput.d.ts +7 -7
  52. package/lib/cjs/components/GiftCardInput.js +1 -0
  53. package/{dist → lib/cjs}/components/GiftCardOrCouponCode.d.ts +13 -13
  54. package/lib/cjs/components/GiftCardOrCouponCode.js +1 -0
  55. package/{dist → lib/cjs}/components/GiftCardOrCouponForm.d.ts +10 -10
  56. package/lib/cjs/components/GiftCardOrCouponForm.js +1 -0
  57. package/{dist → lib/cjs}/components/GiftCardOrCouponInput.d.ts +8 -8
  58. package/lib/cjs/components/GiftCardOrCouponInput.js +1 -0
  59. package/{dist → lib/cjs}/components/GiftCardOrCouponRemoveButton.d.ts +16 -16
  60. package/lib/cjs/components/GiftCardOrCouponRemoveButton.js +1 -0
  61. package/{dist → lib/cjs}/components/GiftCardOrCouponSubmit.d.ts +9 -9
  62. package/lib/cjs/components/GiftCardOrCouponSubmit.js +1 -0
  63. package/{dist → lib/cjs}/components/GiftCardRecipient.d.ts +0 -0
  64. package/lib/cjs/components/GiftCardRecipient.js +1 -0
  65. package/{dist → lib/cjs}/components/GiftCardRecipientInput.d.ts +0 -0
  66. package/lib/cjs/components/GiftCardRecipientInput.js +1 -0
  67. package/{dist → lib/cjs}/components/ItemContainer.d.ts +11 -11
  68. package/lib/cjs/components/ItemContainer.js +1 -0
  69. package/{dist → lib/cjs}/components/LineItem.d.ts +8 -8
  70. package/lib/cjs/components/LineItem.js +1 -0
  71. package/{dist → lib/cjs}/components/LineItemAmount.d.ts +7 -7
  72. package/lib/cjs/components/LineItemAmount.js +1 -0
  73. package/{dist/components/LineItemSkuCode.d.ts → lib/cjs/components/LineItemCode.d.ts} +8 -7
  74. package/lib/cjs/components/LineItemCode.js +1 -0
  75. package/{dist → lib/cjs}/components/LineItemImage.d.ts +10 -10
  76. package/lib/cjs/components/LineItemImage.js +1 -0
  77. package/{dist → lib/cjs}/components/LineItemName.d.ts +9 -7
  78. package/lib/cjs/components/LineItemName.js +1 -0
  79. package/{dist → lib/cjs}/components/LineItemOption.d.ts +19 -19
  80. package/lib/cjs/components/LineItemOption.js +1 -0
  81. package/{dist → lib/cjs}/components/LineItemOptions.d.ts +14 -14
  82. package/lib/cjs/components/LineItemOptions.js +1 -0
  83. package/{dist → lib/cjs}/components/LineItemQuantity.d.ts +14 -14
  84. package/lib/cjs/components/LineItemQuantity.js +1 -0
  85. package/{dist → lib/cjs}/components/LineItemRemoveLink.d.ts +12 -12
  86. package/lib/cjs/components/LineItemRemoveLink.js +1 -0
  87. package/{dist → lib/cjs}/components/LineItemsContainer.d.ts +8 -8
  88. package/lib/cjs/components/LineItemsContainer.js +1 -0
  89. package/{dist → lib/cjs}/components/LineItemsCount.d.ts +10 -10
  90. package/lib/cjs/components/LineItemsCount.js +1 -0
  91. package/{dist → lib/cjs}/components/MetadataInput.d.ts +5 -5
  92. package/lib/cjs/components/MetadataInput.js +1 -0
  93. package/{dist → lib/cjs}/components/OrderContainer.d.ts +11 -10
  94. package/lib/cjs/components/OrderContainer.js +1 -0
  95. package/{dist → lib/cjs}/components/OrderNumber.d.ts +5 -5
  96. package/lib/cjs/components/OrderNumber.js +1 -0
  97. package/{dist → lib/cjs}/components/OrderStorage.d.ts +8 -8
  98. package/lib/cjs/components/OrderStorage.js +1 -0
  99. package/{dist → lib/cjs}/components/PaymentGateway.d.ts +16 -16
  100. package/lib/cjs/components/PaymentGateway.js +1 -0
  101. package/{dist → lib/cjs}/components/PaymentMethod.d.ts +16 -16
  102. package/lib/cjs/components/PaymentMethod.js +1 -0
  103. package/{dist → lib/cjs}/components/PaymentMethodAmount.d.ts +4 -4
  104. package/lib/cjs/components/PaymentMethodAmount.js +1 -0
  105. package/{dist → lib/cjs}/components/PaymentMethodName.d.ts +9 -9
  106. package/lib/cjs/components/PaymentMethodName.js +1 -0
  107. package/{dist → lib/cjs}/components/PaymentMethodPrice.d.ts +9 -9
  108. package/lib/cjs/components/PaymentMethodPrice.js +1 -0
  109. package/{dist → lib/cjs}/components/PaymentMethodRadioButton.d.ts +11 -11
  110. package/lib/cjs/components/PaymentMethodRadioButton.js +1 -0
  111. package/{dist → lib/cjs}/components/PaymentMethodsContainer.d.ts +8 -8
  112. package/lib/cjs/components/PaymentMethodsContainer.js +1 -0
  113. package/{dist → lib/cjs}/components/PaymentSource.d.ts +19 -19
  114. package/lib/cjs/components/PaymentSource.js +1 -0
  115. package/{dist → lib/cjs}/components/PaymentSourceBrandIcon.d.ts +15 -15
  116. package/lib/cjs/components/PaymentSourceBrandIcon.js +1 -0
  117. package/{dist → lib/cjs}/components/PaymentSourceBrandName.d.ts +12 -12
  118. package/lib/cjs/components/PaymentSourceBrandName.js +1 -0
  119. package/{dist → lib/cjs}/components/PaymentSourceDetail.d.ts +12 -12
  120. package/lib/cjs/components/PaymentSourceDetail.js +1 -0
  121. package/{dist → lib/cjs}/components/PaymentSourceEditButton.d.ts +9 -9
  122. package/lib/cjs/components/PaymentSourceEditButton.js +1 -0
  123. package/{dist → lib/cjs}/components/PaypalPayment.d.ts +12 -12
  124. package/lib/cjs/components/PaypalPayment.js +1 -0
  125. package/{dist → lib/cjs}/components/PlaceOrderButton.d.ts +12 -12
  126. package/lib/cjs/components/PlaceOrderButton.js +1 -0
  127. package/{dist → lib/cjs}/components/PlaceOrderContainer.d.ts +8 -8
  128. package/lib/cjs/components/PlaceOrderContainer.js +1 -0
  129. package/{dist → lib/cjs}/components/Price.d.ts +14 -14
  130. package/lib/cjs/components/Price.js +1 -0
  131. package/{dist → lib/cjs}/components/PricesContainer.d.ts +11 -11
  132. package/lib/cjs/components/PricesContainer.js +1 -0
  133. package/{dist → lib/cjs}/components/PrivacyAndTermsCheckbox.d.ts +4 -4
  134. package/lib/cjs/components/PrivacyAndTermsCheckbox.js +1 -0
  135. package/{dist → lib/cjs}/components/QuantitySelector.d.ts +17 -17
  136. package/lib/cjs/components/QuantitySelector.js +1 -0
  137. package/{dist → lib/cjs}/components/SaveAddressesButton.d.ts +10 -10
  138. package/lib/cjs/components/SaveAddressesButton.js +1 -0
  139. package/{dist → lib/cjs}/components/SaveCustomerButton.d.ts +13 -13
  140. package/lib/cjs/components/SaveCustomerButton.js +1 -0
  141. package/{dist → lib/cjs}/components/Shipment.d.ts +8 -8
  142. package/lib/cjs/components/Shipment.js +1 -0
  143. package/{dist → lib/cjs}/components/ShipmentField.d.ts +12 -12
  144. package/lib/cjs/components/ShipmentField.js +1 -0
  145. package/{dist → lib/cjs}/components/ShipmentsContainer.d.ts +6 -6
  146. package/lib/cjs/components/ShipmentsContainer.js +1 -0
  147. package/{dist → lib/cjs}/components/ShippingAddressContainer.d.ts +6 -6
  148. package/lib/cjs/components/ShippingAddressContainer.js +1 -0
  149. package/{dist → lib/cjs}/components/ShippingAddressForm.d.ts +8 -8
  150. package/lib/cjs/components/ShippingAddressForm.js +1 -0
  151. package/{dist → lib/cjs}/components/ShippingAmount.d.ts +4 -4
  152. package/lib/cjs/components/ShippingAmount.js +1 -0
  153. package/{dist → lib/cjs}/components/ShippingMethod.d.ts +8 -8
  154. package/lib/cjs/components/ShippingMethod.js +1 -0
  155. package/{dist → lib/cjs}/components/ShippingMethodName.d.ts +11 -11
  156. package/lib/cjs/components/ShippingMethodName.js +1 -0
  157. package/{dist → lib/cjs}/components/ShippingMethodPrice.d.ts +13 -13
  158. package/lib/cjs/components/ShippingMethodPrice.js +1 -0
  159. package/{dist → lib/cjs}/components/ShippingMethodRadioButton.d.ts +9 -9
  160. package/lib/cjs/components/ShippingMethodRadioButton.js +1 -0
  161. package/{dist → lib/cjs}/components/SkuList.d.ts +7 -7
  162. package/lib/cjs/components/SkuList.js +1 -0
  163. package/{dist → lib/cjs}/components/SkuListsContainer.d.ts +6 -6
  164. package/lib/cjs/components/SkuListsContainer.js +1 -0
  165. package/{dist → lib/cjs}/components/SkuOption.d.ts +7 -7
  166. package/lib/cjs/components/SkuOption.js +1 -0
  167. package/{dist → lib/cjs}/components/SkuOptionInput.d.ts +5 -5
  168. package/lib/cjs/components/SkuOptionInput.js +1 -0
  169. package/{dist → lib/cjs}/components/SkuOptionsContainer.d.ts +7 -7
  170. package/lib/cjs/components/SkuOptionsContainer.js +1 -0
  171. package/{dist → lib/cjs}/components/StockTransfer.d.ts +6 -6
  172. package/lib/cjs/components/StockTransfer.js +1 -0
  173. package/{dist → lib/cjs}/components/StockTransferField.d.ts +9 -9
  174. package/lib/cjs/components/StockTransferField.js +1 -0
  175. package/{dist → lib/cjs}/components/StripePayment.d.ts +18 -18
  176. package/lib/cjs/components/StripePayment.js +1 -0
  177. package/{dist → lib/cjs}/components/SubTotalAmount.d.ts +4 -4
  178. package/lib/cjs/components/SubTotalAmount.js +1 -0
  179. package/{dist → lib/cjs}/components/SubmitButton.d.ts +9 -9
  180. package/lib/cjs/components/SubmitButton.js +1 -0
  181. package/{dist → lib/cjs}/components/TaxesAmount.d.ts +4 -4
  182. package/lib/cjs/components/TaxesAmount.js +1 -0
  183. package/{dist → lib/cjs}/components/TotalAmount.d.ts +4 -4
  184. package/lib/cjs/components/TotalAmount.js +1 -0
  185. package/{dist → lib/cjs}/components/VariantSelector.d.ts +29 -27
  186. package/lib/cjs/components/VariantSelector.js +1 -0
  187. package/{dist → lib/cjs}/components/VariantsContainer.d.ts +8 -8
  188. package/lib/cjs/components/VariantsContainer.js +1 -0
  189. package/{dist → lib/cjs}/components/WireTransferPayment.d.ts +10 -10
  190. package/lib/cjs/components/WireTransferPayment.js +1 -0
  191. package/{dist → lib/cjs}/components/gateways/AdyenGateway.d.ts +5 -5
  192. package/lib/cjs/components/gateways/AdyenGateway.js +1 -0
  193. package/{dist → lib/cjs}/components/gateways/BraintreeGateway.d.ts +5 -5
  194. package/lib/cjs/components/gateways/BraintreeGateway.js +1 -0
  195. package/{dist → lib/cjs}/components/gateways/PaypalGateway.d.ts +5 -5
  196. package/lib/cjs/components/gateways/PaypalGateway.js +1 -0
  197. package/{dist → lib/cjs}/components/gateways/StripeGateway.d.ts +5 -5
  198. package/lib/cjs/components/gateways/StripeGateway.js +1 -0
  199. package/{dist → lib/cjs}/components/gateways/WireTransferGateway.d.ts +5 -5
  200. package/lib/cjs/components/gateways/WireTransferGateway.js +1 -0
  201. package/{dist → lib/cjs}/components/utils/AddressCardsTemplate.d.ts +27 -27
  202. package/lib/cjs/components/utils/AddressCardsTemplate.js +1 -0
  203. package/{dist → lib/cjs}/components/utils/BaseField.d.ts +8 -8
  204. package/lib/cjs/components/utils/BaseField.js +1 -0
  205. package/lib/cjs/components/utils/BaseInput.d.ts +5 -0
  206. package/lib/cjs/components/utils/BaseInput.js +1 -0
  207. package/{dist → lib/cjs}/components/utils/BaseOrderPrice.d.ts +6 -6
  208. package/lib/cjs/components/utils/BaseOrderPrice.js +1 -0
  209. package/{dist → lib/cjs}/components/utils/BaseSelect.d.ts +5 -5
  210. package/lib/cjs/components/utils/BaseSelect.js +1 -0
  211. package/{dist → lib/cjs}/components/utils/Parent.d.ts +8 -8
  212. package/lib/cjs/components/utils/Parent.js +1 -0
  213. package/{dist → lib/cjs}/components/utils/PaymentCardsTemplate.d.ts +23 -24
  214. package/lib/cjs/components/utils/PaymentCardsTemplate.js +1 -0
  215. package/{dist → lib/cjs}/components/utils/PriceTemplate.d.ts +8 -8
  216. package/lib/cjs/components/utils/PriceTemplate.js +1 -0
  217. package/{dist → lib/cjs}/components/utils/VariantTemplate.d.ts +36 -34
  218. package/lib/cjs/components/utils/VariantTemplate.js +1 -0
  219. package/{dist → lib/cjs}/components/utils/getAllErrors.d.ts +17 -17
  220. package/lib/cjs/components/utils/getAllErrors.js +1 -0
  221. package/{dist → lib/cjs}/config/components.d.ts +867 -867
  222. package/lib/cjs/config/components.js +1 -0
  223. package/lib/cjs/config/currency.d.ts +5 -0
  224. package/lib/cjs/config/currency.js +1 -0
  225. package/{dist → lib/cjs}/context/AddressChildrenContext.d.ts +7 -7
  226. package/lib/cjs/context/AddressChildrenContext.js +1 -0
  227. package/{dist → lib/cjs}/context/AddressContext.d.ts +17 -17
  228. package/lib/cjs/context/AddressContext.js +1 -0
  229. package/{dist → lib/cjs}/context/AvailabilityContext.d.ts +3 -3
  230. package/lib/cjs/context/AvailabilityContext.js +1 -0
  231. package/{dist → lib/cjs}/context/BillingAddressContext.d.ts +12 -12
  232. package/lib/cjs/context/BillingAddressContext.js +1 -0
  233. package/{dist → lib/cjs}/context/BillingAddressFormContext.d.ts +18 -18
  234. package/lib/cjs/context/BillingAddressFormContext.js +1 -0
  235. package/{dist → lib/cjs}/context/CommerceLayerContext.d.ts +7 -8
  236. package/lib/cjs/context/CommerceLayerContext.js +1 -0
  237. package/{dist → lib/cjs}/context/CouponAndGiftCardFormContext.d.ts +7 -7
  238. package/lib/cjs/context/CouponAndGiftCardFormContext.js +1 -0
  239. package/{dist → lib/cjs}/context/CustomerContext.d.ts +16 -16
  240. package/lib/cjs/context/CustomerContext.js +1 -0
  241. package/{dist → lib/cjs}/context/ExternalFunctionContext.d.ts +12 -12
  242. package/lib/cjs/context/ExternalFunctionContext.js +1 -0
  243. package/{dist → lib/cjs}/context/GiftCardContext.d.ts +11 -11
  244. package/lib/cjs/context/GiftCardContext.js +1 -0
  245. package/{dist → lib/cjs}/context/ItemContext.d.ts +13 -13
  246. package/lib/cjs/context/ItemContext.js +1 -0
  247. package/lib/cjs/context/LineItemChildrenContext.d.ts +9 -0
  248. package/lib/cjs/context/LineItemChildrenContext.js +1 -0
  249. package/{dist → lib/cjs}/context/LineItemContext.d.ts +8 -8
  250. package/lib/cjs/context/LineItemContext.js +1 -0
  251. package/{dist → lib/cjs}/context/LineItemOptionChildrenContext.d.ts +8 -8
  252. package/lib/cjs/context/LineItemOptionChildrenContext.js +1 -0
  253. package/lib/cjs/context/OrderContext.d.ts +26 -0
  254. package/lib/cjs/context/OrderContext.js +1 -0
  255. package/{dist → lib/cjs}/context/OrderStorageContext.d.ts +11 -11
  256. package/lib/cjs/context/OrderStorageContext.js +1 -0
  257. package/{dist → lib/cjs}/context/PaymentMethodChildrenContext.d.ts +10 -10
  258. package/lib/cjs/context/PaymentMethodChildrenContext.js +1 -0
  259. package/{dist → lib/cjs}/context/PaymentMethodContext.d.ts +23 -23
  260. package/lib/cjs/context/PaymentMethodContext.js +1 -0
  261. package/{dist → lib/cjs}/context/PaymentSourceContext.d.ts +14 -14
  262. package/lib/cjs/context/PaymentSourceContext.js +1 -0
  263. package/{dist → lib/cjs}/context/PlaceOrderContext.d.ts +16 -16
  264. package/lib/cjs/context/PlaceOrderContext.js +1 -0
  265. package/{dist → lib/cjs}/context/PricesContext.d.ts +7 -7
  266. package/lib/cjs/context/PricesContext.js +1 -0
  267. package/lib/cjs/context/ShipmentChildrenContext.d.ts +13 -0
  268. package/lib/cjs/context/ShipmentChildrenContext.js +1 -0
  269. package/{dist → lib/cjs}/context/ShipmentContext.d.ts +12 -12
  270. package/lib/cjs/context/ShipmentContext.js +1 -0
  271. package/{dist → lib/cjs}/context/ShippingAddressContext.d.ts +10 -10
  272. package/lib/cjs/context/ShippingAddressContext.js +1 -0
  273. package/{dist → lib/cjs}/context/ShippingAddressFormContext.d.ts +4 -4
  274. package/lib/cjs/context/ShippingAddressFormContext.js +1 -0
  275. package/lib/cjs/context/ShippingMethodChildrenContext.d.ts +10 -0
  276. package/lib/cjs/context/ShippingMethodChildrenContext.js +1 -0
  277. package/lib/cjs/context/SkuListsContext.d.ts +6 -0
  278. package/lib/cjs/context/SkuListsContext.js +1 -0
  279. package/{dist → lib/cjs}/context/SkuOptionChildrenContext.d.ts +8 -8
  280. package/lib/cjs/context/SkuOptionChildrenContext.js +1 -0
  281. package/{dist → lib/cjs}/context/SkuOptionsContext.d.ts +3 -3
  282. package/lib/cjs/context/SkuOptionsContext.js +1 -0
  283. package/{dist → lib/cjs}/context/StockTransferChildrenContext.d.ts +7 -7
  284. package/lib/cjs/context/StockTransferChildrenContext.js +1 -0
  285. package/{dist → lib/cjs}/context/VariantsContext.d.ts +3 -3
  286. package/lib/cjs/context/VariantsContext.js +1 -0
  287. package/lib/cjs/index.d.ts +90 -0
  288. package/lib/cjs/index.js +1 -0
  289. package/{dist → lib/cjs}/reducers/AddressReducer.d.ts +58 -57
  290. package/lib/cjs/reducers/AddressReducer.js +1 -0
  291. package/lib/cjs/reducers/AvailabilityReducer.d.ts +53 -0
  292. package/lib/cjs/reducers/AvailabilityReducer.js +1 -0
  293. package/{dist → lib/cjs}/reducers/BillingAddressReducer.d.ts +31 -32
  294. package/lib/cjs/reducers/BillingAddressReducer.js +1 -0
  295. package/{dist → lib/cjs}/reducers/CustomerReducer.d.ts +50 -51
  296. package/lib/cjs/reducers/CustomerReducer.js +1 -0
  297. package/{dist → lib/cjs}/reducers/GiftCardReducer.d.ts +76 -75
  298. package/lib/cjs/reducers/GiftCardReducer.js +1 -0
  299. package/{dist → lib/cjs}/reducers/ItemReducer.d.ts +69 -68
  300. package/lib/cjs/reducers/ItemReducer.js +1 -0
  301. package/{dist → lib/cjs}/reducers/LineItemReducer.d.ts +52 -52
  302. package/lib/cjs/reducers/LineItemReducer.js +1 -0
  303. package/lib/cjs/reducers/OrderReducer.d.ts +127 -0
  304. package/lib/cjs/reducers/OrderReducer.js +1 -0
  305. package/{dist → lib/cjs}/reducers/PaymentMethodReducer.d.ts +105 -106
  306. package/lib/cjs/reducers/PaymentMethodReducer.js +1 -0
  307. package/{dist → lib/cjs}/reducers/PlaceOrderReducer.d.ts +48 -50
  308. package/lib/cjs/reducers/PlaceOrderReducer.js +1 -0
  309. package/{dist → lib/cjs}/reducers/PriceReducer.d.ts +44 -45
  310. package/lib/cjs/reducers/PriceReducer.js +1 -0
  311. package/{dist → lib/cjs}/reducers/ShipmentReducer.d.ts +40 -37
  312. package/lib/cjs/reducers/ShipmentReducer.js +1 -0
  313. package/{dist → lib/cjs}/reducers/ShippingAddressReducer.d.ts +32 -31
  314. package/lib/cjs/reducers/ShippingAddressReducer.js +1 -0
  315. package/{dist → lib/cjs}/reducers/SkuListsReducer.d.ts +21 -22
  316. package/lib/cjs/reducers/SkuListsReducer.js +1 -0
  317. package/{dist → lib/cjs}/reducers/SkuOptionsReducer.d.ts +26 -26
  318. package/lib/cjs/reducers/SkuOptionsReducer.js +1 -0
  319. package/{dist → lib/cjs}/reducers/VariantReducer.d.ts +71 -71
  320. package/lib/cjs/reducers/VariantReducer.js +1 -0
  321. package/{dist → lib/cjs}/typings/errors.d.ts +42 -40
  322. package/lib/cjs/typings/errors.js +1 -0
  323. package/{dist → lib/cjs}/typings/index.d.ts +126 -126
  324. package/lib/cjs/typings/index.js +1 -0
  325. package/lib/cjs/utils/PropsType.d.ts +33 -0
  326. package/lib/cjs/utils/PropsType.js +1 -0
  327. package/{dist → lib/cjs}/utils/addressesManager.d.ts +28 -27
  328. package/lib/cjs/utils/addressesManager.js +1 -0
  329. package/{dist → lib/cjs}/utils/baseReducer.d.ts +3 -3
  330. package/lib/cjs/utils/baseReducer.js +1 -0
  331. package/{dist → lib/cjs}/utils/browserInfo.d.ts +9 -9
  332. package/lib/cjs/utils/browserInfo.js +1 -0
  333. package/{dist → lib/cjs}/utils/childrenTypes.d.ts +9 -9
  334. package/lib/cjs/utils/childrenTypes.js +1 -0
  335. package/{dist → lib/cjs}/utils/countryStateCity.d.ts +9 -9
  336. package/lib/cjs/utils/countryStateCity.js +1 -0
  337. package/{dist → lib/cjs}/utils/customMessages.d.ts +8 -8
  338. package/lib/cjs/utils/customMessages.js +1 -0
  339. package/lib/cjs/utils/customerOrderOptions.d.ts +3 -0
  340. package/lib/cjs/utils/customerOrderOptions.js +1 -0
  341. package/{dist → lib/cjs}/utils/getAmount.d.ts +9 -9
  342. package/lib/cjs/utils/getAmount.js +1 -0
  343. package/{dist → lib/cjs}/utils/getCurrentItemKey.d.ts +6 -6
  344. package/lib/cjs/utils/getCurrentItemKey.js +1 -0
  345. package/lib/cjs/utils/getErrors.d.ts +11 -0
  346. package/lib/cjs/utils/getErrors.js +1 -0
  347. package/{dist → lib/cjs}/utils/getLineItemsCount.d.ts +6 -6
  348. package/lib/cjs/utils/getLineItemsCount.js +1 -0
  349. package/{dist → lib/cjs}/utils/getLoaderComponent.d.ts +3 -3
  350. package/lib/cjs/utils/getLoaderComponent.js +1 -0
  351. package/lib/cjs/utils/getPrices.d.ts +17 -0
  352. package/lib/cjs/utils/getPrices.js +1 -0
  353. package/lib/cjs/utils/getSdk.d.ts +3 -0
  354. package/lib/cjs/utils/getSdk.js +1 -0
  355. package/lib/cjs/utils/getSkus.d.ts +3 -0
  356. package/lib/cjs/utils/getSkus.js +1 -0
  357. package/{dist → lib/cjs}/utils/isEmptyStates.d.ts +1 -1
  358. package/lib/cjs/utils/isEmptyStates.js +1 -0
  359. package/{dist → lib/cjs}/utils/isJSON.d.ts +1 -1
  360. package/lib/cjs/utils/isJSON.js +1 -0
  361. package/lib/cjs/utils/jwt.d.ts +27 -0
  362. package/lib/cjs/utils/jwt.js +1 -0
  363. package/{dist → lib/cjs}/utils/localStorage.d.ts +18 -18
  364. package/lib/cjs/utils/localStorage.js +1 -0
  365. package/lib/cjs/utils/organization.d.ts +6 -0
  366. package/lib/cjs/utils/organization.js +1 -0
  367. package/lib/cjs/utils/paypalPayment.d.ts +3 -0
  368. package/lib/cjs/utils/paypalPayment.js +1 -0
  369. package/{dist → lib/cjs}/utils/promisify.d.ts +1 -1
  370. package/lib/cjs/utils/promisify.js +1 -0
  371. package/lib/cjs/utils/shipments.d.ts +2 -0
  372. package/lib/cjs/utils/shipments.js +1 -0
  373. package/{dist → lib/cjs}/utils/validateFormFields.d.ts +20 -19
  374. package/lib/cjs/utils/validateFormFields.js +1 -0
  375. package/lib/esm/components/AddToCartButton.d.ts +20 -0
  376. package/lib/esm/components/AddToCartButton.js +1 -0
  377. package/lib/esm/components/Address.d.ts +13 -0
  378. package/lib/esm/components/Address.js +1 -0
  379. package/lib/esm/components/AddressCountrySelector.d.ts +9 -0
  380. package/lib/esm/components/AddressCountrySelector.js +1 -0
  381. package/lib/esm/components/AddressField.d.ts +15 -0
  382. package/lib/esm/components/AddressField.js +1 -0
  383. package/lib/esm/components/AddressInput.d.ts +7 -0
  384. package/lib/esm/components/AddressInput.js +1 -0
  385. package/lib/esm/components/AddressStateSelector.d.ts +11 -0
  386. package/lib/esm/components/AddressStateSelector.js +1 -0
  387. package/lib/esm/components/AddressesContainer.d.ts +7 -0
  388. package/lib/esm/components/AddressesContainer.js +1 -0
  389. package/lib/esm/components/AdyenPayment.d.ts +25 -0
  390. package/lib/esm/components/AdyenPayment.js +1 -0
  391. package/lib/esm/components/AvailabilityContainer.d.ts +7 -0
  392. package/lib/esm/components/AvailabilityContainer.js +1 -0
  393. package/lib/esm/components/AvailabilityTemplate.d.ts +13 -0
  394. package/lib/esm/components/AvailabilityTemplate.js +1 -0
  395. package/lib/esm/components/BillingAddressContainer.d.ts +6 -0
  396. package/lib/esm/components/BillingAddressContainer.js +1 -0
  397. package/lib/esm/components/BillingAddressForm.d.ts +8 -0
  398. package/lib/esm/components/BillingAddressForm.js +1 -0
  399. package/lib/esm/components/BraintreePayment.d.ts +30 -0
  400. package/lib/esm/components/BraintreePayment.js +1 -0
  401. package/lib/esm/components/CheckoutLink.d.ts +11 -0
  402. package/lib/esm/components/CheckoutLink.js +1 -0
  403. package/lib/esm/components/CommerceLayer.d.ts +8 -0
  404. package/lib/esm/components/CommerceLayer.js +1 -0
  405. package/lib/esm/components/CustomerContainer.d.ts +7 -0
  406. package/lib/esm/components/CustomerContainer.js +1 -0
  407. package/lib/esm/components/CustomerInput.d.ts +11 -0
  408. package/lib/esm/components/CustomerInput.js +1 -0
  409. package/lib/esm/components/DeliveryLeadTime.d.ts +10 -0
  410. package/lib/esm/components/DeliveryLeadTime.js +1 -0
  411. package/lib/esm/components/DiscountAmount.d.ts +4 -0
  412. package/lib/esm/components/DiscountAmount.js +1 -0
  413. package/lib/esm/components/Errors.d.ts +5 -0
  414. package/lib/esm/components/Errors.js +1 -0
  415. package/lib/esm/components/ExternalFunction.d.ts +7 -0
  416. package/lib/esm/components/ExternalFunction.js +1 -0
  417. package/lib/esm/components/GiftCard.d.ts +8 -0
  418. package/lib/esm/components/GiftCard.js +1 -0
  419. package/lib/esm/components/GiftCardAmount.d.ts +4 -0
  420. package/lib/esm/components/GiftCardAmount.js +1 -0
  421. package/lib/esm/components/GiftCardContainer.d.ts +6 -0
  422. package/lib/esm/components/GiftCardContainer.js +1 -0
  423. package/lib/esm/components/GiftCardCurrencySelector.d.ts +7 -0
  424. package/lib/esm/components/GiftCardCurrencySelector.js +1 -0
  425. package/lib/esm/components/GiftCardInput.d.ts +7 -0
  426. package/lib/esm/components/GiftCardInput.js +1 -0
  427. package/lib/esm/components/GiftCardOrCouponCode.d.ts +13 -0
  428. package/lib/esm/components/GiftCardOrCouponCode.js +1 -0
  429. package/lib/esm/components/GiftCardOrCouponForm.d.ts +10 -0
  430. package/lib/esm/components/GiftCardOrCouponForm.js +1 -0
  431. package/lib/esm/components/GiftCardOrCouponInput.d.ts +8 -0
  432. package/lib/esm/components/GiftCardOrCouponInput.js +1 -0
  433. package/lib/esm/components/GiftCardOrCouponRemoveButton.d.ts +16 -0
  434. package/lib/esm/components/GiftCardOrCouponRemoveButton.js +1 -0
  435. package/lib/esm/components/GiftCardOrCouponSubmit.d.ts +9 -0
  436. package/lib/esm/components/GiftCardOrCouponSubmit.js +1 -0
  437. package/lib/esm/components/GiftCardRecipient.d.ts +0 -0
  438. package/lib/esm/components/GiftCardRecipient.js +1 -0
  439. package/lib/esm/components/GiftCardRecipientInput.d.ts +0 -0
  440. package/lib/esm/components/GiftCardRecipientInput.js +1 -0
  441. package/lib/esm/components/ItemContainer.d.ts +11 -0
  442. package/lib/esm/components/ItemContainer.js +1 -0
  443. package/lib/esm/components/LineItem.d.ts +8 -0
  444. package/lib/esm/components/LineItem.js +1 -0
  445. package/lib/esm/components/LineItemAmount.d.ts +7 -0
  446. package/lib/esm/components/LineItemAmount.js +1 -0
  447. package/lib/esm/components/LineItemCode.d.ts +8 -0
  448. package/lib/esm/components/LineItemCode.js +1 -0
  449. package/lib/esm/components/LineItemImage.d.ts +10 -0
  450. package/lib/esm/components/LineItemImage.js +1 -0
  451. package/lib/esm/components/LineItemName.d.ts +9 -0
  452. package/lib/esm/components/LineItemName.js +1 -0
  453. package/lib/esm/components/LineItemOption.d.ts +19 -0
  454. package/lib/esm/components/LineItemOption.js +1 -0
  455. package/lib/esm/components/LineItemOptions.d.ts +14 -0
  456. package/lib/esm/components/LineItemOptions.js +1 -0
  457. package/lib/esm/components/LineItemQuantity.d.ts +14 -0
  458. package/lib/esm/components/LineItemQuantity.js +1 -0
  459. package/lib/esm/components/LineItemRemoveLink.d.ts +12 -0
  460. package/lib/esm/components/LineItemRemoveLink.js +1 -0
  461. package/lib/esm/components/LineItemsContainer.d.ts +8 -0
  462. package/lib/esm/components/LineItemsContainer.js +1 -0
  463. package/lib/esm/components/LineItemsCount.d.ts +10 -0
  464. package/lib/esm/components/LineItemsCount.js +1 -0
  465. package/lib/esm/components/MetadataInput.d.ts +5 -0
  466. package/lib/esm/components/MetadataInput.js +1 -0
  467. package/lib/esm/components/OrderContainer.d.ts +11 -0
  468. package/lib/esm/components/OrderContainer.js +1 -0
  469. package/lib/esm/components/OrderNumber.d.ts +5 -0
  470. package/lib/esm/components/OrderNumber.js +1 -0
  471. package/lib/esm/components/OrderStorage.d.ts +8 -0
  472. package/lib/esm/components/OrderStorage.js +1 -0
  473. package/lib/esm/components/PaymentGateway.d.ts +16 -0
  474. package/lib/esm/components/PaymentGateway.js +1 -0
  475. package/lib/esm/components/PaymentMethod.d.ts +16 -0
  476. package/lib/esm/components/PaymentMethod.js +1 -0
  477. package/lib/esm/components/PaymentMethodAmount.d.ts +4 -0
  478. package/lib/esm/components/PaymentMethodAmount.js +1 -0
  479. package/lib/esm/components/PaymentMethodName.d.ts +9 -0
  480. package/lib/esm/components/PaymentMethodName.js +1 -0
  481. package/lib/esm/components/PaymentMethodPrice.d.ts +9 -0
  482. package/lib/esm/components/PaymentMethodPrice.js +1 -0
  483. package/lib/esm/components/PaymentMethodRadioButton.d.ts +11 -0
  484. package/lib/esm/components/PaymentMethodRadioButton.js +1 -0
  485. package/lib/esm/components/PaymentMethodsContainer.d.ts +8 -0
  486. package/lib/esm/components/PaymentMethodsContainer.js +1 -0
  487. package/lib/esm/components/PaymentSource.d.ts +19 -0
  488. package/lib/esm/components/PaymentSource.js +1 -0
  489. package/lib/esm/components/PaymentSourceBrandIcon.d.ts +15 -0
  490. package/lib/esm/components/PaymentSourceBrandIcon.js +1 -0
  491. package/lib/esm/components/PaymentSourceBrandName.d.ts +12 -0
  492. package/lib/esm/components/PaymentSourceBrandName.js +1 -0
  493. package/lib/esm/components/PaymentSourceDetail.d.ts +12 -0
  494. package/lib/esm/components/PaymentSourceDetail.js +1 -0
  495. package/lib/esm/components/PaymentSourceEditButton.d.ts +9 -0
  496. package/lib/esm/components/PaymentSourceEditButton.js +1 -0
  497. package/lib/esm/components/PaypalPayment.d.ts +12 -0
  498. package/lib/esm/components/PaypalPayment.js +1 -0
  499. package/lib/esm/components/PlaceOrderButton.d.ts +12 -0
  500. package/lib/esm/components/PlaceOrderButton.js +1 -0
  501. package/lib/esm/components/PlaceOrderContainer.d.ts +8 -0
  502. package/lib/esm/components/PlaceOrderContainer.js +1 -0
  503. package/lib/esm/components/Price.d.ts +14 -0
  504. package/lib/esm/components/Price.js +1 -0
  505. package/lib/esm/components/PricesContainer.d.ts +11 -0
  506. package/lib/esm/components/PricesContainer.js +1 -0
  507. package/lib/esm/components/PrivacyAndTermsCheckbox.d.ts +4 -0
  508. package/lib/esm/components/PrivacyAndTermsCheckbox.js +1 -0
  509. package/lib/esm/components/QuantitySelector.d.ts +17 -0
  510. package/lib/esm/components/QuantitySelector.js +1 -0
  511. package/lib/esm/components/SaveAddressesButton.d.ts +10 -0
  512. package/lib/esm/components/SaveAddressesButton.js +1 -0
  513. package/lib/esm/components/SaveCustomerButton.d.ts +13 -0
  514. package/lib/esm/components/SaveCustomerButton.js +1 -0
  515. package/lib/esm/components/Shipment.d.ts +8 -0
  516. package/lib/esm/components/Shipment.js +1 -0
  517. package/lib/esm/components/ShipmentField.d.ts +12 -0
  518. package/lib/esm/components/ShipmentField.js +1 -0
  519. package/lib/esm/components/ShipmentsContainer.d.ts +6 -0
  520. package/lib/esm/components/ShipmentsContainer.js +1 -0
  521. package/lib/esm/components/ShippingAddressContainer.d.ts +6 -0
  522. package/lib/esm/components/ShippingAddressContainer.js +1 -0
  523. package/lib/esm/components/ShippingAddressForm.d.ts +8 -0
  524. package/lib/esm/components/ShippingAddressForm.js +1 -0
  525. package/lib/esm/components/ShippingAmount.d.ts +4 -0
  526. package/lib/esm/components/ShippingAmount.js +1 -0
  527. package/lib/esm/components/ShippingMethod.d.ts +8 -0
  528. package/lib/esm/components/ShippingMethod.js +1 -0
  529. package/lib/esm/components/ShippingMethodName.d.ts +11 -0
  530. package/lib/esm/components/ShippingMethodName.js +1 -0
  531. package/lib/esm/components/ShippingMethodPrice.d.ts +13 -0
  532. package/lib/esm/components/ShippingMethodPrice.js +1 -0
  533. package/lib/esm/components/ShippingMethodRadioButton.d.ts +9 -0
  534. package/lib/esm/components/ShippingMethodRadioButton.js +1 -0
  535. package/lib/esm/components/SkuList.d.ts +7 -0
  536. package/lib/esm/components/SkuList.js +1 -0
  537. package/lib/esm/components/SkuListsContainer.d.ts +6 -0
  538. package/lib/esm/components/SkuListsContainer.js +1 -0
  539. package/lib/esm/components/SkuOption.d.ts +7 -0
  540. package/lib/esm/components/SkuOption.js +1 -0
  541. package/lib/esm/components/SkuOptionInput.d.ts +5 -0
  542. package/lib/esm/components/SkuOptionInput.js +1 -0
  543. package/lib/esm/components/SkuOptionsContainer.d.ts +7 -0
  544. package/lib/esm/components/SkuOptionsContainer.js +1 -0
  545. package/lib/esm/components/StockTransfer.d.ts +6 -0
  546. package/lib/esm/components/StockTransfer.js +1 -0
  547. package/lib/esm/components/StockTransferField.d.ts +9 -0
  548. package/lib/esm/components/StockTransferField.js +1 -0
  549. package/lib/esm/components/StripePayment.d.ts +18 -0
  550. package/lib/esm/components/StripePayment.js +1 -0
  551. package/lib/esm/components/SubTotalAmount.d.ts +4 -0
  552. package/lib/esm/components/SubTotalAmount.js +1 -0
  553. package/lib/esm/components/SubmitButton.d.ts +9 -0
  554. package/lib/esm/components/SubmitButton.js +1 -0
  555. package/lib/esm/components/TaxesAmount.d.ts +4 -0
  556. package/lib/esm/components/TaxesAmount.js +1 -0
  557. package/lib/esm/components/TotalAmount.d.ts +4 -0
  558. package/lib/esm/components/TotalAmount.js +1 -0
  559. package/lib/esm/components/VariantSelector.d.ts +29 -0
  560. package/lib/esm/components/VariantSelector.js +1 -0
  561. package/lib/esm/components/VariantsContainer.d.ts +8 -0
  562. package/lib/esm/components/VariantsContainer.js +1 -0
  563. package/lib/esm/components/WireTransferPayment.d.ts +10 -0
  564. package/lib/esm/components/WireTransferPayment.js +1 -0
  565. package/lib/esm/components/gateways/AdyenGateway.d.ts +5 -0
  566. package/lib/esm/components/gateways/AdyenGateway.js +1 -0
  567. package/lib/esm/components/gateways/BraintreeGateway.d.ts +5 -0
  568. package/lib/esm/components/gateways/BraintreeGateway.js +1 -0
  569. package/lib/esm/components/gateways/PaypalGateway.d.ts +5 -0
  570. package/lib/esm/components/gateways/PaypalGateway.js +1 -0
  571. package/lib/esm/components/gateways/StripeGateway.d.ts +5 -0
  572. package/lib/esm/components/gateways/StripeGateway.js +1 -0
  573. package/lib/esm/components/gateways/WireTransferGateway.d.ts +5 -0
  574. package/lib/esm/components/gateways/WireTransferGateway.js +1 -0
  575. package/lib/esm/components/utils/AddressCardsTemplate.d.ts +27 -0
  576. package/lib/esm/components/utils/AddressCardsTemplate.js +1 -0
  577. package/lib/esm/components/utils/BaseField.d.ts +8 -0
  578. package/lib/esm/components/utils/BaseField.js +1 -0
  579. package/lib/esm/components/utils/BaseInput.d.ts +5 -0
  580. package/lib/esm/components/utils/BaseInput.js +1 -0
  581. package/lib/esm/components/utils/BaseOrderPrice.d.ts +6 -0
  582. package/lib/esm/components/utils/BaseOrderPrice.js +1 -0
  583. package/lib/esm/components/utils/BaseSelect.d.ts +5 -0
  584. package/lib/esm/components/utils/BaseSelect.js +1 -0
  585. package/lib/esm/components/utils/Parent.d.ts +8 -0
  586. package/lib/esm/components/utils/Parent.js +1 -0
  587. package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +23 -0
  588. package/lib/esm/components/utils/PaymentCardsTemplate.js +1 -0
  589. package/lib/esm/components/utils/PriceTemplate.d.ts +8 -0
  590. package/lib/esm/components/utils/PriceTemplate.js +1 -0
  591. package/lib/esm/components/utils/VariantTemplate.d.ts +36 -0
  592. package/lib/esm/components/utils/VariantTemplate.js +1 -0
  593. package/lib/esm/components/utils/getAllErrors.d.ts +17 -0
  594. package/lib/esm/components/utils/getAllErrors.js +1 -0
  595. package/lib/esm/config/components.d.ts +867 -0
  596. package/lib/esm/config/components.js +1 -0
  597. package/lib/esm/config/currency.d.ts +5 -0
  598. package/lib/esm/config/currency.js +1 -0
  599. package/lib/esm/context/AddressChildrenContext.d.ts +7 -0
  600. package/lib/esm/context/AddressChildrenContext.js +1 -0
  601. package/lib/esm/context/AddressContext.d.ts +17 -0
  602. package/lib/esm/context/AddressContext.js +1 -0
  603. package/lib/esm/context/AvailabilityContext.d.ts +3 -0
  604. package/lib/esm/context/AvailabilityContext.js +1 -0
  605. package/lib/esm/context/BillingAddressContext.d.ts +12 -0
  606. package/lib/esm/context/BillingAddressContext.js +1 -0
  607. package/lib/esm/context/BillingAddressFormContext.d.ts +18 -0
  608. package/lib/esm/context/BillingAddressFormContext.js +1 -0
  609. package/lib/esm/context/CommerceLayerContext.d.ts +7 -0
  610. package/lib/esm/context/CommerceLayerContext.js +1 -0
  611. package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +7 -0
  612. package/lib/esm/context/CouponAndGiftCardFormContext.js +1 -0
  613. package/lib/esm/context/CustomerContext.d.ts +16 -0
  614. package/lib/esm/context/CustomerContext.js +1 -0
  615. package/lib/esm/context/ExternalFunctionContext.d.ts +12 -0
  616. package/lib/esm/context/ExternalFunctionContext.js +1 -0
  617. package/lib/esm/context/GiftCardContext.d.ts +11 -0
  618. package/lib/esm/context/GiftCardContext.js +1 -0
  619. package/lib/esm/context/ItemContext.d.ts +13 -0
  620. package/lib/esm/context/ItemContext.js +1 -0
  621. package/lib/esm/context/LineItemChildrenContext.d.ts +9 -0
  622. package/lib/esm/context/LineItemChildrenContext.js +1 -0
  623. package/lib/esm/context/LineItemContext.d.ts +8 -0
  624. package/lib/esm/context/LineItemContext.js +1 -0
  625. package/lib/esm/context/LineItemOptionChildrenContext.d.ts +8 -0
  626. package/lib/esm/context/LineItemOptionChildrenContext.js +1 -0
  627. package/lib/esm/context/OrderContext.d.ts +26 -0
  628. package/lib/esm/context/OrderContext.js +1 -0
  629. package/lib/esm/context/OrderStorageContext.d.ts +11 -0
  630. package/lib/esm/context/OrderStorageContext.js +1 -0
  631. package/lib/esm/context/PaymentMethodChildrenContext.d.ts +10 -0
  632. package/lib/esm/context/PaymentMethodChildrenContext.js +1 -0
  633. package/lib/esm/context/PaymentMethodContext.d.ts +23 -0
  634. package/lib/esm/context/PaymentMethodContext.js +1 -0
  635. package/lib/esm/context/PaymentSourceContext.d.ts +14 -0
  636. package/lib/esm/context/PaymentSourceContext.js +1 -0
  637. package/lib/esm/context/PlaceOrderContext.d.ts +16 -0
  638. package/lib/esm/context/PlaceOrderContext.js +1 -0
  639. package/lib/esm/context/PricesContext.d.ts +7 -0
  640. package/lib/esm/context/PricesContext.js +1 -0
  641. package/lib/esm/context/ShipmentChildrenContext.d.ts +13 -0
  642. package/lib/esm/context/ShipmentChildrenContext.js +1 -0
  643. package/lib/esm/context/ShipmentContext.d.ts +12 -0
  644. package/lib/esm/context/ShipmentContext.js +1 -0
  645. package/lib/esm/context/ShippingAddressContext.d.ts +10 -0
  646. package/lib/esm/context/ShippingAddressContext.js +1 -0
  647. package/lib/esm/context/ShippingAddressFormContext.d.ts +4 -0
  648. package/lib/esm/context/ShippingAddressFormContext.js +1 -0
  649. package/lib/esm/context/ShippingMethodChildrenContext.d.ts +10 -0
  650. package/lib/esm/context/ShippingMethodChildrenContext.js +1 -0
  651. package/lib/esm/context/SkuListsContext.d.ts +6 -0
  652. package/lib/esm/context/SkuListsContext.js +1 -0
  653. package/lib/esm/context/SkuOptionChildrenContext.d.ts +8 -0
  654. package/lib/esm/context/SkuOptionChildrenContext.js +1 -0
  655. package/lib/esm/context/SkuOptionsContext.d.ts +3 -0
  656. package/lib/esm/context/SkuOptionsContext.js +1 -0
  657. package/lib/esm/context/StockTransferChildrenContext.d.ts +7 -0
  658. package/lib/esm/context/StockTransferChildrenContext.js +1 -0
  659. package/lib/esm/context/VariantsContext.d.ts +3 -0
  660. package/lib/esm/context/VariantsContext.js +1 -0
  661. package/lib/esm/index.d.ts +90 -0
  662. package/lib/esm/index.js +1 -0
  663. package/lib/esm/reducers/AddressReducer.d.ts +58 -0
  664. package/lib/esm/reducers/AddressReducer.js +1 -0
  665. package/lib/esm/reducers/AvailabilityReducer.d.ts +53 -0
  666. package/lib/esm/reducers/AvailabilityReducer.js +1 -0
  667. package/lib/esm/reducers/BillingAddressReducer.d.ts +31 -0
  668. package/lib/esm/reducers/BillingAddressReducer.js +1 -0
  669. package/lib/esm/reducers/CustomerReducer.d.ts +50 -0
  670. package/lib/esm/reducers/CustomerReducer.js +1 -0
  671. package/lib/esm/reducers/GiftCardReducer.d.ts +76 -0
  672. package/lib/esm/reducers/GiftCardReducer.js +1 -0
  673. package/lib/esm/reducers/ItemReducer.d.ts +69 -0
  674. package/lib/esm/reducers/ItemReducer.js +1 -0
  675. package/lib/esm/reducers/LineItemReducer.d.ts +52 -0
  676. package/lib/esm/reducers/LineItemReducer.js +1 -0
  677. package/lib/esm/reducers/OrderReducer.d.ts +127 -0
  678. package/lib/esm/reducers/OrderReducer.js +1 -0
  679. package/lib/esm/reducers/PaymentMethodReducer.d.ts +105 -0
  680. package/lib/esm/reducers/PaymentMethodReducer.js +1 -0
  681. package/lib/esm/reducers/PlaceOrderReducer.d.ts +48 -0
  682. package/lib/esm/reducers/PlaceOrderReducer.js +1 -0
  683. package/lib/esm/reducers/PriceReducer.d.ts +44 -0
  684. package/lib/esm/reducers/PriceReducer.js +1 -0
  685. package/lib/esm/reducers/ShipmentReducer.d.ts +40 -0
  686. package/lib/esm/reducers/ShipmentReducer.js +1 -0
  687. package/lib/esm/reducers/ShippingAddressReducer.d.ts +32 -0
  688. package/lib/esm/reducers/ShippingAddressReducer.js +1 -0
  689. package/lib/esm/reducers/SkuListsReducer.d.ts +21 -0
  690. package/lib/esm/reducers/SkuListsReducer.js +1 -0
  691. package/lib/esm/reducers/SkuOptionsReducer.d.ts +26 -0
  692. package/lib/esm/reducers/SkuOptionsReducer.js +1 -0
  693. package/lib/esm/reducers/VariantReducer.d.ts +71 -0
  694. package/lib/esm/reducers/VariantReducer.js +1 -0
  695. package/lib/esm/typings/errors.d.ts +42 -0
  696. package/lib/esm/typings/errors.js +1 -0
  697. package/lib/esm/typings/index.d.ts +126 -0
  698. package/lib/esm/typings/index.js +1 -0
  699. package/lib/esm/utils/PropsType.d.ts +33 -0
  700. package/lib/esm/utils/PropsType.js +1 -0
  701. package/lib/esm/utils/addressesManager.d.ts +28 -0
  702. package/lib/esm/utils/addressesManager.js +1 -0
  703. package/lib/esm/utils/baseReducer.d.ts +3 -0
  704. package/lib/esm/utils/baseReducer.js +1 -0
  705. package/lib/esm/utils/browserInfo.d.ts +9 -0
  706. package/lib/esm/utils/browserInfo.js +1 -0
  707. package/lib/esm/utils/childrenTypes.d.ts +9 -0
  708. package/lib/esm/utils/childrenTypes.js +1 -0
  709. package/lib/esm/utils/countryStateCity.d.ts +9 -0
  710. package/lib/esm/utils/countryStateCity.js +1 -0
  711. package/lib/esm/utils/customMessages.d.ts +8 -0
  712. package/lib/esm/utils/customMessages.js +1 -0
  713. package/lib/esm/utils/customerOrderOptions.d.ts +3 -0
  714. package/lib/esm/utils/customerOrderOptions.js +1 -0
  715. package/lib/esm/utils/getAmount.d.ts +9 -0
  716. package/lib/esm/utils/getAmount.js +1 -0
  717. package/lib/esm/utils/getCurrentItemKey.d.ts +6 -0
  718. package/lib/esm/utils/getCurrentItemKey.js +1 -0
  719. package/lib/esm/utils/getErrors.d.ts +11 -0
  720. package/lib/esm/utils/getErrors.js +1 -0
  721. package/lib/esm/utils/getLineItemsCount.d.ts +6 -0
  722. package/lib/esm/utils/getLineItemsCount.js +1 -0
  723. package/lib/esm/utils/getLoaderComponent.d.ts +3 -0
  724. package/lib/esm/utils/getLoaderComponent.js +1 -0
  725. package/lib/esm/utils/getPrices.d.ts +17 -0
  726. package/lib/esm/utils/getPrices.js +1 -0
  727. package/lib/esm/utils/getSdk.d.ts +3 -0
  728. package/lib/esm/utils/getSdk.js +1 -0
  729. package/lib/esm/utils/getSkus.d.ts +3 -0
  730. package/lib/esm/utils/getSkus.js +1 -0
  731. package/lib/esm/utils/isEmptyStates.d.ts +1 -0
  732. package/lib/esm/utils/isEmptyStates.js +1 -0
  733. package/lib/esm/utils/isJSON.d.ts +1 -0
  734. package/lib/esm/utils/isJSON.js +1 -0
  735. package/lib/esm/utils/jwt.d.ts +27 -0
  736. package/lib/esm/utils/jwt.js +1 -0
  737. package/lib/esm/utils/localStorage.d.ts +18 -0
  738. package/lib/esm/utils/localStorage.js +1 -0
  739. package/lib/esm/utils/organization.d.ts +6 -0
  740. package/lib/esm/utils/organization.js +1 -0
  741. package/lib/esm/utils/paypalPayment.d.ts +3 -0
  742. package/lib/esm/utils/paypalPayment.js +1 -0
  743. package/lib/esm/utils/promisify.d.ts +1 -0
  744. package/lib/esm/utils/promisify.js +1 -0
  745. package/lib/esm/utils/shipments.d.ts +2 -0
  746. package/lib/esm/utils/shipments.js +1 -0
  747. package/lib/esm/utils/validateFormFields.d.ts +20 -0
  748. package/lib/esm/utils/validateFormFields.js +1 -0
  749. package/lib/tsconfig.prod.esm.tsbuildinfo +1 -0
  750. package/lib/tsconfig.prod.tsbuildinfo +1 -0
  751. package/package.json +71 -53
  752. package/dist/components/utils/BaseInput.d.ts +0 -5
  753. package/dist/context/LineItemChildrenContext.d.ts +0 -7
  754. package/dist/context/OrderContext.d.ts +0 -4
  755. package/dist/context/ShipmentChildrenContext.d.ts +0 -13
  756. package/dist/context/ShippingMethodChildrenContext.d.ts +0 -9
  757. package/dist/context/SkuListsContext.d.ts +0 -3
  758. package/dist/index.d.ts +0 -89
  759. package/dist/index.js +0 -8
  760. package/dist/react-components.cjs.development.js +0 -12876
  761. package/dist/react-components.cjs.development.js.map +0 -1
  762. package/dist/react-components.cjs.production.min.js +0 -2
  763. package/dist/react-components.cjs.production.min.js.map +0 -1
  764. package/dist/react-components.esm.js +0 -12782
  765. package/dist/react-components.esm.js.map +0 -1
  766. package/dist/reducers/AvailabilityReducer.d.ts +0 -40
  767. package/dist/reducers/OrderReducer.d.ts +0 -131
  768. package/dist/utils/PropsType.d.ts +0 -8
  769. package/dist/utils/customerOrderOptions.d.ts +0 -4
  770. package/dist/utils/dynamicNaming.d.ts +0 -5
  771. package/dist/utils/getErrorsByCollection.d.ts +0 -11
  772. package/dist/utils/getPrices.d.ts +0 -18
  773. package/dist/utils/getSkus.d.ts +0 -3
  774. package/dist/utils/paypalPayment.d.ts +0 -3
  775. package/dist/utils/shipments.d.ts +0 -5
@@ -0,0 +1,19 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { LoaderType } from '../typings/index';
3
+ import { CustomerCardsTemplateChildren } from './utils/PaymentCardsTemplate';
4
+ export declare type CustomerCardsProps = {
5
+ handleClick: () => void;
6
+ };
7
+ export declare type CustomerSaveToWalletProps = {
8
+ name: 'save_payment_source_to_customer_wallet';
9
+ };
10
+ export declare type PaymentSourceProps = {
11
+ children?: ReactNode;
12
+ readonly?: boolean;
13
+ templateCustomerCards?: CustomerCardsTemplateChildren;
14
+ onClickCustomerCards?: () => void;
15
+ templateCustomerSaveToWallet?: (props: CustomerSaveToWalletProps) => ReactNode;
16
+ loader?: LoaderType;
17
+ } & JSX.IntrinsicElements['div'];
18
+ declare const PaymentSource: FunctionComponent<PaymentSourceProps>;
19
+ export default PaymentSource;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useState,useEffect}from"react";import PaymentMethodChildrenContext from"../context/PaymentMethodChildrenContext";import components from"../config/components";import PaymentMethodContext from"../context/PaymentMethodContext";import isEmpty from"lodash/isEmpty";import CustomerContext from"../context/CustomerContext";import PaymentGateway from"./PaymentGateway";const propTypes=components.PaymentSource.propTypes;const displayName=components.PaymentSource.displayName;const PaymentSource=e=>{const{readonly:t}=e;const{payment:o}=useContext(PaymentMethodChildrenContext);const{payments:n}=useContext(CustomerContext);const{currentPaymentMethodId:a,paymentSource:s,destroyPaymentSource:d}=useContext(PaymentMethodContext);const[r,i]=useState(false);const[m,l]=useState(false);useEffect((()=>{var e,n,d,r,m,u,p;if(t){i(true);l(true)}else if((o===null||o===void 0?void 0:o.id)===a){i(true);console.log(`paymentSource`,s);const t=((e=s===null||s===void 0?void 0:s.options)===null||e===void 0?void 0:e.card)||((n=s===null||s===void 0?void 0:s.metadata)===null||n===void 0?void 0:n.card)||((r=(d=s===null||s===void 0?void 0:s.paymentRequestData)===null||d===void 0?void 0:d.paymentMethod)===null||r===void 0?void 0:r.brand)&&((m=s===null||s===void 0?void 0:s.paymentResponse)===null||m===void 0?void 0:m.resultCode)==="Authorised"&&{brand:(p=(u=s===null||s===void 0?void 0:s.paymentRequestData)===null||u===void 0?void 0:u.paymentMethod)===null||p===void 0?void 0:p.brand};if(!isEmpty(t))l(true)}else i(false);return()=>{i(false);l(false)}}),[a,s,n,o,t]);const u=e=>{e.stopPropagation();s&&d({paymentSourceId:s===null||s===void 0?void 0:s.id,paymentResource:o===null||o===void 0?void 0:o.payment_source_type});l(!m);i(true)};const p=Object.assign(Object.assign({},e),{show:r,showCard:m,handleEditClick:u,readonly:t});return _jsx(PaymentGateway,Object.assign({},p),void 0)};PaymentSource.propTypes=propTypes;PaymentSource.displayName=displayName;export default PaymentSource;
@@ -0,0 +1,15 @@
1
+ import { iconBrand } from '../context/PaymentSourceContext';
2
+ import { FunctionComponent } from 'react';
3
+ import { FunctionChildren } from '../typings/index';
4
+ declare type CustomComponent = FunctionChildren<Omit<Props & {
5
+ brand: iconBrand;
6
+ defaultSrc: string;
7
+ url: string;
8
+ }, 'children'>>;
9
+ declare type Props = {
10
+ children?: CustomComponent;
11
+ width?: number;
12
+ height?: number;
13
+ } & JSX.IntrinsicElements['img'];
14
+ declare const PaymentSourceBrandIcon: FunctionComponent<Props>;
15
+ export default PaymentSourceBrandIcon;
@@ -0,0 +1 @@
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaymentSourceContext from"../context/PaymentSourceContext";import{useContext,useRef}from"react";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.PaymentSourceBrandIcon.propTypes;const displayName=components.PaymentSourceBrandIcon.displayName;const PaymentSourceBrandIcon=e=>{var{src:r,width:t=32,children:o}=e,n=__rest(e,["src","width","children"]);const{brand:c}=useContext(PaymentSourceContext);const s=useRef(null);const a="//data.commercelayer.app/assets/images/icons/credit-cards/color/credit-card.svg";const m=r?r:`//data.commercelayer.app/assets/images/icons/credit-cards/color/${c}.svg`;const i=()=>{if(s.current)s.current.src=a};const d=Object.assign({brand:c,defaultSrc:a,url:m,width:t},n);return o?_jsx(Parent,Object.assign({},d,{children:o}),void 0):_jsx("img",Object.assign({ref:s,src:m,onError:i,width:t},n),void 0)};PaymentSourceBrandIcon.propTypes=propTypes;PaymentSourceBrandIcon.displayName=displayName;export default PaymentSourceBrandIcon;
@@ -0,0 +1,12 @@
1
+ import { iconBrand } from '../context/PaymentSourceContext';
2
+ import { FunctionComponent } from 'react';
3
+ import { FunctionChildren } from '../typings/index';
4
+ declare type CustomComponent = FunctionChildren<Omit<Props & {
5
+ brand: iconBrand;
6
+ }, 'children'>>;
7
+ declare type Props = {
8
+ children?: CustomComponent;
9
+ label?: string;
10
+ } & JSX.IntrinsicElements['span'];
11
+ declare const PaymentSourceBrandName: FunctionComponent<Props>;
12
+ export default PaymentSourceBrandName;
@@ -0,0 +1 @@
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaymentSourceContext from"../context/PaymentSourceContext";import{capitalize}from"lodash";import{useContext}from"react";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.PaymentSourceBrandName.propTypes;const displayName=components.PaymentSourceBrandName.displayName;const PaymentSourceBrandName=e=>{var{children:t,label:a}=e,o=__rest(e,["children","label"]);const{brand:r}=useContext(PaymentSourceContext);const n=r&&capitalize(r.replace("-"," "));const m=Object.assign({brand:n,label:a},o);return t?_jsx(Parent,Object.assign({},m,{children:t}),void 0):_jsx("span",Object.assign({},o,{children:a||capitalize(n)}),void 0)};PaymentSourceBrandName.propTypes=propTypes;PaymentSourceBrandName.displayName=displayName;export default PaymentSourceBrandName;
@@ -0,0 +1,12 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ export declare type PaymentSourceDetailType = 'last4' | 'expYear' | 'expMonth';
4
+ declare type CustomComponent = FunctionChildren<Omit<Props & {
5
+ text: string;
6
+ }, 'children'>>;
7
+ declare type Props = {
8
+ children?: CustomComponent;
9
+ type: PaymentSourceDetailType;
10
+ } & JSX.IntrinsicElements['span'];
11
+ declare const PaymentSourceDetail: FunctionComponent<Props>;
12
+ export default PaymentSourceDetail;
@@ -0,0 +1 @@
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import components from"../config/components";import PaymentSourceContext from"../context/PaymentSourceContext";import{has}from"lodash";import{useContext}from"react";import Parent from"./utils/Parent";const propTypes=components.PaymentSourceDetail.propTypes;const displayName=components.PaymentSourceDetail.displayName;const PaymentSourceDetail=e=>{var{type:t,children:o}=e,n=__rest(e,["type","children"]);const r=useContext(PaymentSourceContext);const s=has(r,t)?r[t]:t==="last4"?"****":"**";const a=Object.assign({type:t,text:s},n);return o?_jsx(Parent,Object.assign({},a,{children:o}),void 0):_jsx("span",Object.assign({},n,{children:s}),void 0)};PaymentSourceDetail.propTypes=propTypes;PaymentSourceDetail.displayName=displayName;export default PaymentSourceDetail;
@@ -0,0 +1,9 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ declare type CustomComponent = FunctionChildren<Omit<Props, 'children'>>;
4
+ declare type Props = {
5
+ children?: CustomComponent;
6
+ label?: string | ReactNode;
7
+ } & Omit<JSX.IntrinsicElements['button'], 'onClick'>;
8
+ declare const PaymentSourceEditButton: FunctionComponent<Props>;
9
+ export default PaymentSourceEditButton;
@@ -0,0 +1 @@
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaymentSourceContext from"../context/PaymentSourceContext";import{useContext}from"react";import Parent from"./utils/Parent";import components from"../config/components";const displayName=components.PaymentSourceEditButton.displayName;const propTypes=components.PaymentSourceEditButton.propTypes;const PaymentSourceEditButton=t=>{var{children:e,label:o="Edit"}=t,n=__rest(t,["children","label"]);const{showCard:r,handleEditClick:s,readonly:a}=useContext(PaymentSourceContext);const i=Object.assign({showCard:r,label:o,handleEditClick:s},n);return e?_jsx(Parent,Object.assign({},i,{children:e}),void 0):!a?_jsx("button",Object.assign({},n,{onClick:s},{children:o}),void 0):null};PaymentSourceEditButton.propTypes=propTypes;PaymentSourceEditButton.displayName=displayName;export default PaymentSourceEditButton;
@@ -0,0 +1,12 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ export declare type PaypalConfig = {
3
+ return_url: string;
4
+ cancel_url: string;
5
+ infoMessage?: {
6
+ text?: string | ReactNode;
7
+ className?: string;
8
+ };
9
+ };
10
+ declare type Props = Omit<PaypalConfig, 'return_url' | 'cancel_url'> & JSX.IntrinsicElements['div'];
11
+ declare const PaypalPayment: FunctionComponent<Props>;
12
+ export default PaypalPayment;
@@ -0,0 +1 @@
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaymentMethodContext from"../context/PaymentMethodContext";import isFunction from"lodash/isFunction";import{useContext,useEffect,useRef}from"react";const defaultMessage="by placing the order, you will be redirected to the PayPal website to sign in and authorize the payment";const PaypalPayment=e=>{var{infoMessage:t}=e,n=__rest(e,["infoMessage"]);const a=useRef(null);const{setPaymentSource:r,paymentSource:o,currentPaymentMethodType:s,setPaymentRef:i}=useContext(PaymentMethodContext);useEffect((()=>{if(a.current&&o&&s&&(o===null||o===void 0?void 0:o.approvalUrl)){a.current.onsubmit=()=>u();i({ref:a})}return()=>{i({ref:{current:null}})}}),[a,o,s]);const u=async()=>{if(o&&s){try{await r({paymentSourceId:o.id,paymentResource:s,attributes:{metadata:{card:{id:o.id,brand:"paypal",last4:""}}}});return true}catch(e){return false}}return false};return _jsx("form",Object.assign({ref:a},{children:_jsx("div",Object.assign({},n,{children:_jsx("span",Object.assign({className:t===null||t===void 0?void 0:t.className},{children:isFunction(t===null||t===void 0?void 0:t.text)?t===null||t===void 0?void 0:t.text():(t===null||t===void 0?void 0:t.text)||defaultMessage}),void 0)}),void 0)}),void 0)};export default PaypalPayment;
@@ -0,0 +1,12 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ declare type PlaceOrderButtonChildrenProps = FunctionChildren<Omit<PlaceOrderButtonProps, 'children'>>;
4
+ declare type PlaceOrderButtonProps = {
5
+ children?: PlaceOrderButtonChildrenProps;
6
+ label?: string | ReactNode;
7
+ onClick?: (response: {
8
+ placed: boolean;
9
+ }) => void;
10
+ } & JSX.IntrinsicElements['button'];
11
+ declare const PlaceOrderButton: FunctionComponent<PlaceOrderButtonProps>;
12
+ export default PlaceOrderButton;
@@ -0,0 +1 @@
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useEffect,useState}from"react";import Parent from"./utils/Parent";import components from"../config/components";import PlaceOrderContext from"../context/PlaceOrderContext";import isFunction from"lodash/isFunction";import PaymentMethodContext from"../context/PaymentMethodContext";import OrderContext from"../context/OrderContext";const propTypes=components.PlaceOrderButton.propTypes;const defaultProps=components.PlaceOrderButton.defaultProps;const displayName=components.PlaceOrderButton.displayName;const PlaceOrderButton=t=>{var e;const{children:o,label:n="Place order",disabled:r,onClick:i}=t,d=__rest(t,["children","label","disabled","onClick"]);const{isPermitted:l,setPlaceOrder:s,options:a,paymentType:u}=useContext(PlaceOrderContext);const[c,p]=useState(true);const[m,v]=useState(r);const{currentPaymentMethodRef:f,paymentSource:y,loading:P,currentPaymentMethodType:x}=useContext(PaymentMethodContext);const{order:O}=useContext(OrderContext);useEffect((()=>{var t,e,o,n,r;if(P)p(P);else{if(u===x){if(((O===null||O===void 0?void 0:O.total_amount_with_taxes_cents)===0||((t=f===null||f===void 0?void 0:f.current)===null||t===void 0?void 0:t.onsubmit)||((o=(e=y===null||y===void 0?void 0:y.metadata)===null||e===void 0?void 0:e.card)===null||o===void 0?void 0:o.id)||((n=y===null||y===void 0?void 0:y.options)===null||n===void 0?void 0:n.id)||((r=y===null||y===void 0?void 0:y.payment_response)===null||r===void 0?void 0:r.resultCode)==="Authorised")&&l){p(false)}}else{p(true)}}if(u==="paypal_payments"&&(a===null||a===void 0?void 0:a.paypalPayerId)){b()}return()=>{p(true)}}),[l,a===null||a===void 0?void 0:a.paypalPayerId,u,(e=f===null||f===void 0?void 0:f.current)===null||e===void 0?void 0:e.onsubmit,y,P,x,O]);const b=async()=>{var t,e,o;let n=true;v(true);if(((t=f===null||f===void 0?void 0:f.current)===null||t===void 0?void 0:t.onsubmit)&&!(a===null||a===void 0?void 0:a.paypalPayerId)){n=await((e=f.current)===null||e===void 0?void 0:e.onsubmit())}else if((o=y===null||y===void 0?void 0:y.options)===null||o===void 0?void 0:o.id){n=true}const r=n&&s&&await s({paymentSource:y});v(false);i&&r&&i(r)};const C=r!==undefined?r:c;const h=Object.assign(Object.assign({},d),{label:n,disabled:C,handleClick:b});return o?_jsx(Parent,Object.assign({},h,{children:o}),void 0):_jsx("button",Object.assign({type:"button",disabled:C||m,onClick:b},d,{children:isFunction(n)?n():n}),void 0)};PlaceOrderButton.propTypes=propTypes;PlaceOrderButton.defaultProps=defaultProps;PlaceOrderButton.displayName=displayName;export default PlaceOrderButton;
@@ -0,0 +1,8 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { PlaceOrderOptions } from '../reducers/PlaceOrderReducer';
3
+ declare type PlaceOrderContainerProps = {
4
+ children: ReactNode;
5
+ options?: PlaceOrderOptions;
6
+ };
7
+ declare const PlaceOrderContainer: FunctionComponent<PlaceOrderContainerProps>;
8
+ export default PlaceOrderContainer;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import PlaceOrderContext from"../context/PlaceOrderContext";import{useContext,useEffect,useReducer}from"react";import placeOrderReducer,{placeOrderInitialState,placeOrderPermitted}from"../reducers/PlaceOrderReducer";import OrderContext from"../context/OrderContext";import CommerceLayerContext from"../context/CommerceLayerContext";import components from"../config/components";import{setPlaceOrder}from"../reducers/PlaceOrderReducer";const propTypes=components.PlaceOrderContainer.propTypes;const displayName=components.PlaceOrderContainer.displayName;const PlaceOrderContainer=e=>{const{children:r,options:t}=e;const[o,n]=useReducer(placeOrderReducer,placeOrderInitialState);const{order:s,setOrderErrors:d,include:c,addResourceToInclude:i}=useContext(OrderContext);const a=useContext(CommerceLayerContext);useEffect((()=>{if(!(c===null||c===void 0?void 0:c.includes("shipments.shipping_method"))){i({newResource:"shipments.shipping_method"})}if(!(c===null||c===void 0?void 0:c.includes("billing_address"))){i({newResource:"billing_address"})}if(!(c===null||c===void 0?void 0:c.includes("shipping_address"))){i({newResource:"shipping_address"})}if(s){placeOrderPermitted({config:a,dispatch:n,order:s,options:Object.assign({},t)})}}),[s,c]);const p=Object.assign(Object.assign({},o),{setPlaceOrder:({paymentSource:e})=>setPlaceOrder({config:a,order:s,state:o,setOrderErrors:d,paymentSource:e}),placeOrderPermitted:()=>placeOrderPermitted({config:a,dispatch:n,order:s,options:Object.assign({},t)})});return _jsx(PlaceOrderContext.Provider,Object.assign({value:p},{children:r}),void 0)};PlaceOrderContainer.propTypes=propTypes;PlaceOrderContainer.displayName=displayName;export default PlaceOrderContainer;
@@ -0,0 +1,14 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { FunctionChildren, LoaderType } from '../typings/index';
3
+ declare type PriceChildrenProps = FunctionChildren<{
4
+ loading: boolean;
5
+ loader: LoaderType;
6
+ } & Omit<PriceProps, 'children'>>;
7
+ export interface PriceProps extends Partial<JSX.IntrinsicElements['span']> {
8
+ children?: PriceChildrenProps;
9
+ compareClassName?: string;
10
+ showCompare?: boolean;
11
+ skuCode?: string;
12
+ }
13
+ declare const Price: FunctionComponent<PriceProps>;
14
+ export default Price;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useState,useEffect,useContext}from"react";import{isEmpty,has,indexOf}from"lodash";import Parent from"./utils/Parent";import PricesContext from"../context/PricesContext";import{getPricesComponent}from"../utils/getPrices";import components from"../config/components";const propTypes=components.Price.propTypes;const defaultProps=components.Price.defaultProps;const displayName=components.Price.displayName;const Price=e=>{const{children:t,skuCode:s=""}=e;const{prices:o,skuCode:r,loading:n,skuCodes:i,setSkuCodes:p,loader:c}=useContext(PricesContext);const[m,a]=useState([]);const d=r||s;useEffect((()=>{if(!isEmpty(o)&&has(o,`${d}`)){a(o[d])}else{if(d&&indexOf(i,d)===-1){i.push(d);p&&p(i)}}return()=>{a([])}}),[o,d]);const l=Object.assign({loading:n,loader:c},e);const u=isEmpty(o)||isEmpty(m)?null:getPricesComponent(m,e);return t?_jsx(Parent,Object.assign({},l,{children:t}),void 0):_jsx(Fragment,{children:n||isEmpty(u)?c:u},void 0)};Price.propTypes=propTypes;Price.defaultProps=defaultProps;Price.displayName=displayName;export default Price;
@@ -0,0 +1,11 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { LoaderType } from '../typings/index';
3
+ declare type PricesContainerProps = {
4
+ children: ReactNode;
5
+ filters?: object;
6
+ loader?: LoaderType;
7
+ perPage?: number;
8
+ skuCode?: string;
9
+ };
10
+ declare const PricesContainer: FunctionComponent<PricesContainerProps>;
11
+ export default PricesContainer;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useEffect,useContext,useReducer}from"react";import getPrices from"../utils/getPrices";import{isEmpty,indexOf,has}from"lodash";import CommerceLayerContext from"../context/CommerceLayerContext";import priceReducer,{unsetPriceState}from"../reducers/PriceReducer";import{priceInitialState,getSkusPrice}from"../reducers/PriceReducer";import PricesContext from"../context/PricesContext";import getCurrentItemKey from"../utils/getCurrentItemKey";import ItemContext from"../context/ItemContext";import components from"../config/components";const propTypes=components.PricesContainer.propTypes;const defaultProps=components.PricesContainer.defaultProps;const displayName=components.PricesContainer.displayName;const PricesContainer=e=>{const{children:t,skuCode:s="",loader:r="Loading...",perPage:o=10,filters:i={}}=e;const[c,n]=useReducer(priceReducer,priceInitialState);const p=useContext(CommerceLayerContext);const{setPrices:a,prices:m,items:u,item:d,skuCode:C}=useContext(ItemContext);if(indexOf(c.skuCodes,s)===-1&&s)c.skuCodes.push(s);const f=getCurrentItemKey(d)||s||C||"";const P=e=>{n({type:"setSkuCodes",payload:{skuCodes:e}})};useEffect((()=>{if(d&&has(m,f)){n({type:"setPrices",payload:{prices:m}})}if(!isEmpty(u)&&isEmpty(d)){const e=getPrices(u);n({type:"setPrices",payload:{prices:e}})}if(p.accessToken&&isEmpty(d)||p.accessToken&&!has(m,f)){if(c.skuCodes.length>0||s){getSkusPrice(f&&[f]||c.skuCodes,{config:p,dispatch:n,setPrices:a,prices:m,perPage:o,filters:i})}}return()=>{if(isEmpty(d)){unsetPriceState(n)}}}),[p.accessToken,d,f]);const l=Object.assign(Object.assign({},c),{skuCode:f,loader:r,setSkuCodes:P});return _jsx(PricesContext.Provider,Object.assign({value:l},{children:t}),void 0)};PricesContainer.propTypes=propTypes;PricesContainer.defaultProps=defaultProps;PricesContainer.displayName=displayName;export default PricesContainer;
@@ -0,0 +1,4 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { BaseInputProps } from './utils/BaseInput';
3
+ declare const PrivacyAndTermsCheckbox: FunctionComponent<Partial<BaseInputProps>>;
4
+ export default PrivacyAndTermsCheckbox;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import components from"../config/components";import OrderContext from"../context/OrderContext";import PlaceOrderContext from"../context/PlaceOrderContext";import{useContext,useEffect,useState}from"react";import BaseInput from"./utils/BaseInput";const propTypes=components.PrivacyAndTermsCheckbox.propTypes;const displayName=components.PrivacyAndTermsCheckbox.displayName;const PrivacyAndTermsCheckbox=e=>{const{order:t}=useContext(OrderContext);const{placeOrderPermitted:o}=useContext(PlaceOrderContext);const[r,s]=useState(true);const[n,c]=useState(false);const a="privacy-terms";const i=e=>{var t;const r=(t=e.target)===null||t===void 0?void 0:t.checked;c(r);localStorage.setItem(a,`${r}`);o&&o()};useEffect((()=>{if((t===null||t===void 0?void 0:t.privacy_url)&&(t===null||t===void 0?void 0:t.terms_url))s(false);if(!n)localStorage.setItem(a,`${n}`);return()=>{s(true);localStorage.removeItem(a)}}),[t===null||t===void 0?void 0:t.privacy_url,t===null||t===void 0?void 0:t.terms_url]);return _jsx(BaseInput,Object.assign({type:"checkbox",name:a,disabled:r,onChange:i,checked:n},e),void 0)};PrivacyAndTermsCheckbox.propTypes=propTypes;PrivacyAndTermsCheckbox.displayName=displayName;export default PrivacyAndTermsCheckbox;
@@ -0,0 +1,17 @@
1
+ import React, { FunctionComponent } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ declare type QuantitySelectorChildrenProps = FunctionChildren<Omit<QuantitySelectorProps, 'children'> & {
4
+ handleChange: (event: React.MouseEvent<HTMLInputElement>) => void;
5
+ handleBlur: (event: React.MouseEvent<HTMLInputElement>) => void;
6
+ }>;
7
+ declare type QuantitySelectorProps = {
8
+ children?: QuantitySelectorChildrenProps;
9
+ disabled?: boolean;
10
+ min?: number;
11
+ max?: number;
12
+ value?: string;
13
+ skuCode?: string;
14
+ skuListId?: string;
15
+ } & JSX.IntrinsicElements['input'];
16
+ declare const QuantitySelector: FunctionComponent<QuantitySelectorProps>;
17
+ export default QuantitySelector;
@@ -0,0 +1 @@
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useState,useEffect}from"react";import Parent from"./utils/Parent";import{isEmpty,has}from"lodash";import getCurrentItemKey from"../utils/getCurrentItemKey";import ItemContext from"../context/ItemContext";import components from"../config/components";import SkuListsContext from"../context/SkuListsContext";const propTypes=components.QuantitySelector.propTypes;const defaultProps=components.QuantitySelector.defaultProps;const displayName=components.QuantitySelector.displayName;const QuantitySelector=t=>{var e,s,n;const{skuCode:o,skuListId:i,children:r,min:a=1,max:u}=t,m=__rest(t,["skuCode","skuListId","children","min","max"]);const{item:c,setQuantity:l,items:p,quantity:d,prices:b,skuCode:y}=useContext(ItemContext);const{skuLists:f,listIds:g}=useContext(SkuListsContext);const[x,N]=useState(a);const[j,C]=useState(!!m.disabled);const v=!isEmpty(p)&&o?(e=p[o])===null||e===void 0?void 0:e.code:o||getCurrentItemKey(c)||y;const S=isEmpty(c)?50:(n=(s=c[v])===null||s===void 0?void 0:s.inventory)===null||n===void 0?void 0:n.quantity;const O=u||S;useEffect((()=>{N(a);if(!b[v]||!v){C(true)}i&&C(false);if(v){const t=Number(a);l&&l(Object.assign(Object.assign({},d),{[`${v}`]:t}));if(!isEmpty(b)&&has(b,v))C(false)}return()=>{N(a)}}),[c,g,b]);const h=t=>{const e=Number(t.target.value);const s=Number(e)>=Number(a)&&Number(e)<=Number(O);N(e);if(!isEmpty(f)&&i&&s){l&&l(Object.assign(Object.assign({},d),{[`${i}`]:Number(e)}))}else if(v&&s){l&&l(Object.assign(Object.assign({},d),{[`${v}`]:Number(e)}))}};const k=t=>{const e=t.target.value;const s=Number(e)>=Number(a)&&Number(e)<=Number(O);if(!s){const t=Number(e)<Number(a)?a:O;N(t);if(!isEmpty(f)&&i){l&&l(Object.assign(Object.assign({},d),{[`${i}`]:Number(t)}))}else{l&&l(Object.assign(Object.assign({},d),{[`${v}`]:Number(t)}))}}};const I=Object.assign({min:a,max:O,disabled:j,handleChange:h,handleBlur:k,value:x},t);return r?_jsx(Parent,Object.assign({},I,{children:r}),void 0):_jsx("input",Object.assign({type:"number",max:O,min:a,value:x||"",disabled:j,onChange:h,onBlur:k},m),void 0)};QuantitySelector.propTypes=propTypes;QuantitySelector.defaultProps=defaultProps;QuantitySelector.displayName=displayName;export default QuantitySelector;
@@ -0,0 +1,10 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ declare type SaveAddressesButtonChildrenProps = FunctionChildren<Omit<SaveAddressesButtonProps, 'children'>>;
4
+ declare type SaveAddressesButtonProps = {
5
+ children?: SaveAddressesButtonChildrenProps;
6
+ label?: string | ReactNode;
7
+ onClick?: () => void;
8
+ } & JSX.IntrinsicElements['button'];
9
+ declare const SaveAddressesButton: FunctionComponent<SaveAddressesButtonProps>;
10
+ export default SaveAddressesButton;
@@ -0,0 +1 @@
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useState}from"react";import Parent from"./utils/Parent";import components from"../config/components";import AddressContext from"../context/AddressContext";import{isEmpty}from"lodash";import{billingAddressController,shippingAddressController,countryLockController}from"../utils/addressesManager";import OrderContext from"../context/OrderContext";import CustomerContext from"../context/CustomerContext";import isFunction from"lodash/isFunction";const propTypes=components.SaveAddressesButton.propTypes;const defaultProps=components.SaveAddressesButton.defaultProps;const displayName=components.SaveAddressesButton.displayName;const SaveAddressesButton=s=>{const{children:e,label:o="Continue to delivery",resource:t,disabled:r=false,onClick:n}=s,d=__rest(s,["children","label","resource","disabled","onClick"]);const{errors:i,billing_address:l,shipToDifferentAddress:a,shipping_address:p,saveAddresses:c,billingAddressId:u,shippingAddressId:m}=useContext(AddressContext);const{order:f}=useContext(OrderContext);const{addresses:C,isGuest:g}=useContext(CustomerContext);const[b,A]=useState(r);const x=!!(!!(g===true||typeof g==="undefined")&&!(f===null||f===void 0?void 0:f.customer_email));const h=billingAddressController({billing_address:l,errors:i,billingAddressId:u,requiresBillingInfo:f===null||f===void 0?void 0:f.requires_billing_info});const _=shippingAddressController({billingDisable:h,errors:i,shipToDifferentAddress:a,shipping_address:p,shippingAddressId:m});const v=countryLockController({countryCodeLock:f===null||f===void 0?void 0:f.shipping_country_code_lock,addresses:C,shipToDifferentAddress:a,billingAddressId:u,billing_address:l,shipping_address:p,shippingAddressId:m});const y=r||x||h||_||v;const S=async()=>{if(isEmpty(i)&&!y){A(true);await c();A(false);n&&n()}};const j=Object.assign(Object.assign({},d),{label:o,resource:t,handleClick:S,disabled:y});return e?_jsx(Parent,Object.assign({},j,{children:e}),void 0):_jsx("button",Object.assign({type:"button",disabled:y||b,onClick:S},d,{children:isFunction(o)?o():o}),void 0)};SaveAddressesButton.propTypes=propTypes;SaveAddressesButton.defaultProps=defaultProps;SaveAddressesButton.displayName=displayName;export default SaveAddressesButton;
@@ -0,0 +1,13 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { FunctionChildren } from '../typings/index';
3
+ declare type ParentProps = {
4
+ handleClick: () => any;
5
+ };
6
+ declare type SaveAddressesButtonChildrenProps = FunctionChildren<Omit<SaveCustomerButtonProps & ParentProps, 'children'>>;
7
+ declare type SaveCustomerButtonProps = {
8
+ children?: SaveAddressesButtonChildrenProps;
9
+ label?: string | ReactNode;
10
+ onClick?: () => void;
11
+ } & JSX.IntrinsicElements['button'];
12
+ declare const SaveCustomerButton: FunctionComponent<SaveCustomerButtonProps>;
13
+ export default SaveCustomerButton;
@@ -0,0 +1 @@
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import Parent from"./utils/Parent";import components from"../config/components";import{isEmpty}from"lodash";import CustomerContext from"../context/CustomerContext";const propTypes=components.SaveCustomerButton.propTypes;const defaultProps=components.SaveCustomerButton.defaultProps;const displayName=components.SaveCustomerButton.displayName;const SaveCustomerButton=t=>{const{children:e,label:o="Save",resource:s,disabled:r,onClick:n}=t,a=__rest(t,["children","label","resource","disabled","onClick"]);const{errors:m,saveCustomerUser:i,customerEmail:p}=useContext(CustomerContext);const u=r||!isEmpty(m)||isEmpty(p);const c=async()=>{if(isEmpty(m)&&!u){await i(p);n&&n()}};const l=Object.assign(Object.assign({},a),{label:o,resource:s,handleClick:c,disabled:u});return e?_jsx(Parent,Object.assign({},l,{children:e}),void 0):_jsx("button",Object.assign({type:"button",disabled:u,onClick:c},a,{children:o}),void 0)};SaveCustomerButton.propTypes=propTypes;SaveCustomerButton.defaultProps=defaultProps;SaveCustomerButton.displayName=displayName;export default SaveCustomerButton;
@@ -0,0 +1,8 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { LoaderType } from '../typings/index';
3
+ declare type ShipmentProps = {
4
+ children: ReactNode;
5
+ loader?: LoaderType;
6
+ };
7
+ declare const Shipment: FunctionComponent<ShipmentProps>;
8
+ export default Shipment;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext,useState,useEffect}from"react";import ShipmentContext from"../context/ShipmentContext";import ShipmentChildrenContext from"../context/ShipmentChildrenContext";import components from"../config/components";import getLoaderComponent from"../utils/getLoaderComponent";const propTypes=components.Shipment.propTypes;const displayName=components.Shipment.displayName;const Shipment=({children:t,loader:e="Loading..."})=>{const[n,o]=useState(true);const{shipments:i,deliveryLeadTimes:s}=useContext(ShipmentContext);useEffect((()=>{if(i)o(false);return()=>{o(true)}}),[i]);const r=i&&i.map(((e,n)=>{var o;const i=e.shipment_line_items;const r=i===null||i===void 0?void 0:i.map((t=>{const e=t.line_item;if(e)e.quantity=t.quantity;return e}));const p=e.available_shipping_methods;const m=(o=e.shipping_method)===null||o===void 0?void 0:o.id;const d=e.stock_transfers;const a=s===null||s===void 0?void 0:s.filter((t=>{var n,o;return((n=t.stock_location)===null||n===void 0?void 0:n.id)===((o=e.stock_location)===null||o===void 0?void 0:o.id)}));const c={lineItems:r,shippingMethods:p,currentShippingMethodId:m,stockTransfers:d,deliveryLeadTimes:a,shipment:e,keyNumber:n+1};return _jsx(ShipmentChildrenContext.Provider,Object.assign({value:c},{children:t}),n)}));return!n?_jsx(Fragment,{children:r},void 0):getLoaderComponent(e)};Shipment.propTypes=propTypes;Shipment.displayName=displayName;export default Shipment;
@@ -0,0 +1,12 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { Shipment } from '@commercelayer/sdk';
3
+ declare type ShipmentFieldChildrenProps = Omit<ShipmentFieldProps, 'children'> & {
4
+ shipment: Shipment;
5
+ };
6
+ export declare type ShipmentAttribute = 'number' | 'currency_code' | 'status' | 'cost_amount_cents' | 'cost_amount_float' | 'formatted_cost_amount' | 'key_number';
7
+ declare type ShipmentFieldProps = {
8
+ children?: (props: ShipmentFieldChildrenProps) => ReactNode;
9
+ name: ShipmentAttribute;
10
+ } & JSX.IntrinsicElements['span'];
11
+ declare const ShipmentField: FunctionComponent<ShipmentFieldProps>;
12
+ export default ShipmentField;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import Parent from"./utils/Parent";import components from"../config/components";import get from"lodash/get";import ShipmentChildrenContext from"../context/ShipmentChildrenContext";const propTypes=components.ShipmentField.propTypes;const displayName=components.ShipmentField.displayName;const ShipmentField=e=>{const{name:t}=e;const{shipment:n,keyNumber:o}=useContext(ShipmentChildrenContext);const i=t;const p=i!=="key_number"?get(n,i):o;const s=Object.assign({shipment:n},e);return e.children?_jsx(Parent,Object.assign({},s,{children:e.children}),void 0):_jsx("span",Object.assign({},e,{children:p}),void 0)};ShipmentField.propTypes=propTypes;ShipmentField.displayName=displayName;export default ShipmentField;
@@ -0,0 +1,6 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ declare type ShipmentsContainerProps = {
3
+ children: ReactNode;
4
+ };
5
+ declare const ShipmentsContainer: FunctionComponent<ShipmentsContainerProps>;
6
+ export default ShipmentsContainer;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import ShipmentContext,{defaultShipmentContext}from"../context/ShipmentContext";import{useContext,useEffect,useReducer}from"react";import shipmentReducer,{shipmentInitialState,getShipments,setShippingMethod}from"../reducers/ShipmentReducer";import OrderContext from"../context/OrderContext";import CommerceLayerContext from"../context/CommerceLayerContext";import components from"../config/components";import{isEmpty}from"lodash";const propTypes=components.ShipmentsContainer.propTypes;const displayName=components.ShipmentsContainer.displayName;const ShipmentsContainer=e=>{const{children:t}=e;const[n,i]=useReducer(shipmentReducer,shipmentInitialState);const{order:s,getOrder:o,include:r,addResourceToInclude:p}=useContext(OrderContext);const m=useContext(CommerceLayerContext);useEffect((()=>{if(!(r===null||r===void 0?void 0:r.includes("shipments.available_shipping_methods"))){p({newResource:["shipments.available_shipping_methods","shipments.shipment_line_items.line_item","shipments.shipping_method","shipments.stock_transfers","shipments.stock_location"]})}if(s&&!isEmpty(m)){getShipments({order:s,dispatch:i,config:m})}}),[s]);const c=Object.assign(Object.assign({},n),{setShipmentErrors:e=>defaultShipmentContext["setShipmentErrors"](e,i),setShippingMethod:async(e,t)=>await setShippingMethod({shippingMethodId:t,shipmentId:e,config:m,getOrder:o,order:s})});return _jsx(ShipmentContext.Provider,Object.assign({value:c},{children:t}),void 0)};ShipmentsContainer.propTypes=propTypes;ShipmentsContainer.displayName=displayName;export default ShipmentsContainer;
@@ -0,0 +1,6 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ declare type Props = {
3
+ children: ReactNode;
4
+ };
5
+ declare const ShippingAddressContainer: FunctionComponent<Props>;
6
+ export default ShippingAddressContainer;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import ShippingAddressContext from"../context/ShippingAddressContext";import{useContext,useEffect,useReducer}from"react";import shippingAddressReducer,{setShippingAddress,shippingAddressInitialState,setShippingCustomerAddressId}from"../reducers/ShippingAddressReducer";import CommerceLayerContext from"../context/CommerceLayerContext";import components from"../config/components";import OrderContext from"../context/OrderContext";import AddressContext from"../context/AddressContext";const propTypes=components.ShippingAddressContainer.propTypes;const ShippingAddressContainer=e=>{const{children:s}=e;const[t,r]=useReducer(shippingAddressReducer,shippingAddressInitialState);const d=useContext(CommerceLayerContext);const{order:o,updateOrder:n}=useContext(OrderContext);const{setCloneAddress:i}=useContext(AddressContext);useEffect((()=>{if(o&&d){setShippingCustomerAddressId({dispatch:r,order:o,setCloneAddress:i})}return()=>{r({type:"cleanup",payload:{}})}}),[d,o]);const p=Object.assign(Object.assign({},t),{setShippingAddress:async(e,s)=>{await setShippingAddress(e,{config:d,dispatch:r,order:o,customerAddressId:s===null||s===void 0?void 0:s.customerAddressId});i(e,"shipping_address")}});return _jsx(ShippingAddressContext.Provider,Object.assign({value:p},{children:s}),void 0)};ShippingAddressContainer.propTypes=propTypes;export default ShippingAddressContainer;
@@ -0,0 +1,8 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ declare type ShippingAddressFormProps = {
3
+ children: ReactNode;
4
+ reset?: boolean;
5
+ errorClassName?: string;
6
+ } & Omit<JSX.IntrinsicElements['form'], 'onSubmit'>;
7
+ declare const ShippingAddressForm: FunctionComponent<ShippingAddressFormProps>;
8
+ export default ShippingAddressForm;
@@ -0,0 +1 @@
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import AddressesContext from"../context/AddressContext";import useRapidForm from"rapid-form";import{useContext,useEffect,useRef}from"react";import ShippingAddressFormContext from"../context/ShippingAddressFormContext";import{isEmpty}from"lodash";import components from"../config/components";import OrderContext from"../context/OrderContext";const propTypes=components.ShippingAddressForm.propTypes;const ShippingAddressForm=e=>{const{children:s,errorClassName:r,autoComplete:o="on",reset:t=false}=e,i=__rest(e,["children","errorClassName","autoComplete","reset"]);const{validation:d,values:n,errors:p,reset:a}=useRapidForm();const{setAddressErrors:c,setAddress:l,shipToDifferentAddress:m}=useContext(AddressesContext);const{saveAddressToCustomerAddressBook:u,include:f,addResourceToInclude:g}=useContext(OrderContext);const h=useRef(null);useEffect((()=>{var e;if(!(f===null||f===void 0?void 0:f.includes("shipping_address"))){g({newResource:"shipping_address"})}if(!isEmpty(p)){const e=[];for(const s in p){const{code:r,message:o}=p[s];if(["shipping_address_state_code"].includes(s)){if(isEmpty(n["state_code"])){delete p[s]}else{e.push({code:r,message:o,resource:"shipping_address",field:s})}}else{e.push({code:r,message:o,resource:"shipping_address",field:s})}}m&&c(e,"shipping_address")}else if(!isEmpty(n)&&m){c([],"shipping_address");for(const e in n){const s=n[e];if(s===null||s===void 0?void 0:s.value){n[e.replace("shipping_address_","")]=s.value;delete n[e]}if((s===null||s===void 0?void 0:s.type)==="checkbox"){delete n[e];u({type:"shipping_address",value:s.checked})}}l({values:n,resource:"shipping_address"})}if(t&&(!isEmpty(n)||!isEmpty(p))){u&&u({type:"shipping_address",value:false});if(h){(e=h.current)===null||e===void 0?void 0:e.reset();a({target:h.current});c([],"shipping_address");l({values:{},resource:"shipping_address"})}}}),[n,p,m,t,f]);const _=(e,s)=>{const r={[e.replace("shipping_address_","")]:s};l({values:Object.assign(Object.assign({},n),r),resource:"shipping_address"})};const v={values:n,validation:d,setValue:_,errorClassName:r,errors:p,resetField:e=>a({currentTarget:h.current},e)};return _jsx(ShippingAddressFormContext.Provider,Object.assign({value:v},{children:_jsx("form",Object.assign({ref:h,autoComplete:o},i,{children:s}),void 0)}),void 0)};ShippingAddressForm.propTypes=propTypes;export default ShippingAddressForm;
@@ -0,0 +1,4 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { BaseAmountComponent } from '../typings/index';
3
+ declare const ShippingAmount: FunctionComponent<BaseAmountComponent>;
4
+ export default ShippingAmount;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.ShippingAmount.propTypes;const displayName=components.ShippingAmount.displayName;const ShippingAmount=p=>_jsx(BaseOrderPrice,Object.assign({base:"amount",type:"shipping"},p),void 0);ShippingAmount.propTypes=propTypes;ShippingAmount.displayName=displayName;export default ShippingAmount;
@@ -0,0 +1,8 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ declare type ShippingMethodProps = {
3
+ children: ReactNode;
4
+ readonly?: boolean;
5
+ emptyText?: string;
6
+ };
7
+ declare const ShippingMethod: FunctionComponent<ShippingMethodProps>;
8
+ export default ShippingMethod;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext,useEffect,useState}from"react";import ShippingMethodChildrenContext from"../context/ShippingMethodChildrenContext";import components from"../config/components";import ShipmentChildrenContext from"../context/ShipmentChildrenContext";import isEmpty from"lodash/isEmpty";const propTypes=components.ShippingMethod.propTypes;const displayName=components.ShippingMethod.displayName;const ShippingMethod=e=>{const{children:t,readonly:i,emptyText:n=`There are not any shipping method available`}=e;const{shippingMethods:o,currentShippingMethodId:p,deliveryLeadTimes:r,shipment:d}=useContext(ShipmentChildrenContext);const[s,h]=useState([]);useEffect((()=>{const e=o&&o.filter((e=>{if(i)return e.id===p;return true})).map(((e,i)=>{const[n]=r===null||r===void 0?void 0:r.filter((t=>{var i;const n=(i=t.shipping_method)===null||i===void 0?void 0:i.id;return e.id===n}));const o={shipmentId:d===null||d===void 0?void 0:d.id,shippingMethod:e,currentShippingMethodId:p,deliveryLeadTimeForShipment:n};return _jsx(ShippingMethodChildrenContext.Provider,Object.assign({value:o},{children:t}),i)}));if(e)h(e)}),[p,r,o]);const m=!isEmpty(s)&&s||n;return _jsx(Fragment,{children:m},void 0)};ShippingMethod.propTypes=propTypes;ShippingMethod.displayName=displayName;export default ShippingMethod;
@@ -0,0 +1,11 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { ShippingMethod } from '@commercelayer/sdk';
3
+ declare type LineItemNameChildrenProps = Omit<LineItemNameProps, 'children'> & {
4
+ label: string;
5
+ shippingMethod: ShippingMethod;
6
+ };
7
+ declare type LineItemNameProps = {
8
+ children?: (props: LineItemNameChildrenProps) => ReactNode;
9
+ } & JSX.IntrinsicElements['label'];
10
+ declare const ShippingMethodName: FunctionComponent<LineItemNameProps>;
11
+ export default ShippingMethodName;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import ShippingMethodChildrenContext from"../context/ShippingMethodChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.ShippingMethodName.propTypes;const displayName=components.ShippingMethodName.displayName;const ShippingMethodName=e=>{const{shippingMethod:i,deliveryLeadTimeForShipment:o,shipmentId:t}=useContext(ShippingMethodChildrenContext);const n=`shipment-${t}-${i===null||i===void 0?void 0:i.id}`||"";const p=i===null||i===void 0?void 0:i["name"];const s=Object.assign({shippingMethod:i,deliveryLeadTimeForShipment:o,label:p},e);return e.children?_jsx(Parent,Object.assign({},s,{children:e.children}),void 0):_jsx("label",Object.assign({htmlFor:n},e,{children:p}),void 0)};ShippingMethodName.propTypes=propTypes;ShippingMethodName.displayName=displayName;export default ShippingMethodName;
@@ -0,0 +1,13 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { BaseAmountComponent } from '../typings/index';
3
+ export declare type ShippingMethodPriceProps = BaseAmountComponent & {
4
+ labelFreeOver?: string;
5
+ } & ({
6
+ type?: 'amount';
7
+ base?: 'freeOver';
8
+ } | {
9
+ type?: 'amount' | 'amountForShipment';
10
+ base?: 'price';
11
+ });
12
+ declare const ShippingMethodPrice: FunctionComponent<ShippingMethodPriceProps>;
13
+ export default ShippingMethodPrice;
@@ -0,0 +1 @@
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useState,useEffect,useContext}from"react";import getAmount from"../utils/getAmount";import ShippingMethodChildrenContext from"../context/ShippingMethodChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";import OrderContext from"../context/OrderContext";import{isNumber}from"lodash";const propTypes=components.ShippingMethodPrice.propTypes;const displayName=components.ShippingMethodPrice.displayName;const ShippingMethodPrice=e=>{const{format:t="formatted",type:o="amount",base:r="price",labelFreeOver:n="Free"}=e,i=__rest(e,["format","type","base","labelFreeOver"]);const{shippingMethod:s}=useContext(ShippingMethodChildrenContext);const{order:p}=useContext(OrderContext);const[m,c]=useState("");const[a,d]=useState(0);useEffect((()=>{if(s){const e=getAmount({base:r,type:o,format:t,obj:s});c(e);const n=getAmount({base:"freeOver",type:o,format:"cents",obj:s});d(n)}return()=>{c("");d(0)}}),[s]);const h=Object.assign({price:m},i);return e.children?_jsx(Parent,Object.assign({},h,{children:e.children}),void 0):_jsx("span",Object.assign({},i,{children:(p===null||p===void 0?void 0:p.total_amount_cents)&&isNumber(a)&&a<p.total_amount_cents?n:m}),void 0)};ShippingMethodPrice.propTypes=propTypes;ShippingMethodPrice.displayName=displayName;export default ShippingMethodPrice;
@@ -0,0 +1,9 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { ShippingMethod } from '@commercelayer/sdk';
3
+ declare type ShippingMethodRadioButtonChildrenProps = Omit<ShippingMethodRadioButtonProps, 'children'>;
4
+ declare type ShippingMethodRadioButtonProps = {
5
+ children?: (props: ShippingMethodRadioButtonChildrenProps) => ReactNode;
6
+ onChange?: (shippingMethod: ShippingMethod) => void;
7
+ } & JSX.IntrinsicElements['input'];
8
+ declare const ShippingMethodRadioButton: FunctionComponent<ShippingMethodRadioButtonProps>;
9
+ export default ShippingMethodRadioButton;
@@ -0,0 +1 @@
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import ShippingMethodChildrenContext from"../context/ShippingMethodChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";import ShipmentContext from"../context/ShipmentContext";const propTypes=components.ShippingMethodRadioButton.propTypes;const displayName=components.ShippingMethodRadioButton.displayName;const ShippingMethodRadioButton=t=>{const{onChange:n}=t,o=__rest(t,["onChange"]);const{shippingMethod:e,currentShippingMethodId:i,shipmentId:p}=useContext(ShippingMethodChildrenContext);const{setShippingMethod:s}=useContext(ShipmentContext);const d=e===null||e===void 0?void 0:e.id;const h=`shipment-${p}`;const r=`${h}-${d}`;const a=d===i;const c=async()=>{if(p&&d)await s(p,d);if(e&&n)n(e)};const m=Object.assign({handleOnChange:c,name:h,id:r},t);return t.children?_jsx(Parent,Object.assign({},m,{children:t.children}),void 0):_jsx("input",Object.assign({type:"radio",name:h,id:r,onChange:c,defaultChecked:a},o),void 0)};ShippingMethodRadioButton.propTypes=propTypes;ShippingMethodRadioButton.displayName=displayName;export default ShippingMethodRadioButton;
@@ -0,0 +1,7 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ declare type SkuListProp = {
3
+ children: ReactNode;
4
+ id: string;
5
+ };
6
+ declare const SkuList: FunctionComponent<SkuListProp>;
7
+ export default SkuList;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useEffect,Fragment}from"react";import SkuListsContext from"../context/SkuListsContext";import components from"../config/components";const propTypes=components.SkuList.propTypes;const displayName=components.SkuList.displayName;const SkuList=t=>{const{id:s,children:e}=t;const{listIds:o}=useContext(SkuListsContext);useEffect((()=>{if(o&&!o.includes(s)){o.push(s)}}),[]);return _jsx(Fragment,{children:e},void 0)};SkuList.propTypes=propTypes;SkuList.displayName=displayName;export default SkuList;
@@ -0,0 +1,6 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ declare type SkuListsContainerProp = {
3
+ children: ReactNode;
4
+ };
5
+ declare const SkuListsContainer: FunctionComponent<SkuListsContainerProp>;
6
+ export default SkuListsContainer;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useReducer,useContext,useEffect}from"react";import SkuListsContext from"../context/SkuListsContext";import CommerceLayerContext from"../context/CommerceLayerContext";import skuListsReducer,{skuListsInitialState,getSkuList}from"../reducers/SkuListsReducer";import components from"../config/components";const propTypes=components.SkuListsContainer.propTypes;const displayName=components.SkuListsContainer.displayName;const SkuListsContainer=t=>{const{children:s}=t;const[e,o]=useReducer(skuListsReducer,skuListsInitialState);const i=useContext(CommerceLayerContext);useEffect((()=>{if(e.listIds&&e.listIds.length>0&&i.accessToken){getSkuList({listIds:e.listIds,dispatch:o,config:i,state:e})}}),[i.accessToken]);return _jsx(SkuListsContext.Provider,Object.assign({value:e},{children:s}),void 0)};SkuListsContainer.propTypes=propTypes;SkuListsContainer.displayName=displayName;export default SkuListsContainer;
@@ -0,0 +1,7 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ export declare type SkuOptionProps = {
3
+ children: ReactNode;
4
+ id: string;
5
+ };
6
+ declare const SkuOption: FunctionComponent<SkuOptionProps>;
7
+ export default SkuOption;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext}from"react";import SkuOptionChildrenContext from"../context/SkuOptionChildrenContext";import SkuOptionsContext from"../context/SkuOptionsContext";import components from"../config/components";const propTypes=components.SkuOption.propTypes;const displayName=components.SkuOption.displayName;const SkuOption=t=>{const{id:o}=t;const{skuOptions:n,skuCode:e}=useContext(SkuOptionsContext);const p=n&&n.filter((t=>t.id===o)).map(((o,n)=>_jsx(SkuOptionChildrenContext.Provider,Object.assign({value:{skuOption:o,skuCode:e}},{children:t.children}),n)));return _jsx(Fragment,{children:p},void 0)};SkuOption.propTypes=propTypes;SkuOption.displayName=displayName;export default SkuOption;
@@ -0,0 +1,5 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { BaseInputComponentProps } from '../typings/index';
3
+ declare type SkuOptionInputProps = BaseInputComponentProps & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['textarea'];
4
+ declare const SkuOptionInput: FunctionComponent<SkuOptionInputProps>;
5
+ export default SkuOptionInput;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import BaseInput from"./utils/BaseInput";import ItemContext from"../context/ItemContext";import SkuOptionChildrenContext from"../context/SkuOptionChildrenContext";import{has}from"lodash";import components from"../config/components";const propTypes=components.SkuOptionInput.propTypes;const displayName=components.SkuOptionInput.displayName;const SkuOptionInput=t=>{const{name:o}=t;const{option:n,setOption:s}=useContext(ItemContext);const{skuOption:e,skuCode:p}=useContext(SkuOptionChildrenContext);const i=t=>{const i=t.target.value;const u=has(n,`${p}.${e===null||e===void 0?void 0:e.id}`)?n[p][`${e===null||e===void 0?void 0:e.id}`]["options"]:{};const r={[p]:Object.assign(Object.assign({},n[p]),{[`${e===null||e===void 0?void 0:e.id}`]:{skuOptionId:e===null||e===void 0?void 0:e.id,options:Object.assign(Object.assign({},u),{[o]:i})}})};s&&s(r)};return _jsx(BaseInput,Object.assign({onChange:i},t),void 0)};SkuOptionInput.propTypes=propTypes;SkuOptionInput.displayName=displayName;export default SkuOptionInput;
@@ -0,0 +1,7 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ declare type SkuOptionsContainerProp = {
3
+ children: ReactNode;
4
+ skuCode?: string;
5
+ };
6
+ declare const SkuOptionsContainer: FunctionComponent<SkuOptionsContainerProp>;
7
+ export default SkuOptionsContainer;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useReducer,useContext,useEffect}from"react";import SkuOptionsContext from"../context/SkuOptionsContext";import skuOptionsReducer,{skuOptionsInitialState}from"../reducers/SkuOptionsReducer";import CommerceLayerContext from"../context/CommerceLayerContext";import{isEmpty}from"lodash";import getCurrentItemKey from"../utils/getCurrentItemKey";import ItemContext from"../context/ItemContext";import{getSkuOptions}from"../reducers/SkuOptionsReducer";import components from"../config/components";const propTypes=components.SkuOptionsContainer.propTypes;const displayName=components.SkuOptionsContainer.displayName;const SkuOptionsContainer=t=>{var e;const{skuCode:o,children:n}=t;const[s,i]=useReducer(skuOptionsReducer,skuOptionsInitialState);const r=useContext(CommerceLayerContext);const{item:p,items:u}=useContext(ItemContext);const m=!isEmpty(u)&&o?(e=u[o])===null||e===void 0?void 0:e.code:o||getCurrentItemKey(p);const c=Object.assign(Object.assign({},s),{skuCode:m});useEffect((()=>{if(m&&p[m].sku_options){getSkuOptions({skuOptions:p[m].sku_options,dispatch:i})}return()=>{if(isEmpty(m)){i({type:"setSkuOptions",payload:{skuOptions:[]}})}}}),[r,m]);return _jsx(SkuOptionsContext.Provider,Object.assign({value:c},{children:n}),void 0)};SkuOptionsContainer.propTypes=propTypes;SkuOptionsContainer.displayName=displayName;export default SkuOptionsContainer;
@@ -0,0 +1,6 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ declare type StockTransferProps = {
3
+ children: ReactNode;
4
+ } & JSX.IntrinsicElements['p'];
5
+ declare const StockTransfer: FunctionComponent<StockTransferProps>;
6
+ export default StockTransfer;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext,Fragment}from"react";import LineItemChildrenContext from"../context/LineItemChildrenContext";import components from"../config/components";import ShipmentChildrenContext from"../context/ShipmentChildrenContext";import StockTransferChildrenContext from"../context/StockTransferChildrenContext";const propTypes=components.StockTransfer.propTypes;const displayName=components.StockTransfer.displayName;const StockTransfer=e=>{const{children:t}=e;const{lineItem:n}=useContext(LineItemChildrenContext);const{stockTransfers:o}=useContext(ShipmentChildrenContext);const r=o===null||o===void 0?void 0:o.filter((e=>e.sku_code===(n===null||n===void 0?void 0:n.sku_code))).map(((e,n)=>{const o={stockTransfer:e};return _jsx(StockTransferChildrenContext.Provider,Object.assign({value:o},{children:t}),n)}));return _jsx(Fragment,{children:r},void 0)};StockTransfer.propTypes=propTypes;StockTransfer.displayName=displayName;export default StockTransfer;
@@ -0,0 +1,9 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ declare type StockTransferFieldChildrenProps = Omit<StockTransferFieldProps, 'children'>;
3
+ export declare type StockTransferFieldType = 'quantity' | 'sku_code';
4
+ declare type StockTransferFieldProps = {
5
+ children?: (props: StockTransferFieldChildrenProps) => ReactNode;
6
+ type: StockTransferFieldType;
7
+ } & JSX.IntrinsicElements['p'];
8
+ declare const StockTransferField: FunctionComponent<StockTransferFieldProps>;
9
+ export default StockTransferField;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import StockTransferChildrenContext from"../context/StockTransferChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.StockTransferField.propTypes;const displayName=components.StockTransferField.displayName;const StockTransferField=e=>{const{type:t}=e;const{stockTransfer:r}=useContext(StockTransferChildrenContext);const o=r?r[t]:"";const n=Object.assign({},e);return e.children?_jsx(Parent,Object.assign({},n,{children:e.children}),void 0):_jsx("p",Object.assign({},e,{children:o}),void 0)};StockTransferField.propTypes=propTypes;StockTransferField.displayName=displayName;export default StockTransferField;
@@ -0,0 +1,18 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { StripeCardElementOptions, StripeElementLocale } from '@stripe/stripe-js';
3
+ import { PaymentMethodConfig } from '../reducers/PaymentMethodReducer';
4
+ import { PaymentSourceProps } from './PaymentSource';
5
+ export declare type StripeConfig = {
6
+ containerClassName?: string;
7
+ hintLabel?: string;
8
+ name?: string;
9
+ options?: StripeCardElementOptions;
10
+ [key: string]: any;
11
+ };
12
+ declare type StripePaymentProps = PaymentMethodConfig['stripePayment'] & JSX.IntrinsicElements['div'] & Partial<PaymentSourceProps['templateCustomerSaveToWallet']> & {
13
+ show?: boolean;
14
+ publishableKey: string;
15
+ locale?: StripeElementLocale;
16
+ };
17
+ declare const StripePayment: FunctionComponent<StripePaymentProps>;
18
+ export default StripePayment;
@@ -0,0 +1 @@
1
+ import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext,useEffect,useRef,useState}from"react";import PaymentMethodContext from"../context/PaymentMethodContext";import{CardElement,Elements,useElements,useStripe}from"@stripe/react-stripe-js";import Parent from"./utils/Parent";import OrderContext from"../context/OrderContext";import{setCustomerOrderParam}from"../utils/localStorage";const defaultOptions={style:{base:{fontSize:"16px",color:"#424770","::placeholder":{color:"#aab7c4"}},invalid:{color:"#9e2146"}},hidePostalCode:true};const StripePaymentForm=({options:e=defaultOptions,templateCustomerSaveToWallet:t})=>{const o=useRef(null);const{setPaymentSource:s,paymentSource:n,currentPaymentMethodType:r,setPaymentMethodErrors:a,setPaymentRef:i}=useContext(PaymentMethodContext);const{order:l}=useContext(OrderContext);const c=useStripe();const u=useElements();useEffect((()=>{if(o.current&&c&&u){o.current.onsubmit=()=>d(o.current,c,u);i({ref:o})}return()=>{i({ref:{current:null}})}}),[o,c,u]);const d=async(e,t,o)=>{var i,c;if(!t)return false;const u=(c=(i=e===null||e===void 0?void 0:e.elements)===null||i===void 0?void 0:i["save_payment_source_to_customer_wallet"])===null||c===void 0?void 0:c.checked;if(u)setCustomerOrderParam("_save_payment_source_to_customer_wallet",u);const d=o&&o.getElement(CardElement);if(d){const e=l===null||l===void 0?void 0:l.billing_address;const o=l===null||l===void 0?void 0:l.customer_email;const i={name:e===null||e===void 0?void 0:e.full_name,email:o,phone:e===null||e===void 0?void 0:e.phone,address:{city:e===null||e===void 0?void 0:e.city,country:e===null||e===void 0?void 0:e.country_code,line1:e===null||e===void 0?void 0:e.line_1,postal_code:e===null||e===void 0?void 0:e.zip_code,state:e===null||e===void 0?void 0:e.state_code}};const{paymentMethod:c}=await t.createPaymentMethod({type:"card",card:d,billing_details:i});if(n===null||n===void 0?void 0:n.client_secret){const{error:e,paymentIntent:o}=await t.confirmCardPayment(n.client_secret,{payment_method:{card:d,billing_details:i}});if(e){console.error(e);a([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:r,message:e.message}])}else{if(o&&c&&n&&r){try{await s({paymentSourceId:n.id,paymentResource:r,attributes:{options:Object.assign(Object.assign({},c),{setup_future_usage:"off_session"})}});return true}catch(e){return false}}}}}return false};return _jsxs("form",Object.assign({ref:o,onSubmit:e=>d(e,c,u)},{children:[_jsx(CardElement,{options:Object.assign(Object.assign({},defaultOptions),e)},void 0),t&&_jsx(Parent,Object.assign({},{name:"save_payment_source_to_customer_wallet"},{children:t}),void 0)]}),void 0)};const StripePayment=e=>{var{publishableKey:t,show:o,options:s,locale:n="auto"}=e,r=__rest(e,["publishableKey","show","options","locale"]);const[a,i]=useState(false);const[l,c]=useState(null);const{containerClassName:u,templateCustomerSaveToWallet:d,fonts:m=[]}=r,p=__rest(r,["containerClassName","templateCustomerSaveToWallet","fonts"]);useEffect((()=>{if(o&&t){const{loadStripe:e}=require("@stripe/stripe-js");const o=async()=>{const o=await e(t,{locale:n});c(o);i(true)};o()}return()=>{i(false)}}),[o,t]);return a&&l?_jsx("div",Object.assign({className:u},p,{children:_jsx(Elements,Object.assign({stripe:l,options:{fonts:m}},{children:_jsx(StripePaymentForm,{options:s,templateCustomerSaveToWallet:d},void 0)}),void 0)}),void 0):null};export default StripePayment;
@@ -0,0 +1,4 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { BaseAmountComponent } from '../typings/index';
3
+ declare const SubTotalAmount: FunctionComponent<BaseAmountComponent>;
4
+ export default SubTotalAmount;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.SubTotalAmount.propTypes;const defaultProps=components.SubTotalAmount.defaultProps;const displayName=components.SubTotalAmount.displayName;const SubTotalAmount=o=>_jsx(BaseOrderPrice,Object.assign({base:"amount",type:"subtotal"},o),void 0);SubTotalAmount.propTypes=propTypes;SubTotalAmount.defaultProps=defaultProps;SubTotalAmount.displayName=displayName;export default SubTotalAmount;