@commercelayer/react-components 3.0.0-beta.6 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (417) hide show
  1. package/README.md +1 -1
  2. package/{dist → lib}/components/AddToCartButton.d.ts +20 -17
  3. package/lib/components/AddToCartButton.js +1 -0
  4. package/{dist → lib}/components/Address.d.ts +13 -12
  5. package/lib/components/Address.js +1 -0
  6. package/{dist → lib}/components/AddressCountrySelector.d.ts +9 -9
  7. package/lib/components/AddressCountrySelector.js +1 -0
  8. package/{dist → lib}/components/AddressField.d.ts +15 -15
  9. package/lib/components/AddressField.js +1 -0
  10. package/{dist → lib}/components/AddressInput.d.ts +7 -7
  11. package/lib/components/AddressInput.js +1 -0
  12. package/lib/components/AddressStateSelector.d.ts +11 -0
  13. package/lib/components/AddressStateSelector.js +1 -0
  14. package/{dist → lib}/components/AddressesContainer.d.ts +7 -7
  15. package/lib/components/AddressesContainer.js +1 -0
  16. package/lib/components/AdjustmentAmount.d.ts +4 -0
  17. package/lib/components/AdjustmentAmount.js +1 -0
  18. package/lib/components/AdyenPayment.d.ts +25 -0
  19. package/lib/components/AdyenPayment.js +1 -0
  20. package/{dist → lib}/components/AvailabilityContainer.d.ts +7 -7
  21. package/lib/components/AvailabilityContainer.js +1 -0
  22. package/{dist → lib}/components/AvailabilityTemplate.d.ts +15 -16
  23. package/lib/components/AvailabilityTemplate.js +1 -0
  24. package/{dist → lib}/components/BillingAddressContainer.d.ts +6 -6
  25. package/lib/components/BillingAddressContainer.js +1 -0
  26. package/{dist → lib}/components/BillingAddressForm.d.ts +8 -8
  27. package/lib/components/BillingAddressForm.js +1 -0
  28. package/{dist → lib}/components/BraintreePayment.d.ts +30 -19
  29. package/lib/components/BraintreePayment.js +1 -0
  30. package/{dist → lib}/components/CheckoutLink.d.ts +11 -11
  31. package/lib/components/CheckoutLink.js +1 -0
  32. package/{dist → lib}/components/CommerceLayer.d.ts +8 -9
  33. package/lib/components/CommerceLayer.js +1 -0
  34. package/{dist → lib}/components/CustomerContainer.d.ts +7 -7
  35. package/lib/components/CustomerContainer.js +1 -0
  36. package/{dist → lib}/components/CustomerInput.d.ts +11 -11
  37. package/lib/components/CustomerInput.js +1 -0
  38. package/{dist → lib}/components/DeliveryLeadTime.d.ts +10 -10
  39. package/lib/components/DeliveryLeadTime.js +1 -0
  40. package/{dist → lib}/components/DiscountAmount.d.ts +4 -4
  41. package/lib/components/DiscountAmount.js +1 -0
  42. package/{dist → lib}/components/Errors.d.ts +5 -5
  43. package/lib/components/Errors.js +1 -0
  44. package/{dist → lib}/components/ExternalFunction.d.ts +7 -7
  45. package/lib/components/ExternalFunction.js +1 -0
  46. package/{dist → lib}/components/GiftCard.d.ts +8 -8
  47. package/lib/components/GiftCard.js +1 -0
  48. package/{dist → lib}/components/GiftCardAmount.d.ts +4 -4
  49. package/lib/components/GiftCardAmount.js +1 -0
  50. package/{dist → lib}/components/GiftCardContainer.d.ts +6 -6
  51. package/lib/components/GiftCardContainer.js +1 -0
  52. package/{dist → lib}/components/GiftCardCurrencySelector.d.ts +7 -7
  53. package/lib/components/GiftCardCurrencySelector.js +1 -0
  54. package/{dist → lib}/components/GiftCardInput.d.ts +7 -7
  55. package/lib/components/GiftCardInput.js +1 -0
  56. package/{dist → lib}/components/GiftCardOrCouponCode.d.ts +13 -13
  57. package/lib/components/GiftCardOrCouponCode.js +1 -0
  58. package/{dist → lib}/components/GiftCardOrCouponForm.d.ts +10 -10
  59. package/lib/components/GiftCardOrCouponForm.js +1 -0
  60. package/{dist → lib}/components/GiftCardOrCouponInput.d.ts +8 -8
  61. package/lib/components/GiftCardOrCouponInput.js +1 -0
  62. package/{dist → lib}/components/GiftCardOrCouponRemoveButton.d.ts +16 -16
  63. package/lib/components/GiftCardOrCouponRemoveButton.js +1 -0
  64. package/{dist → lib}/components/GiftCardOrCouponSubmit.d.ts +9 -9
  65. package/lib/components/GiftCardOrCouponSubmit.js +1 -0
  66. package/{dist → lib}/components/GiftCardRecipient.d.ts +0 -0
  67. package/lib/components/GiftCardRecipient.js +1 -0
  68. package/{dist → lib}/components/GiftCardRecipientInput.d.ts +0 -0
  69. package/lib/components/GiftCardRecipientInput.js +1 -0
  70. package/{dist → lib}/components/ItemContainer.d.ts +11 -11
  71. package/lib/components/ItemContainer.js +1 -0
  72. package/{dist → lib}/components/LineItem.d.ts +8 -8
  73. package/lib/components/LineItem.js +1 -0
  74. package/{dist → lib}/components/LineItemAmount.d.ts +7 -7
  75. package/lib/components/LineItemAmount.js +1 -0
  76. package/lib/components/LineItemCode.d.ts +12 -0
  77. package/lib/components/LineItemCode.js +1 -0
  78. package/lib/components/LineItemImage.d.ts +16 -0
  79. package/lib/components/LineItemImage.js +1 -0
  80. package/lib/components/LineItemName.d.ts +11 -0
  81. package/lib/components/LineItemName.js +1 -0
  82. package/{dist → lib}/components/LineItemOption.d.ts +19 -19
  83. package/lib/components/LineItemOption.js +1 -0
  84. package/{dist → lib}/components/LineItemOptions.d.ts +14 -14
  85. package/lib/components/LineItemOptions.js +1 -0
  86. package/{dist → lib}/components/LineItemQuantity.d.ts +14 -14
  87. package/lib/components/LineItemQuantity.js +1 -0
  88. package/{dist → lib}/components/LineItemRemoveLink.d.ts +12 -12
  89. package/lib/components/LineItemRemoveLink.js +1 -0
  90. package/{dist → lib}/components/LineItemsContainer.d.ts +8 -8
  91. package/lib/components/LineItemsContainer.js +1 -0
  92. package/{dist → lib}/components/LineItemsCount.d.ts +12 -10
  93. package/lib/components/LineItemsCount.js +1 -0
  94. package/lib/components/LineItemsEmpty.d.ts +12 -0
  95. package/lib/components/LineItemsEmpty.js +1 -0
  96. package/{dist → lib}/components/MetadataInput.d.ts +5 -5
  97. package/lib/components/MetadataInput.js +1 -0
  98. package/{dist → lib}/components/OrderContainer.d.ts +11 -10
  99. package/lib/components/OrderContainer.js +1 -0
  100. package/{dist → lib}/components/OrderNumber.d.ts +5 -5
  101. package/lib/components/OrderNumber.js +1 -0
  102. package/{dist → lib}/components/OrderStorage.d.ts +8 -8
  103. package/lib/components/OrderStorage.js +1 -0
  104. package/lib/components/PaymentGateway.d.ts +16 -0
  105. package/lib/components/PaymentGateway.js +1 -0
  106. package/{dist → lib}/components/PaymentMethod.d.ts +16 -16
  107. package/lib/components/PaymentMethod.js +1 -0
  108. package/{dist → lib}/components/PaymentMethodAmount.d.ts +4 -4
  109. package/lib/components/PaymentMethodAmount.js +1 -0
  110. package/{dist → lib}/components/PaymentMethodName.d.ts +9 -9
  111. package/lib/components/PaymentMethodName.js +1 -0
  112. package/{dist → lib}/components/PaymentMethodPrice.d.ts +9 -9
  113. package/lib/components/PaymentMethodPrice.js +1 -0
  114. package/{dist → lib}/components/PaymentMethodRadioButton.d.ts +11 -11
  115. package/lib/components/PaymentMethodRadioButton.js +1 -0
  116. package/{dist → lib}/components/PaymentMethodsContainer.d.ts +8 -8
  117. package/lib/components/PaymentMethodsContainer.js +1 -0
  118. package/{dist → lib}/components/PaymentSource.d.ts +19 -18
  119. package/lib/components/PaymentSource.js +1 -0
  120. package/{dist → lib}/components/PaymentSourceBrandIcon.d.ts +15 -15
  121. package/lib/components/PaymentSourceBrandIcon.js +1 -0
  122. package/{dist → lib}/components/PaymentSourceBrandName.d.ts +12 -12
  123. package/lib/components/PaymentSourceBrandName.js +1 -0
  124. package/{dist → lib}/components/PaymentSourceDetail.d.ts +12 -12
  125. package/lib/components/PaymentSourceDetail.js +1 -0
  126. package/{dist → lib}/components/PaymentSourceEditButton.d.ts +9 -9
  127. package/lib/components/PaymentSourceEditButton.js +1 -0
  128. package/{dist → lib}/components/PaypalPayment.d.ts +12 -12
  129. package/lib/components/PaypalPayment.js +1 -0
  130. package/{dist → lib}/components/PlaceOrderButton.d.ts +12 -12
  131. package/lib/components/PlaceOrderButton.js +1 -0
  132. package/{dist → lib}/components/PlaceOrderContainer.d.ts +8 -8
  133. package/lib/components/PlaceOrderContainer.js +1 -0
  134. package/{dist → lib}/components/Price.d.ts +16 -14
  135. package/lib/components/Price.js +1 -0
  136. package/{dist → lib}/components/PricesContainer.d.ts +11 -11
  137. package/lib/components/PricesContainer.js +1 -0
  138. package/{dist → lib}/components/PrivacyAndTermsCheckbox.d.ts +4 -4
  139. package/lib/components/PrivacyAndTermsCheckbox.js +1 -0
  140. package/{dist → lib}/components/QuantitySelector.d.ts +17 -17
  141. package/lib/components/QuantitySelector.js +1 -0
  142. package/{dist → lib}/components/SaveAddressesButton.d.ts +10 -10
  143. package/lib/components/SaveAddressesButton.js +1 -0
  144. package/{dist → lib}/components/SaveCustomerButton.d.ts +13 -13
  145. package/lib/components/SaveCustomerButton.js +1 -0
  146. package/{dist → lib}/components/Shipment.d.ts +8 -8
  147. package/lib/components/Shipment.js +1 -0
  148. package/{dist → lib}/components/ShipmentField.d.ts +12 -12
  149. package/lib/components/ShipmentField.js +1 -0
  150. package/{dist → lib}/components/ShipmentsContainer.d.ts +6 -6
  151. package/lib/components/ShipmentsContainer.js +1 -0
  152. package/{dist → lib}/components/ShippingAddressContainer.d.ts +6 -6
  153. package/lib/components/ShippingAddressContainer.js +1 -0
  154. package/{dist → lib}/components/ShippingAddressForm.d.ts +8 -8
  155. package/lib/components/ShippingAddressForm.js +1 -0
  156. package/{dist → lib}/components/ShippingAmount.d.ts +4 -4
  157. package/lib/components/ShippingAmount.js +1 -0
  158. package/{dist → lib}/components/ShippingMethod.d.ts +8 -8
  159. package/lib/components/ShippingMethod.js +1 -0
  160. package/{dist → lib}/components/ShippingMethodName.d.ts +11 -7
  161. package/lib/components/ShippingMethodName.js +1 -0
  162. package/{dist → lib}/components/ShippingMethodPrice.d.ts +13 -13
  163. package/lib/components/ShippingMethodPrice.js +1 -0
  164. package/lib/components/ShippingMethodRadioButton.d.ts +13 -0
  165. package/lib/components/ShippingMethodRadioButton.js +1 -0
  166. package/{dist → lib}/components/SkuList.d.ts +7 -7
  167. package/lib/components/SkuList.js +1 -0
  168. package/{dist → lib}/components/SkuListsContainer.d.ts +6 -6
  169. package/lib/components/SkuListsContainer.js +1 -0
  170. package/{dist → lib}/components/SkuOption.d.ts +7 -7
  171. package/lib/components/SkuOption.js +1 -0
  172. package/{dist → lib}/components/SkuOptionInput.d.ts +5 -5
  173. package/lib/components/SkuOptionInput.js +1 -0
  174. package/{dist → lib}/components/SkuOptionsContainer.d.ts +7 -7
  175. package/lib/components/SkuOptionsContainer.js +1 -0
  176. package/{dist → lib}/components/StockTransfer.d.ts +6 -6
  177. package/lib/components/StockTransfer.js +1 -0
  178. package/{dist → lib}/components/StockTransferField.d.ts +9 -9
  179. package/lib/components/StockTransferField.js +1 -0
  180. package/{dist → lib}/components/StripePayment.d.ts +18 -18
  181. package/lib/components/StripePayment.js +1 -0
  182. package/{dist → lib}/components/SubTotalAmount.d.ts +4 -4
  183. package/lib/components/SubTotalAmount.js +1 -0
  184. package/{dist → lib}/components/SubmitButton.d.ts +9 -9
  185. package/lib/components/SubmitButton.js +1 -0
  186. package/{dist → lib}/components/TaxesAmount.d.ts +4 -4
  187. package/lib/components/TaxesAmount.js +1 -0
  188. package/{dist → lib}/components/TotalAmount.d.ts +4 -4
  189. package/lib/components/TotalAmount.js +1 -0
  190. package/{dist → lib}/components/VariantSelector.d.ts +29 -27
  191. package/lib/components/VariantSelector.js +1 -0
  192. package/{dist → lib}/components/VariantsContainer.d.ts +8 -8
  193. package/lib/components/VariantsContainer.js +1 -0
  194. package/{dist → lib}/components/WireTransferPayment.d.ts +10 -10
  195. package/lib/components/WireTransferPayment.js +1 -0
  196. package/lib/components/gateways/AdyenGateway.d.ts +5 -0
  197. package/lib/components/gateways/AdyenGateway.js +1 -0
  198. package/lib/components/gateways/BraintreeGateway.d.ts +5 -0
  199. package/lib/components/gateways/BraintreeGateway.js +1 -0
  200. package/lib/components/gateways/PaypalGateway.d.ts +5 -0
  201. package/lib/components/gateways/PaypalGateway.js +1 -0
  202. package/lib/components/gateways/StripeGateway.d.ts +5 -0
  203. package/lib/components/gateways/StripeGateway.js +1 -0
  204. package/lib/components/gateways/WireTransferGateway.d.ts +5 -0
  205. package/lib/components/gateways/WireTransferGateway.js +1 -0
  206. package/lib/components/utils/AddressCardsTemplate.d.ts +27 -0
  207. package/lib/components/utils/AddressCardsTemplate.js +1 -0
  208. package/{dist → lib}/components/utils/BaseField.d.ts +8 -8
  209. package/lib/components/utils/BaseField.js +1 -0
  210. package/lib/components/utils/BaseInput.d.ts +5 -0
  211. package/lib/components/utils/BaseInput.js +1 -0
  212. package/{dist → lib}/components/utils/BaseOrderPrice.d.ts +6 -6
  213. package/lib/components/utils/BaseOrderPrice.js +1 -0
  214. package/{dist → lib}/components/utils/BaseSelect.d.ts +5 -5
  215. package/lib/components/utils/BaseSelect.js +1 -0
  216. package/{dist → lib}/components/utils/Parent.d.ts +8 -8
  217. package/lib/components/utils/Parent.js +1 -0
  218. package/lib/components/utils/PaymentCardsTemplate.d.ts +23 -0
  219. package/lib/components/utils/PaymentCardsTemplate.js +1 -0
  220. package/{dist → lib}/components/utils/PriceTemplate.d.ts +8 -8
  221. package/lib/components/utils/PriceTemplate.js +1 -0
  222. package/{dist → lib}/components/utils/VariantTemplate.d.ts +36 -34
  223. package/lib/components/utils/VariantTemplate.js +1 -0
  224. package/{dist → lib}/components/utils/getAllErrors.d.ts +17 -17
  225. package/lib/components/utils/getAllErrors.js +1 -0
  226. package/{dist → lib}/config/components.d.ts +892 -865
  227. package/lib/config/components.js +1 -0
  228. package/lib/config/currency.d.ts +5 -0
  229. package/lib/config/currency.js +1 -0
  230. package/{dist → lib}/context/AddressChildrenContext.d.ts +7 -7
  231. package/lib/context/AddressChildrenContext.js +1 -0
  232. package/{dist → lib}/context/AddressContext.d.ts +17 -16
  233. package/lib/context/AddressContext.js +1 -0
  234. package/{dist → lib}/context/AvailabilityContext.d.ts +3 -3
  235. package/lib/context/AvailabilityContext.js +1 -0
  236. package/{dist → lib}/context/BillingAddressContext.d.ts +12 -12
  237. package/lib/context/BillingAddressContext.js +1 -0
  238. package/{dist → lib}/context/BillingAddressFormContext.d.ts +18 -16
  239. package/lib/context/BillingAddressFormContext.js +1 -0
  240. package/{dist → lib}/context/CommerceLayerContext.d.ts +7 -8
  241. package/lib/context/CommerceLayerContext.js +1 -0
  242. package/{dist → lib}/context/CouponAndGiftCardFormContext.d.ts +7 -7
  243. package/lib/context/CouponAndGiftCardFormContext.js +1 -0
  244. package/{dist → lib}/context/CustomerContext.d.ts +16 -14
  245. package/lib/context/CustomerContext.js +1 -0
  246. package/{dist → lib}/context/ExternalFunctionContext.d.ts +12 -12
  247. package/lib/context/ExternalFunctionContext.js +1 -0
  248. package/{dist → lib}/context/GiftCardContext.d.ts +11 -11
  249. package/lib/context/GiftCardContext.js +1 -0
  250. package/{dist → lib}/context/ItemContext.d.ts +13 -13
  251. package/lib/context/ItemContext.js +1 -0
  252. package/lib/context/LineItemChildrenContext.d.ts +9 -0
  253. package/lib/context/LineItemChildrenContext.js +1 -0
  254. package/{dist → lib}/context/LineItemContext.d.ts +8 -8
  255. package/lib/context/LineItemContext.js +1 -0
  256. package/{dist → lib}/context/LineItemOptionChildrenContext.d.ts +8 -8
  257. package/lib/context/LineItemOptionChildrenContext.js +1 -0
  258. package/lib/context/OrderContext.d.ts +26 -0
  259. package/lib/context/OrderContext.js +1 -0
  260. package/{dist → lib}/context/OrderStorageContext.d.ts +11 -11
  261. package/lib/context/OrderStorageContext.js +1 -0
  262. package/{dist → lib}/context/PaymentMethodChildrenContext.d.ts +10 -10
  263. package/lib/context/PaymentMethodChildrenContext.js +1 -0
  264. package/{dist → lib}/context/PaymentMethodContext.d.ts +23 -20
  265. package/lib/context/PaymentMethodContext.js +1 -0
  266. package/{dist → lib}/context/PaymentSourceContext.d.ts +14 -14
  267. package/lib/context/PaymentSourceContext.js +1 -0
  268. package/{dist → lib}/context/PlaceOrderContext.d.ts +16 -16
  269. package/lib/context/PlaceOrderContext.js +1 -0
  270. package/{dist → lib}/context/PricesContext.d.ts +7 -7
  271. package/lib/context/PricesContext.js +1 -0
  272. package/lib/context/ShipmentChildrenContext.d.ts +13 -0
  273. package/lib/context/ShipmentChildrenContext.js +1 -0
  274. package/{dist → lib}/context/ShipmentContext.d.ts +12 -12
  275. package/lib/context/ShipmentContext.js +1 -0
  276. package/{dist → lib}/context/ShippingAddressContext.d.ts +10 -10
  277. package/lib/context/ShippingAddressContext.js +1 -0
  278. package/{dist → lib}/context/ShippingAddressFormContext.d.ts +4 -4
  279. package/lib/context/ShippingAddressFormContext.js +1 -0
  280. package/lib/context/ShippingMethodChildrenContext.d.ts +10 -0
  281. package/lib/context/ShippingMethodChildrenContext.js +1 -0
  282. package/lib/context/SkuListsContext.d.ts +6 -0
  283. package/lib/context/SkuListsContext.js +1 -0
  284. package/{dist → lib}/context/SkuOptionChildrenContext.d.ts +8 -8
  285. package/lib/context/SkuOptionChildrenContext.js +1 -0
  286. package/{dist → lib}/context/SkuOptionsContext.d.ts +3 -3
  287. package/lib/context/SkuOptionsContext.js +1 -0
  288. package/{dist → lib}/context/StockTransferChildrenContext.d.ts +7 -7
  289. package/lib/context/StockTransferChildrenContext.js +1 -0
  290. package/{dist → lib}/context/VariantsContext.d.ts +3 -3
  291. package/lib/context/VariantsContext.js +1 -0
  292. package/lib/index.d.ts +96 -0
  293. package/lib/index.js +1 -0
  294. package/{dist → lib}/reducers/AddressReducer.d.ts +58 -52
  295. package/lib/reducers/AddressReducer.js +1 -0
  296. package/lib/reducers/AvailabilityReducer.d.ts +53 -0
  297. package/lib/reducers/AvailabilityReducer.js +1 -0
  298. package/{dist → lib}/reducers/BillingAddressReducer.d.ts +31 -32
  299. package/lib/reducers/BillingAddressReducer.js +1 -0
  300. package/{dist → lib}/reducers/CustomerReducer.d.ts +50 -60
  301. package/lib/reducers/CustomerReducer.js +1 -0
  302. package/{dist → lib}/reducers/GiftCardReducer.d.ts +76 -75
  303. package/lib/reducers/GiftCardReducer.js +1 -0
  304. package/{dist → lib}/reducers/ItemReducer.d.ts +69 -68
  305. package/lib/reducers/ItemReducer.js +1 -0
  306. package/{dist → lib}/reducers/LineItemReducer.d.ts +52 -52
  307. package/lib/reducers/LineItemReducer.js +1 -0
  308. package/lib/reducers/OrderReducer.d.ts +131 -0
  309. package/lib/reducers/OrderReducer.js +1 -0
  310. package/{dist → lib}/reducers/PaymentMethodReducer.d.ts +105 -95
  311. package/lib/reducers/PaymentMethodReducer.js +1 -0
  312. package/{dist → lib}/reducers/PlaceOrderReducer.d.ts +52 -50
  313. package/lib/reducers/PlaceOrderReducer.js +1 -0
  314. package/{dist → lib}/reducers/PriceReducer.d.ts +44 -45
  315. package/lib/reducers/PriceReducer.js +1 -0
  316. package/{dist → lib}/reducers/ShipmentReducer.d.ts +40 -37
  317. package/lib/reducers/ShipmentReducer.js +1 -0
  318. package/{dist → lib}/reducers/ShippingAddressReducer.d.ts +32 -31
  319. package/lib/reducers/ShippingAddressReducer.js +1 -0
  320. package/{dist → lib}/reducers/SkuListsReducer.d.ts +21 -22
  321. package/lib/reducers/SkuListsReducer.js +1 -0
  322. package/{dist → lib}/reducers/SkuOptionsReducer.d.ts +26 -26
  323. package/lib/reducers/SkuOptionsReducer.js +1 -0
  324. package/{dist → lib}/reducers/VariantReducer.d.ts +71 -71
  325. package/lib/reducers/VariantReducer.js +1 -0
  326. package/{dist → lib}/typings/errors.d.ts +42 -40
  327. package/lib/typings/errors.js +1 -0
  328. package/{dist → lib}/typings/index.d.ts +126 -150
  329. package/lib/typings/index.js +1 -0
  330. package/{dist → lib}/utils/PropsType.d.ts +33 -33
  331. package/lib/utils/PropsType.js +1 -0
  332. package/{dist → lib}/utils/addressesManager.d.ts +28 -27
  333. package/lib/utils/addressesManager.js +1 -0
  334. package/{dist → lib}/utils/baseReducer.d.ts +3 -3
  335. package/lib/utils/baseReducer.js +1 -0
  336. package/lib/utils/browserInfo.d.ts +9 -0
  337. package/lib/utils/browserInfo.js +1 -0
  338. package/{dist → lib}/utils/childrenTypes.d.ts +9 -9
  339. package/lib/utils/childrenTypes.js +1 -0
  340. package/lib/utils/countryStateCity.d.ts +9 -0
  341. package/lib/utils/countryStateCity.js +1 -0
  342. package/{dist → lib}/utils/customMessages.d.ts +8 -8
  343. package/lib/utils/customMessages.js +1 -0
  344. package/lib/utils/customerOrderOptions.d.ts +3 -0
  345. package/lib/utils/customerOrderOptions.js +1 -0
  346. package/{dist → lib}/utils/getAmount.d.ts +9 -9
  347. package/lib/utils/getAmount.js +1 -0
  348. package/{dist → lib}/utils/getCurrentItemKey.d.ts +6 -6
  349. package/lib/utils/getCurrentItemKey.js +1 -0
  350. package/lib/utils/getErrors.d.ts +11 -0
  351. package/lib/utils/getErrors.js +1 -0
  352. package/lib/utils/getLineItemsCount.d.ts +12 -0
  353. package/lib/utils/getLineItemsCount.js +1 -0
  354. package/{dist → lib}/utils/getLoaderComponent.d.ts +3 -3
  355. package/lib/utils/getLoaderComponent.js +1 -0
  356. package/lib/utils/getPrices.d.ts +17 -0
  357. package/lib/utils/getPrices.js +1 -0
  358. package/lib/utils/getSdk.d.ts +3 -0
  359. package/lib/utils/getSdk.js +1 -0
  360. package/lib/utils/getSkus.d.ts +3 -0
  361. package/lib/utils/getSkus.js +1 -0
  362. package/lib/utils/isEmptyStates.d.ts +1 -0
  363. package/lib/utils/isEmptyStates.js +1 -0
  364. package/{dist → lib}/utils/isJSON.d.ts +1 -1
  365. package/lib/utils/isJSON.js +1 -0
  366. package/lib/utils/jwt.d.ts +27 -0
  367. package/lib/utils/jwt.js +1 -0
  368. package/lib/utils/localStorage.d.ts +17 -0
  369. package/lib/utils/localStorage.js +1 -0
  370. package/lib/utils/organization.d.ts +6 -0
  371. package/lib/utils/organization.js +1 -0
  372. package/lib/utils/paypalPayment.d.ts +3 -0
  373. package/lib/utils/paypalPayment.js +1 -0
  374. package/lib/utils/promisify.d.ts +1 -0
  375. package/lib/utils/promisify.js +1 -0
  376. package/lib/utils/shipments.d.ts +2 -0
  377. package/lib/utils/shipments.js +1 -0
  378. package/{dist → lib}/utils/validateFormFields.d.ts +20 -19
  379. package/lib/utils/validateFormFields.js +1 -0
  380. package/package.json +95 -81
  381. package/dist/components/CustomerField.d.ts +0 -10
  382. package/dist/components/LineItemImage.d.ts +0 -10
  383. package/dist/components/LineItemName.d.ts +0 -7
  384. package/dist/components/LineItemSkuCode.d.ts +0 -7
  385. package/dist/components/OrderList.d.ts +0 -26
  386. package/dist/components/OrderListRow.d.ts +0 -14
  387. package/dist/components/PaymentGateway.d.ts +0 -11
  388. package/dist/components/ShippingMethodRadioButton.d.ts +0 -9
  389. package/dist/components/utils/BaseInput.d.ts +0 -5
  390. package/dist/context/LineItemChildrenContext.d.ts +0 -7
  391. package/dist/context/OrderContext.d.ts +0 -4
  392. package/dist/context/OrderListChildrenContext.d.ts +0 -14
  393. package/dist/context/ShipmentChildrenContext.d.ts +0 -13
  394. package/dist/context/ShippingMethodChildrenContext.d.ts +0 -9
  395. package/dist/context/SkuListsContext.d.ts +0 -3
  396. package/dist/index.d.ts +0 -89
  397. package/dist/index.js +0 -8
  398. package/dist/react-components.cjs.development.js +0 -12691
  399. package/dist/react-components.cjs.development.js.map +0 -1
  400. package/dist/react-components.cjs.production.min.js +0 -2
  401. package/dist/react-components.cjs.production.min.js.map +0 -1
  402. package/dist/react-components.esm.js +0 -12595
  403. package/dist/react-components.esm.js.map +0 -1
  404. package/dist/reducers/AvailabilityReducer.d.ts +0 -40
  405. package/dist/reducers/OrderReducer.d.ts +0 -131
  406. package/dist/typings/order.d.ts +0 -120
  407. package/dist/utils/dynamicNaming.d.ts +0 -5
  408. package/dist/utils/getErrorsByCollection.d.ts +0 -11
  409. package/dist/utils/getLineItemsCount.d.ts +0 -6
  410. package/dist/utils/getPrices.d.ts +0 -18
  411. package/dist/utils/getSkus.d.ts +0 -3
  412. package/dist/utils/icons.d.ts +0 -3
  413. package/dist/utils/isDate.d.ts +0 -1
  414. package/dist/utils/localStorage.d.ts +0 -12
  415. package/dist/utils/paypalPayment.d.ts +0 -3
  416. package/dist/utils/scrollbarWidth.d.ts +0 -1
  417. package/dist/utils/shipments.d.ts +0 -5
@@ -0,0 +1 @@
1
+ import{createElement as _createElement}from"react";import{jsx as _jsx}from"react/jsx-runtime";import{isEmpty,first,isArray,has}from"lodash";import PriceTemplate from"../components/utils/PriceTemplate";export const getPriceByCode=(skuPrices,code="")=>code?first(skuPrices.filter(p=>p.currency_code===code)):first(skuPrices),getPricesComponent=(skuPrices,props)=>isEmpty(skuPrices)?_jsx(PriceTemplate,Object.assign({},props),void 0):skuPrices.map((p,k)=>{const showCompare=typeof props.showCompare=="undefined"&&(p==null?void 0:p.compare_at_amount_cents)>(p==null?void 0:p.amount_cents)||props.showCompare;return _createElement(PriceTemplate,Object.assign({},props,{key:k,showCompare,formattedAmount:p.formatted_amount,formattedCompare:p.formatted_compare_at_amount}))});export default function getPrices(prices){const obj={};return isArray(prices)&&prices.forEach(p=>{const sku=p.sku_code;has(obj,sku)?obj[sku].push(p):obj[sku]=[p]}),obj}
@@ -0,0 +1,3 @@
1
+ import Sdk from '@commercelayer/sdk';
2
+ import { CommerceLayerConfig } from '../context/CommerceLayerContext';
3
+ export default function getSdk({ endpoint, accessToken, }: CommerceLayerConfig): ReturnType<typeof Sdk>;
@@ -0,0 +1 @@
1
+ import getOrganizationSlug from"./organization";import Sdk from"@commercelayer/sdk";export default function getSdk({endpoint,accessToken}){const org=getOrganizationSlug(endpoint);return Sdk(Object.assign({accessToken},org))}
@@ -0,0 +1,3 @@
1
+ import { Sku } from '@commercelayer/sdk';
2
+ declare const getSkus: (skus: Sku[], sortBy: string[]) => Record<string, any>;
3
+ export default getSkus;
@@ -0,0 +1 @@
1
+ const getSkus=(skus,sortBy)=>{const obj={};return sortBy.forEach(sku=>{skus.forEach(o=>{(o==null?void 0:o.code)===sku&&(obj[o.code]=o)})}),obj};export default getSkus;
@@ -0,0 +1 @@
1
+ export default function isEmptyStates(countryCode: string): boolean;
@@ -0,0 +1 @@
1
+ const countryLock=["IT","US"];export default function isEmptyStates(countryCode){return!countryLock.includes(countryCode)}
@@ -1 +1 @@
1
- export default function isJSON(str: string): boolean;
1
+ export default function isJSON(str: string): boolean;
@@ -0,0 +1 @@
1
+ export default function isJSON(str){try{return JSON.parse(str),!0}catch{return!1}}
@@ -0,0 +1,27 @@
1
+ declare type JWT = {
2
+ application: {
3
+ id: string;
4
+ kind: 'sales_channel' | 'integration';
5
+ public: boolean;
6
+ };
7
+ exp: number;
8
+ market: {
9
+ id: string[];
10
+ price_list_id: string;
11
+ stock_location_ids: string[];
12
+ geocoder_id: null | string;
13
+ allows_external_prices: boolean;
14
+ };
15
+ organization: {
16
+ id: string;
17
+ slug: string;
18
+ };
19
+ owner: {
20
+ id: 'gOqzZhZrmQ';
21
+ type: 'Customer';
22
+ };
23
+ rand: number;
24
+ test: boolean;
25
+ };
26
+ export default function jwt(accessToken: string): JWT;
27
+ export {};
@@ -0,0 +1 @@
1
+ import jwtDecode from"jwt-decode";export default function jwt(accessToken){return jwtDecode(accessToken)}
@@ -0,0 +1,17 @@
1
+ export interface GetLocalOrder {
2
+ (key: string): string | null;
3
+ }
4
+ export declare const getLocalOrder: GetLocalOrder;
5
+ export interface SetLocalOrder {
6
+ (key: string, value: string): void;
7
+ }
8
+ export declare const setLocalOrder: SetLocalOrder;
9
+ export interface DeleteLocalOrder {
10
+ (key: string): void;
11
+ }
12
+ export declare const deleteLocalOrder: DeleteLocalOrder;
13
+ export declare const getSavePaymentSourceToCustomerWallet: () => boolean;
14
+ export declare const getSaveBillingAddressToAddressBook: () => boolean;
15
+ export declare const getSaveShippingAddressToAddressBook: () => boolean;
16
+ export declare type CustomerOrderParams = '_save_payment_source_to_customer_wallet' | '_save_billing_address_to_customer_address_book' | '_save_shipping_address_to_customer_address_book';
17
+ export declare function setCustomerOrderParam<T extends CustomerOrderParams>(key: T, value: string): void;
@@ -0,0 +1 @@
1
+ export const getLocalOrder=key=>localStorage.getItem(key),setLocalOrder=(key,value)=>localStorage.setItem(key,value),deleteLocalOrder=key=>{localStorage.removeItem(key)},getSavePaymentSourceToCustomerWallet=()=>localStorage.getItem("_save_payment_source_to_customer_wallet")==="true",getSaveBillingAddressToAddressBook=()=>localStorage.getItem("_save_billing_address_to_customer_address_book")==="true",getSaveShippingAddressToAddressBook=()=>localStorage.getItem("_save_shipping_address_to_customer_address_book")==="true";export function setCustomerOrderParam(key,value){return setLocalOrder(key,value)}
@@ -0,0 +1,6 @@
1
+ declare type ReturnObj = {
2
+ organization: string;
3
+ domain: string;
4
+ };
5
+ export default function getOrganizationSlug<E extends string>(endpoint: E): ReturnObj;
6
+ export {};
@@ -0,0 +1 @@
1
+ export default function getOrganizationSlug(endpoint){const org={organization:"",domain:"commercelayer.io"};return endpoint.search("commercelayer.io")===-1&&(org.domain="commercelayer.co"),org.organization=endpoint.replace("https://","").replace(`.${org.domain}`,""),org}
@@ -0,0 +1,3 @@
1
+ import { PaypalConfig } from '../components/PaypalPayment';
2
+ import { PaymentResource, PaymentMethodConfig } from '../reducers/PaymentMethodReducer';
3
+ export default function getPaypalConfig(paymentResource: PaymentResource, config: PaymentMethodConfig): Pick<PaypalConfig, 'return_url' | 'cancel_url'> | undefined;
@@ -0,0 +1 @@
1
+ import{getPaymentConfig}from"../reducers/PaymentMethodReducer";import pick from"lodash/pick";export default function getPaypalConfig(paymentResource,config){const attributes=getPaymentConfig(paymentResource,config);return attributes&&pick(attributes,["return_url","cancel_url"])}
@@ -0,0 +1 @@
1
+ export default function promisify(cb: any, params?: any): Promise<any>;
@@ -0,0 +1 @@
1
+ import isFunction from"lodash/isFunction";export default function promisify(cb,params){return new Promise((resolve,reject)=>{params?cb(params,(err,res)=>{err&&reject(err),resolve(res)}):isFunction(cb==null?void 0:cb.tokenize)?cb==null||cb.tokenize((err,payload)=>{err&&reject(err),resolve(payload)}):cb((err,res)=>{err&&reject(err),resolve(res)})})}
@@ -0,0 +1,2 @@
1
+ import { Shipment } from '@commercelayer/sdk';
2
+ export declare function shipmentsFilled(shipments: Shipment[]): boolean;
@@ -0,0 +1 @@
1
+ import compact from"lodash/compact";import isEmpty from"lodash/isEmpty";export function shipmentsFilled(shipments){const filled=compact(shipments.filter(shipment=>!isEmpty(shipment.shipping_method)));return!isEmpty(filled)}
@@ -1,19 +1,20 @@
1
- import { BaseState } from "../typings/index";
2
- import { ResourceErrorType, BaseError } from "../typings/errors";
3
- import { AddressField, AddressSchema } from "../reducers/AddressReducer";
4
- export interface ValidateFormFields {
5
- <R extends string[]>(fields: HTMLFormControlsCollection, required: R, resourceType: ResourceErrorType): {
6
- errors: BaseError[];
7
- values: BaseState;
8
- };
9
- }
10
- export interface ValidateValue {
11
- <V extends string | boolean, N extends string, T extends string, B extends ResourceErrorType>(val: V, name: N, type: T, resourceType: B): BaseError | Record<string, any>;
12
- }
13
- export declare const validateValue: ValidateValue;
14
- declare const validateFormFields: ValidateFormFields;
15
- export interface FieldsExist {
16
- (values: AddressSchema, schema?: AddressField[]): boolean;
17
- }
18
- export declare const fieldsExist: FieldsExist;
19
- export default validateFormFields;
1
+ import { BaseState } from '../typings/index';
2
+ import { ResourceErrorType, BaseError } from '../typings/errors';
3
+ import { AddressField } from '../reducers/AddressReducer';
4
+ import { AddressCreate } from '@commercelayer/sdk';
5
+ export interface ValidateFormFields {
6
+ <R extends string[]>(fields: HTMLFormControlsCollection, required: R, resourceType: ResourceErrorType): {
7
+ errors: BaseError[];
8
+ values: BaseState;
9
+ };
10
+ }
11
+ export interface ValidateValue {
12
+ <V extends string | boolean, N extends string, T extends string, B extends ResourceErrorType>(val: V, name: N, type: T, resourceType: B): BaseError | Record<string, any>;
13
+ }
14
+ export declare const validateValue: ValidateValue;
15
+ declare const validateFormFields: ValidateFormFields;
16
+ export interface FieldsExist {
17
+ (address: AddressCreate, schema?: AddressField[]): boolean;
18
+ }
19
+ export declare const fieldsExist: FieldsExist;
20
+ export default validateFormFields;
@@ -0,0 +1 @@
1
+ import isEmpty from"lodash/isEmpty";import isString from"lodash/isString";import without from"lodash/without";import keys from"lodash/keys";import map from"lodash/map";import get from"lodash/get";import{addressFields}from"../reducers/AddressReducer";const EMAIL_PATTERN=/[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$/;export const validateValue=(val,name,type,resourceType)=>val?type==="email"&&isString(val)&&!val.match(EMAIL_PATTERN)?{field:name,code:"VALIDATION_ERROR",message:`${name} - is not valid`,resourceType}:{}:{field:name,code:"VALIDATION_ERROR",message:`${name} - is required`,resourceType};const validateFormFields=(fields,required,resourceType)=>{const errors=[];let values={metadata:{}};return map(fields,v=>{const isTick=!!get(v,"checked"),val=isTick||(v.value==="on"?!1:v.value),attrName=v.getAttribute("name");if(attrName&&required.indexOf(attrName)!==-1||v.required){const error=validateValue(val,v.name,v.type,resourceType);isEmpty(error)||errors.push(error),values=Object.assign(Object.assign({},values),{[`${v.name}`]:val})}v.getAttribute("name")&&(values=!!v.getAttribute("data-metadata")?Object.assign(Object.assign({},values),{metadata:Object.assign(Object.assign({},values.metadata),{[`${v.name}`]:val})}):Object.assign(Object.assign({},values),{[`${v.name}`]:val}))}),{errors,values}};export const fieldsExist=(address,schema=addressFields)=>{if(address.business){const required=without(schema,"first_name","last_name"),validAddress=keys(address).filter(k=>required.includes(k));return required.length>validAddress.length}else{const required=without(schema,"line_2","company"),validAddress=keys(address).filter(k=>required.includes(k));return required.length>validAddress.length}};export default validateFormFields;
package/package.json CHANGED
@@ -1,34 +1,55 @@
1
1
  {
2
2
  "name": "@commercelayer/react-components",
3
- "version": "3.0.0-beta.6",
3
+ "version": "3.0.0",
4
4
  "description": "The Official Commerce Layer React Components",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
5
+ "module": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
7
  "files": [
8
- "dist",
8
+ "lib",
9
9
  "package.json",
10
10
  "README.md"
11
11
  ],
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "release": {
16
+ "branches": [
17
+ "+([0-9])?(.{+([0-9]),x}).x",
18
+ "master",
19
+ "next",
20
+ "next-major",
21
+ {
22
+ "name": "beta",
23
+ "prerelease": true
24
+ },
25
+ {
26
+ "name": "alpha",
27
+ "prerelease": true
28
+ }
29
+ ],
30
+ "plugins": [
31
+ "@semantic-release/commit-analyzer",
32
+ "@semantic-release/release-notes-generator",
33
+ "@semantic-release/changelog",
34
+ "@semantic-release/npm",
35
+ "@semantic-release/git",
36
+ [
37
+ "@semantic-release/github",
38
+ {
39
+ "addReleases": "top"
40
+ }
41
+ ]
42
+ ]
43
+ },
12
44
  "scripts": {
13
- "test:cypress:open": "NODE_ENV='testCypress' npm run dev & cypress open",
14
- "test:cypress:record": "NODE_ENV='testCypress' npm run dev & cypress open --env RECORD=1",
15
- "cypress:record": "NODE_ENV='testCypress' cypress open --env RECORD=1",
16
- "test:cypress:github": "NODE_ENV='testCypress' npm run dev & cypress run --record --key 08aefa10-1f17-4776-a40d-01f686ed9125 --env RECORD=1",
17
- "test:cypress:clear": "cypress cache clear",
18
- "test:coverage": "tsdx test --coverage",
19
- "test:watch": "tsdx test --watch",
20
- "test": "tsdx test",
21
- "build": "tsdx build --tsconfig tsconfig.production.json",
22
- "build:watch": "tsdx watch --tsconfig tsconfig.production.json",
23
- "build:transpileOnly": "tsdx build --tsconfig tsconfig.production.json --transpileOnly",
24
- "dev": "NODE_OPTIONS='--inspect' next dev",
25
- "start": "next start",
26
- "size-limit:why": "npm run build && size-limit --why",
27
- "size-limit": "npm run build && size-limit",
45
+ "test": "jest",
46
+ "test:coverage": "jest --coverage",
47
+ "build": "tsc -b tsconfig.prod.json --verbose",
48
+ "postbuild": "tsc-alias -p tsconfig.prod.json && minimize-js lib -w -s",
49
+ "start": "NODE_OPTIONS='--inspect' next dev",
28
50
  "version:fix": "npm version patch",
29
51
  "version:feat": "npm version minor",
30
52
  "version:perf": "npm version major",
31
- "publish:beta": "npm publish --public --tag beta",
32
53
  "publish:fix": "npm run build && npm run version:fix && git push --follow-tags && npm publish --access public",
33
54
  "publish:feat": "npm run build && npm run version:feat && git push --follow-tags && npm publish --access public",
34
55
  "publish:perf": "npm run build && npm run version:perf && git push --follow-tags && npm publish --access public"
@@ -55,87 +76,80 @@
55
76
  "url": "https://github.com/commercelayer/commercelayer-react-components/issues"
56
77
  },
57
78
  "homepage": "https://github.com/commercelayer/commercelayer-react-components#readme",
58
- "size-limit": [
59
- {
60
- "path": "dist/react-components.cjs.production.min.js",
61
- "limit": "55 KB"
62
- },
63
- {
64
- "path": "dist/react-components.esm.js",
65
- "limit": "55 KB"
66
- }
67
- ],
68
79
  "dependencies": {
69
- "@commercelayer/js-sdk": "^3.9.2",
70
- "@stripe/react-stripe-js": "^1.4.1",
71
- "@stripe/stripe-js": "^1.15.0",
72
- "braintree-web": "^3.76.4",
80
+ "@ac-dev/countries-service": "^1.1.3",
81
+ "@ac-dev/states-service": "^1.0.2",
82
+ "@adyen/adyen-web": "^5.3.1",
83
+ "@commercelayer/js-auth": "^2.2.6",
84
+ "@commercelayer/sdk": "^2.3.11",
85
+ "@stripe/react-stripe-js": "^1.6.0",
86
+ "@stripe/stripe-js": "^1.21.2",
87
+ "axios": "^0.24.0",
88
+ "braintree-web": "^3.84.0",
73
89
  "jwt-decode": "^3.1.2",
74
90
  "lodash": "^4.17.21",
75
91
  "lodash-es": "^4.17.21",
76
- "rapid-form": "^1.4.1",
77
- "react-table": "^7.7.0",
78
- "react-window": "^1.8.6"
92
+ "rapid-form": "^1.6.0"
79
93
  },
80
94
  "devDependencies": {
81
- "@babel/plugin-proposal-class-properties": "^7.13.0",
82
- "@babel/preset-env": "^7.14.2",
83
- "@babel/preset-react": "^7.13.13",
84
- "@babel/preset-typescript": "^7.13.0",
85
- "@commercelayer/cypress-vcr": "^1.1.0",
86
- "@commercelayer/js-auth": "^2.0.4",
87
- "@cypress/code-coverage": "^3.9.5",
88
- "@cypress/webpack-preprocessor": "^5.9.0",
89
- "@rollup/plugin-alias": "^3.1.2",
90
- "@size-limit/preset-big-lib": "^4.11.0",
91
- "@tailwindcss/aspect-ratio": "^0.2.1",
92
- "@tailwindcss/forms": "^0.3.2",
95
+ "@babel/plugin-proposal-class-properties": "^7.16.0",
96
+ "@babel/preset-env": "^7.16.4",
97
+ "@babel/preset-react": "^7.16.0",
98
+ "@babel/preset-typescript": "^7.16.0",
99
+ "@playwright/test": "^1.17.1",
100
+ "@semantic-release/changelog": "^6.0.1",
101
+ "@semantic-release/commit-analyzer": "^9.0.2",
102
+ "@semantic-release/git": "^10.0.1",
103
+ "@semantic-release/github": "^8.0.2",
104
+ "@semantic-release/npm": "^8.0.3",
105
+ "@semantic-release/release-notes-generator": "^10.0.3",
106
+ "@tailwindcss/aspect-ratio": "^0.3.0",
107
+ "@tailwindcss/forms": "^0.3.4",
93
108
  "@tailwindcss/typography": "^0.4.1",
94
- "@types/braintree-web": "^3.75.2",
95
- "@types/jest": "^26.0.23",
96
- "@types/lodash": "^4.14.170",
97
- "@types/node": "^15.6.1",
98
- "@types/prop-types": "^15.7.3",
99
- "@types/react": "^17.0.8",
100
- "@types/react-table": "^7.7.1",
109
+ "@types/braintree-web": "^3.75.12",
110
+ "@types/jest": "^27.0.3",
111
+ "@types/lodash": "^4.14.177",
112
+ "@types/node": "^16.11.12",
113
+ "@types/prop-types": "^15.7.4",
114
+ "@types/react": "^17.0.37",
101
115
  "@types/react-test-renderer": "^17.0.1",
102
- "@types/react-window": "^1.8.4",
103
- "@typescript-eslint/eslint-plugin": "^4.25.0",
104
- "@typescript-eslint/parser": "^4.25.0",
116
+ "@typescript-eslint/eslint-plugin": "^5.6.0",
117
+ "@typescript-eslint/parser": "^5.6.0",
105
118
  "@zeit/next-css": "^1.0.1",
106
119
  "@zerollup/ts-transform-paths": "^1.7.18",
107
- "autoprefixer": "^10.2.6",
108
- "babel-jest": "^27.0.1",
109
- "babel-loader": "^8.2.2",
110
- "babel-plugin-istanbul": "^6.0.0",
111
- "cypress": "^7.4.0",
112
- "eslint": "^7.27.0",
120
+ "autoprefixer": "^10.4.0",
121
+ "babel-jest": "^27.4.2",
122
+ "babel-loader": "^8.2.3",
123
+ "babel-plugin-istanbul": "^6.1.1",
124
+ "dotenv": "^10.0.0",
125
+ "eslint": "^8.4.1",
113
126
  "eslint-config-prettier": "^8.3.0",
114
127
  "eslint-config-react-app": "^6.0.0",
115
- "eslint-plugin-react": "^7.23.2",
116
- "eslint-plugin-react-hooks": "^4.2.0",
117
- "jest": "^27.0.1",
118
- "next": "^10.2.3",
119
- "postcss": "^8.3.0",
120
- "postcss-loader": "^5.3.0",
121
- "prettier": "^2.3.0",
128
+ "eslint-plugin-react": "^7.27.1",
129
+ "eslint-plugin-react-hooks": "^4.3.0",
130
+ "jest": "^27.4.3",
131
+ "minimize-js": "^1.2.0",
132
+ "next": "^12.0.7",
133
+ "playwright": "^1.17.1",
134
+ "postcss": "^8.4.4",
135
+ "postcss-loader": "^6.2.1",
136
+ "prettier": "^2.5.1",
122
137
  "prop-types": "^15.7.2",
123
138
  "react": "^17.0.2",
124
139
  "react-dom": "^17.0.2",
125
140
  "react-test-renderer": "^17.0.2",
126
141
  "rollup-plugin-babel": "^4.4.0",
127
142
  "rollup-plugin-node-resolve": "^5.2.0",
128
- "size-limit": "^4.11.0",
129
- "tailwindcss": "^2.1.2",
130
- "ts-jest": "^27.0.1",
131
- "ts-loader": "^9.2.2",
143
+ "tailwindcss": "^2.2.19",
144
+ "ts-jest": "^27.1.0",
145
+ "ts-loader": "^9.2.6",
146
+ "tsc-alias": "^1.4.2",
132
147
  "tsconfig-paths-jest": "^0.0.1",
133
- "tsdx": "^0.14.1",
134
- "ttypescript": "^1.5.12",
135
- "typescript": "^4.3.2"
148
+ "ttypescript": "^1.5.13",
149
+ "typescript": "^4.5.2",
150
+ "v8-to-istanbul": "^8.1.0"
136
151
  },
137
152
  "peerDependencies": {
138
- "react": "^17.0.2",
139
- "react-dom": "^17.0.2"
153
+ "react": "^17.0.2"
140
154
  }
141
155
  }
@@ -1,10 +0,0 @@
1
- import { FunctionComponent, ReactNode } from 'react';
2
- declare type CustomerFieldChildrenProps = Omit<CustomerFieldProps, 'children' | 'name'> & {
3
- text: string;
4
- };
5
- declare type CustomerFieldProps = {
6
- children?: (props: CustomerFieldChildrenProps) => ReactNode;
7
- name: 'email';
8
- } & JSX.IntrinsicElements['p'];
9
- declare const CustomerField: FunctionComponent<CustomerFieldProps>;
10
- export default CustomerField;
@@ -1,10 +0,0 @@
1
- import { FunctionComponent, ReactNode } from 'react';
2
- declare type LineItemChildrenProps = Omit<LineItemImageProps, 'children'> & {
3
- src: string;
4
- };
5
- declare type LineItemImageProps = {
6
- children?: (props: LineItemChildrenProps) => ReactNode;
7
- width?: number;
8
- } & Omit<JSX.IntrinsicElements['img'], 'src' | 'srcSet'>;
9
- declare const LineItemImage: FunctionComponent<LineItemImageProps>;
10
- export default LineItemImage;
@@ -1,7 +0,0 @@
1
- import { FunctionComponent, ReactNode } from 'react';
2
- declare type LineItemNameChildrenProps = Omit<LineItemNameProps, 'children'>;
3
- declare type LineItemNameProps = {
4
- children?: (props: LineItemNameChildrenProps) => ReactNode;
5
- } & JSX.IntrinsicElements['p'];
6
- declare const LineItemName: FunctionComponent<LineItemNameProps>;
7
- export default LineItemName;
@@ -1,7 +0,0 @@
1
- import { FunctionComponent, ReactNode } from 'react';
2
- declare type LineItemNameChildrenProps = Omit<LineItemNameProps, 'children'>;
3
- declare type LineItemNameProps = {
4
- children?: (props: LineItemNameChildrenProps) => ReactNode;
5
- } & JSX.IntrinsicElements['p'];
6
- declare const LineItemSkuCode: FunctionComponent<LineItemNameProps>;
7
- export default LineItemSkuCode;
@@ -1,26 +0,0 @@
1
- import { FunctionComponent, ReactNode, ReactElement } from 'react';
2
- import { InitialOrderListContext } from "../context/OrderListChildrenContext";
3
- import { Column } from 'react-table';
4
- declare type OrderListProps = {
5
- children: ReactNode;
6
- columns: (Column & {
7
- className?: string;
8
- })[];
9
- loadingElement?: ReactElement;
10
- actionsComponent?: InitialOrderListContext['actionsComponent'];
11
- actionsContainerClassName?: string;
12
- showActions?: boolean;
13
- } & JSX.IntrinsicElements['table'] & ({
14
- infiniteScroll: true;
15
- windowOptions?: {
16
- height?: number;
17
- itemSize?: number;
18
- width?: number;
19
- column?: number;
20
- };
21
- } | {
22
- infiniteScroll?: false;
23
- windowOptions?: never;
24
- });
25
- declare const OrderList: FunctionComponent<OrderListProps>;
26
- export default OrderList;
@@ -1,14 +0,0 @@
1
- import { FunctionComponent, ReactNode } from 'react';
2
- import { Cell, Row } from 'react-table';
3
- import OrderAttributes from "../typings/order";
4
- declare type OrderListHeaderChildrenProps = Omit<OrderListHeaderProps, 'children'> & {
5
- order: Record<string, any>;
6
- row: Row;
7
- cell: Cell[];
8
- };
9
- declare type OrderListHeaderProps = {
10
- children?: (props: OrderListHeaderChildrenProps) => ReactNode;
11
- field: keyof OrderAttributes;
12
- } & JSX.IntrinsicElements['td'];
13
- declare const OrderListRow: FunctionComponent<OrderListHeaderProps>;
14
- export default OrderListRow;
@@ -1,11 +0,0 @@
1
- import { LoaderType } from "../typings/index";
2
- import { FunctionComponent } from 'react';
3
- import { PaymentSourceProps } from './PaymentSource';
4
- declare type PaymentGatewayProps = PaymentSourceProps & {
5
- showCard: boolean;
6
- handleEditClick: () => void;
7
- show: boolean;
8
- loader?: LoaderType;
9
- };
10
- declare const PaymentGateway: FunctionComponent<PaymentGatewayProps>;
11
- export default PaymentGateway;
@@ -1,9 +0,0 @@
1
- import { FunctionComponent, ReactNode } from 'react';
2
- import { ShippingMethodCollection } from '@commercelayer/js-sdk';
3
- declare type ShippingMethodRadioButtonChildrenProps = Omit<ShippingMethodRadioButtonProps, 'children'>;
4
- declare type ShippingMethodRadioButtonProps = {
5
- children?: (props: ShippingMethodRadioButtonChildrenProps) => ReactNode;
6
- onChange?: (shippingMethod: ShippingMethodCollection | Record<string, any>) => void;
7
- } & JSX.IntrinsicElements['input'];
8
- declare const ShippingMethodRadioButton: FunctionComponent<ShippingMethodRadioButtonProps>;
9
- export default ShippingMethodRadioButton;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { BaseInputComponentProps } from "../../typings/index";
3
- export declare type BaseInputProps = BaseInputComponentProps & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['textarea'];
4
- declare const _default: React.ForwardRefExoticComponent<Pick<BaseInputProps, "children" | "form" | "list" | "name" | "onChange" | "placeholder" | "key" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "max" | "maxLength" | "min" | "minLength" | "multiple" | "pattern" | "readOnly" | "required" | "size" | "src" | "step" | "type" | "value" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "cols" | "dirName" | "rows" | "wrap"> & React.RefAttributes<any>>;
5
- export default _default;
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import { LineItemCollection } from '@commercelayer/js-sdk';
3
- export interface InitialLineItemContext {
4
- lineItem: LineItemCollection | Record<string, any>;
5
- }
6
- declare const LineItemChildrenContext: import("react").Context<InitialLineItemContext>;
7
- export default LineItemChildrenContext;
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { OrderState } from "../reducers/OrderReducer";
3
- declare const OrderContext: import("react").Context<OrderState>;
4
- export default OrderContext;
@@ -1,14 +0,0 @@
1
- import OrderAttributes from "../typings/order";
2
- import { ReactNode } from 'react';
3
- import { Row } from 'react-table';
4
- export interface InitialOrderListContext {
5
- order: OrderAttributes | null;
6
- row: Row<OrderAttributes>;
7
- showActions: boolean;
8
- actionsComponent?: (props: {
9
- order: OrderAttributes;
10
- }) => ReactNode;
11
- actionsContainerClassName?: string;
12
- }
13
- declare const OrderListChildrenContext: import("react").Context<InitialOrderListContext>;
14
- export default OrderListChildrenContext;
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- import { DeliveryLeadTimeCollection, LineItemCollection, ShipmentCollection, ShippingMethodCollection, StockTransferCollection } from '@commercelayer/js-sdk';
3
- export interface InitialShipmentContext {
4
- lineItems?: LineItemCollection[];
5
- shippingMethods?: ShippingMethodCollection[];
6
- currentShippingMethodId?: string;
7
- stockTransfers?: StockTransferCollection[];
8
- deliveryLeadTimes?: DeliveryLeadTimeCollection[] | null;
9
- shipment?: ShipmentCollection;
10
- keyNumber: number;
11
- }
12
- declare const ShipmentChildrenContext: import("react").Context<InitialShipmentContext>;
13
- export default ShipmentChildrenContext;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { DeliveryLeadTimeCollection, ShippingMethodCollection } from '@commercelayer/js-sdk';
3
- export interface InitialShippingMethodContext {
4
- shippingMethod: ShippingMethodCollection | Record<string, string>;
5
- deliveryLeadTimeForShipment?: DeliveryLeadTimeCollection | Record<string, string> | null;
6
- currentShippingMethodId?: string;
7
- }
8
- declare const ShippingMethodChildrenContext: import("react").Context<InitialShippingMethodContext>;
9
- export default ShippingMethodChildrenContext;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const SkuListsContext: import("react").Context<import("../reducers/SkuListsReducer").SkuListsState>;
3
- export default SkuListsContext;