@commercelayer/react-components 4.0.1 → 4.1.0-beta.2

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 (338) hide show
  1. package/lib/cjs/components/ExternalFunction.d.ts +2 -9
  2. package/lib/cjs/components/ExternalFunction.js +1 -1
  3. package/lib/cjs/components/MetadataInput.d.ts +1 -11
  4. package/lib/cjs/components/MetadataInput.js +1 -1
  5. package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +1 -17
  6. package/lib/cjs/components/addresses/AddressCountrySelector.js +1 -1
  7. package/lib/cjs/components/addresses/AddressField.d.ts +2 -2
  8. package/lib/cjs/components/addresses/AddressInput.d.ts +1 -1
  9. package/lib/cjs/components/addresses/AddressStateSelector.d.ts +1 -17
  10. package/lib/cjs/components/addresses/AddressStateSelector.js +1 -1
  11. package/lib/cjs/components/addresses/BillingAddressContainer.d.ts +1 -1
  12. package/lib/cjs/components/addresses/BillingAddressForm.d.ts +1 -6
  13. package/lib/cjs/components/addresses/BillingAddressForm.js +1 -1
  14. package/lib/cjs/components/addresses/ShippingAddressContainer.d.ts +4 -9
  15. package/lib/cjs/components/addresses/ShippingAddressContainer.js +1 -1
  16. package/lib/cjs/components/addresses/ShippingAddressForm.d.ts +2 -7
  17. package/lib/cjs/components/addresses/ShippingAddressForm.js +1 -1
  18. package/lib/cjs/components/customers/CustomerAddressForm.d.ts +2 -7
  19. package/lib/cjs/components/customers/CustomerAddressForm.js +1 -1
  20. package/lib/cjs/components/customers/CustomerField.d.ts +3 -3
  21. package/lib/cjs/components/customers/CustomerInput.d.ts +2 -14
  22. package/lib/cjs/components/customers/CustomerInput.js +1 -1
  23. package/lib/cjs/components/errors/Errors.d.ts +5 -0
  24. package/lib/cjs/components/errors/Errors.js +1 -0
  25. package/lib/cjs/components/gift_cards/GiftCard.d.ts +2 -12
  26. package/lib/cjs/components/gift_cards/GiftCard.js +1 -1
  27. package/lib/cjs/components/gift_cards/GiftCardContainer.d.ts +2 -8
  28. package/lib/cjs/components/gift_cards/GiftCardContainer.js +1 -1
  29. package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +1 -16
  30. package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.js +1 -1
  31. package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +2 -11
  32. package/lib/cjs/components/gift_cards/GiftCardInput.js +1 -1
  33. package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.d.ts +1 -6
  34. package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.js +1 -1
  35. package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +2 -11
  36. package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.js +1 -1
  37. package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +1 -1
  38. package/lib/cjs/components/line_items/LineItem.js +1 -1
  39. package/lib/cjs/components/line_items/LineItemAmount.d.ts +1 -1
  40. package/lib/cjs/components/line_items/LineItemField.d.ts +3 -3
  41. package/lib/cjs/components/line_items/LineItemImage.d.ts +1 -1
  42. package/lib/cjs/components/line_items/LineItemOptions.d.ts +1 -1
  43. package/lib/cjs/components/line_items/LineItemQuantity.d.ts +2 -2
  44. package/lib/cjs/components/line_items/LineItemsCount.d.ts +1 -1
  45. package/lib/cjs/components/orders/AddToCartButton.d.ts +4 -4
  46. package/lib/cjs/components/orders/OrderContainer.d.ts +12 -0
  47. package/lib/cjs/components/orders/OrderList.d.ts +24 -7
  48. package/lib/cjs/components/orders/OrderList.js +1 -1
  49. package/lib/cjs/components/orders/OrderListPaginationButtons.d.ts +44 -0
  50. package/lib/cjs/components/orders/OrderListPaginationButtons.js +1 -0
  51. package/lib/cjs/components/orders/OrderListPaginationInfo.d.ts +29 -0
  52. package/lib/cjs/components/orders/OrderListPaginationInfo.js +1 -0
  53. package/lib/cjs/components/orders/OrderListRow.d.ts +3 -0
  54. package/lib/cjs/components/orders/OrderListRow.js +1 -1
  55. package/lib/cjs/components/orders/OrderNumber.d.ts +1 -7
  56. package/lib/cjs/components/orders/OrderNumber.js +1 -1
  57. package/lib/cjs/components/orders/OrderStorage.d.ts +2 -10
  58. package/lib/cjs/components/orders/OrderStorage.js +1 -1
  59. package/lib/cjs/components/parcels/ParcelField.d.ts +3 -3
  60. package/lib/cjs/components/parcels/ParcelLineItemField.d.ts +3 -3
  61. package/lib/cjs/components/payment_gateways/AdyenGateway.d.ts +1 -1
  62. package/lib/cjs/components/payment_gateways/BraintreeGateway.d.ts +1 -1
  63. package/lib/cjs/components/payment_gateways/CheckoutComGateway.d.ts +1 -1
  64. package/lib/cjs/components/payment_gateways/KlarnaGateway.d.ts +1 -1
  65. package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +2 -2
  66. package/lib/cjs/components/payment_gateways/PaypalGateway.d.ts +1 -1
  67. package/lib/cjs/components/payment_gateways/StripeGateway.d.ts +1 -1
  68. package/lib/cjs/components/payment_gateways/WireTransferGateway.d.ts +1 -1
  69. package/lib/cjs/components/payment_methods/PaymentMethod.d.ts +1 -1
  70. package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.d.ts +1 -1
  71. package/lib/cjs/components/payment_source/AdyenPayment.d.ts +2 -2
  72. package/lib/cjs/components/payment_source/BraintreePayment.d.ts +3 -3
  73. package/lib/cjs/components/payment_source/CheckoutComPayment.d.ts +2 -2
  74. package/lib/cjs/components/payment_source/KlarnaPayment.d.ts +1 -1
  75. package/lib/cjs/components/payment_source/PaymentSourceDetail.d.ts +1 -1
  76. package/lib/cjs/components/payment_source/PaymentSourceEditButton.d.ts +1 -1
  77. package/lib/cjs/components/payment_source/PaypalPayment.d.ts +2 -2
  78. package/lib/cjs/components/payment_source/StripePayment.d.ts +2 -2
  79. package/lib/cjs/components/payment_source/WireTransferPayment.d.ts +2 -2
  80. package/lib/cjs/components/shipments/ShipmentField.d.ts +2 -2
  81. package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +1 -1
  82. package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +1 -13
  83. package/lib/cjs/components/shipping_methods/ShippingMethodPrice.js +1 -1
  84. package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.d.ts +3 -9
  85. package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.js +1 -1
  86. package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +2 -2
  87. package/lib/cjs/components/skus/DeliveryLeadTime.d.ts +3 -10
  88. package/lib/cjs/components/skus/DeliveryLeadTime.js +1 -1
  89. package/lib/cjs/components/skus/SkuField.d.ts +3 -3
  90. package/lib/cjs/components/skus/SkuList.d.ts +5 -9
  91. package/lib/cjs/components/skus/SkuList.js +1 -1
  92. package/lib/cjs/components/skus/SkuListsContainer.d.ts +2 -8
  93. package/lib/cjs/components/skus/SkuListsContainer.js +1 -1
  94. package/lib/cjs/components/skus/Skus.d.ts +2 -7
  95. package/lib/cjs/components/skus/Skus.js +1 -1
  96. package/lib/cjs/components/stock_transfers/StockTransferField.d.ts +3 -3
  97. package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +2 -2
  98. package/lib/cjs/components/utils/BaseField.d.ts +1 -1
  99. package/lib/cjs/components/utils/BaseInput.d.ts +2 -2
  100. package/lib/cjs/components/utils/BaseOrderPrice.d.ts +1 -1
  101. package/lib/cjs/components/utils/BaseSelect.d.ts +1 -1
  102. package/lib/cjs/components/utils/GenericFieldComponent.d.ts +3 -3
  103. package/lib/cjs/components/utils/Parent.d.ts +1 -1
  104. package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +4 -4
  105. package/lib/cjs/components/utils/PriceTemplate.d.ts +1 -1
  106. package/lib/cjs/components/utils/getAllErrors.d.ts +1 -1
  107. package/lib/cjs/context/AddressContext.d.ts +1 -1
  108. package/lib/cjs/context/BillingAddressContext.d.ts +1 -1
  109. package/lib/cjs/context/BillingAddressFormContext.d.ts +1 -1
  110. package/lib/cjs/context/CouponAndGiftCardFormContext.d.ts +1 -1
  111. package/lib/cjs/context/CustomerAddressFormContext.d.ts +1 -1
  112. package/lib/cjs/context/CustomerContext.d.ts +1 -1
  113. package/lib/cjs/context/ExternalFunctionContext.d.ts +1 -1
  114. package/lib/cjs/context/LineItemChildrenContext.d.ts +1 -1
  115. package/lib/cjs/context/OrderListChildrenContext.d.ts +1 -1
  116. package/lib/cjs/context/OrderListPaginationContext.d.ts +19 -0
  117. package/lib/cjs/context/OrderListPaginationContext.js +1 -0
  118. package/lib/cjs/context/PaymentMethodContext.d.ts +1 -1
  119. package/lib/cjs/context/PaymentSourceContext.d.ts +2 -2
  120. package/lib/cjs/context/PlaceOrderContext.d.ts +1 -1
  121. package/lib/cjs/context/ShipmentContext.d.ts +1 -1
  122. package/lib/cjs/context/ShippingAddressContext.d.ts +1 -1
  123. package/lib/cjs/context/SkuChildrenContext.d.ts +1 -1
  124. package/lib/cjs/context/SkuContext.d.ts +1 -1
  125. package/lib/cjs/hooks/useOrderContainer.d.ts +6 -0
  126. package/lib/cjs/hooks/useOrderContainer.js +1 -0
  127. package/lib/cjs/index.d.ts +1 -1
  128. package/lib/cjs/index.js +1 -1
  129. package/lib/cjs/reducers/AddressReducer.d.ts +10 -10
  130. package/lib/cjs/reducers/AvailabilityReducer.d.ts +4 -4
  131. package/lib/cjs/reducers/BillingAddressReducer.d.ts +4 -4
  132. package/lib/cjs/reducers/CustomerReducer.d.ts +6 -6
  133. package/lib/cjs/reducers/GiftCardReducer.d.ts +12 -22
  134. package/lib/cjs/reducers/GiftCardReducer.js +1 -1
  135. package/lib/cjs/reducers/LineItemReducer.d.ts +4 -4
  136. package/lib/cjs/reducers/OrderReducer.d.ts +19 -19
  137. package/lib/cjs/reducers/OrderReducer.js +1 -1
  138. package/lib/cjs/reducers/PaymentMethodReducer.d.ts +17 -17
  139. package/lib/cjs/reducers/PlaceOrderReducer.d.ts +5 -5
  140. package/lib/cjs/reducers/PriceReducer.d.ts +3 -3
  141. package/lib/cjs/reducers/ShipmentReducer.d.ts +6 -6
  142. package/lib/cjs/reducers/ShippingAddressReducer.d.ts +4 -4
  143. package/lib/cjs/reducers/SkuListsReducer.d.ts +3 -3
  144. package/lib/cjs/reducers/SkuReducer.d.ts +3 -3
  145. package/lib/cjs/typings/errors.d.ts +5 -5
  146. package/lib/cjs/typings/index.d.ts +25 -25
  147. package/lib/cjs/utils/PropsType.d.ts +4 -4
  148. package/lib/cjs/utils/addressesManager.d.ts +3 -3
  149. package/lib/cjs/utils/checkIncludeResource.d.ts +1 -1
  150. package/lib/cjs/utils/compareObjAttribute.d.ts +2 -2
  151. package/lib/cjs/utils/filterChildren.d.ts +8 -0
  152. package/lib/cjs/utils/filterChildren.js +1 -0
  153. package/lib/cjs/utils/getCardDetails.d.ts +2 -2
  154. package/lib/cjs/utils/getCartLink.d.ts +1 -1
  155. package/lib/cjs/utils/getErrors.d.ts +1 -1
  156. package/lib/cjs/utils/getLineItemsCount.d.ts +1 -1
  157. package/lib/cjs/utils/hooks/useCustomContext.js +1 -1
  158. package/lib/cjs/utils/jwt.d.ts +1 -1
  159. package/lib/cjs/utils/localStorage.d.ts +1 -1
  160. package/lib/cjs/utils/omit.d.ts +1 -0
  161. package/lib/cjs/utils/omit.js +1 -0
  162. package/lib/esm/components/ExternalFunction.d.ts +2 -9
  163. package/lib/esm/components/ExternalFunction.js +1 -1
  164. package/lib/esm/components/MetadataInput.d.ts +1 -11
  165. package/lib/esm/components/MetadataInput.js +1 -1
  166. package/lib/esm/components/addresses/AddressCountrySelector.d.ts +1 -17
  167. package/lib/esm/components/addresses/AddressCountrySelector.js +1 -1
  168. package/lib/esm/components/addresses/AddressField.d.ts +2 -2
  169. package/lib/esm/components/addresses/AddressInput.d.ts +1 -1
  170. package/lib/esm/components/addresses/AddressStateSelector.d.ts +1 -17
  171. package/lib/esm/components/addresses/AddressStateSelector.js +1 -1
  172. package/lib/esm/components/addresses/BillingAddressContainer.d.ts +1 -1
  173. package/lib/esm/components/addresses/BillingAddressForm.d.ts +1 -6
  174. package/lib/esm/components/addresses/BillingAddressForm.js +1 -1
  175. package/lib/esm/components/addresses/ShippingAddressContainer.d.ts +4 -9
  176. package/lib/esm/components/addresses/ShippingAddressContainer.js +1 -1
  177. package/lib/esm/components/addresses/ShippingAddressForm.d.ts +2 -7
  178. package/lib/esm/components/addresses/ShippingAddressForm.js +1 -1
  179. package/lib/esm/components/customers/CustomerAddressForm.d.ts +2 -7
  180. package/lib/esm/components/customers/CustomerAddressForm.js +1 -1
  181. package/lib/esm/components/customers/CustomerField.d.ts +3 -3
  182. package/lib/esm/components/customers/CustomerInput.d.ts +2 -14
  183. package/lib/esm/components/customers/CustomerInput.js +1 -1
  184. package/lib/esm/components/errors/Errors.d.ts +5 -0
  185. package/lib/esm/components/errors/Errors.js +1 -0
  186. package/lib/esm/components/gift_cards/GiftCard.d.ts +2 -12
  187. package/lib/esm/components/gift_cards/GiftCard.js +1 -1
  188. package/lib/esm/components/gift_cards/GiftCardContainer.d.ts +2 -8
  189. package/lib/esm/components/gift_cards/GiftCardContainer.js +1 -1
  190. package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +1 -16
  191. package/lib/esm/components/gift_cards/GiftCardCurrencySelector.js +1 -1
  192. package/lib/esm/components/gift_cards/GiftCardInput.d.ts +2 -11
  193. package/lib/esm/components/gift_cards/GiftCardInput.js +1 -1
  194. package/lib/esm/components/gift_cards/GiftCardOrCouponForm.d.ts +1 -6
  195. package/lib/esm/components/gift_cards/GiftCardOrCouponForm.js +1 -1
  196. package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +2 -11
  197. package/lib/esm/components/gift_cards/GiftCardOrCouponInput.js +1 -1
  198. package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +1 -1
  199. package/lib/esm/components/line_items/LineItem.js +1 -1
  200. package/lib/esm/components/line_items/LineItemAmount.d.ts +1 -1
  201. package/lib/esm/components/line_items/LineItemField.d.ts +3 -3
  202. package/lib/esm/components/line_items/LineItemImage.d.ts +1 -1
  203. package/lib/esm/components/line_items/LineItemOptions.d.ts +1 -1
  204. package/lib/esm/components/line_items/LineItemQuantity.d.ts +2 -2
  205. package/lib/esm/components/line_items/LineItemsCount.d.ts +1 -1
  206. package/lib/esm/components/orders/AddToCartButton.d.ts +4 -4
  207. package/lib/esm/components/orders/OrderContainer.d.ts +12 -0
  208. package/lib/esm/components/orders/OrderList.d.ts +24 -7
  209. package/lib/esm/components/orders/OrderList.js +1 -1
  210. package/lib/esm/components/orders/OrderListPaginationButtons.d.ts +44 -0
  211. package/lib/esm/components/orders/OrderListPaginationButtons.js +1 -0
  212. package/lib/esm/components/orders/OrderListPaginationInfo.d.ts +29 -0
  213. package/lib/esm/components/orders/OrderListPaginationInfo.js +1 -0
  214. package/lib/esm/components/orders/OrderListRow.d.ts +3 -0
  215. package/lib/esm/components/orders/OrderListRow.js +1 -1
  216. package/lib/esm/components/orders/OrderNumber.d.ts +1 -7
  217. package/lib/esm/components/orders/OrderNumber.js +1 -1
  218. package/lib/esm/components/orders/OrderStorage.d.ts +2 -10
  219. package/lib/esm/components/orders/OrderStorage.js +1 -1
  220. package/lib/esm/components/parcels/ParcelField.d.ts +3 -3
  221. package/lib/esm/components/parcels/ParcelLineItemField.d.ts +3 -3
  222. package/lib/esm/components/payment_gateways/AdyenGateway.d.ts +1 -1
  223. package/lib/esm/components/payment_gateways/BraintreeGateway.d.ts +1 -1
  224. package/lib/esm/components/payment_gateways/CheckoutComGateway.d.ts +1 -1
  225. package/lib/esm/components/payment_gateways/KlarnaGateway.d.ts +1 -1
  226. package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +2 -2
  227. package/lib/esm/components/payment_gateways/PaypalGateway.d.ts +1 -1
  228. package/lib/esm/components/payment_gateways/StripeGateway.d.ts +1 -1
  229. package/lib/esm/components/payment_gateways/WireTransferGateway.d.ts +1 -1
  230. package/lib/esm/components/payment_methods/PaymentMethod.d.ts +1 -1
  231. package/lib/esm/components/payment_methods/PaymentMethodRadioButton.d.ts +1 -1
  232. package/lib/esm/components/payment_source/AdyenPayment.d.ts +2 -2
  233. package/lib/esm/components/payment_source/BraintreePayment.d.ts +3 -3
  234. package/lib/esm/components/payment_source/CheckoutComPayment.d.ts +2 -2
  235. package/lib/esm/components/payment_source/KlarnaPayment.d.ts +1 -1
  236. package/lib/esm/components/payment_source/PaymentSourceDetail.d.ts +1 -1
  237. package/lib/esm/components/payment_source/PaymentSourceEditButton.d.ts +1 -1
  238. package/lib/esm/components/payment_source/PaypalPayment.d.ts +2 -2
  239. package/lib/esm/components/payment_source/StripePayment.d.ts +2 -2
  240. package/lib/esm/components/payment_source/WireTransferPayment.d.ts +2 -2
  241. package/lib/esm/components/shipments/ShipmentField.d.ts +2 -2
  242. package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +1 -1
  243. package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +1 -13
  244. package/lib/esm/components/shipping_methods/ShippingMethodPrice.js +1 -1
  245. package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.d.ts +3 -9
  246. package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.js +1 -1
  247. package/lib/esm/components/skus/AvailabilityTemplate.d.ts +2 -2
  248. package/lib/esm/components/skus/DeliveryLeadTime.d.ts +3 -10
  249. package/lib/esm/components/skus/DeliveryLeadTime.js +1 -1
  250. package/lib/esm/components/skus/SkuField.d.ts +3 -3
  251. package/lib/esm/components/skus/SkuList.d.ts +5 -9
  252. package/lib/esm/components/skus/SkuList.js +1 -1
  253. package/lib/esm/components/skus/SkuListsContainer.d.ts +2 -8
  254. package/lib/esm/components/skus/SkuListsContainer.js +1 -1
  255. package/lib/esm/components/skus/Skus.d.ts +2 -7
  256. package/lib/esm/components/skus/Skus.js +1 -1
  257. package/lib/esm/components/stock_transfers/StockTransferField.d.ts +3 -3
  258. package/lib/esm/components/utils/AddressCardsTemplate.d.ts +2 -2
  259. package/lib/esm/components/utils/BaseField.d.ts +1 -1
  260. package/lib/esm/components/utils/BaseInput.d.ts +2 -2
  261. package/lib/esm/components/utils/BaseOrderPrice.d.ts +1 -1
  262. package/lib/esm/components/utils/BaseSelect.d.ts +1 -1
  263. package/lib/esm/components/utils/GenericFieldComponent.d.ts +3 -3
  264. package/lib/esm/components/utils/Parent.d.ts +1 -1
  265. package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +4 -4
  266. package/lib/esm/components/utils/PriceTemplate.d.ts +1 -1
  267. package/lib/esm/components/utils/getAllErrors.d.ts +1 -1
  268. package/lib/esm/context/AddressContext.d.ts +1 -1
  269. package/lib/esm/context/BillingAddressContext.d.ts +1 -1
  270. package/lib/esm/context/BillingAddressFormContext.d.ts +1 -1
  271. package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +1 -1
  272. package/lib/esm/context/CustomerAddressFormContext.d.ts +1 -1
  273. package/lib/esm/context/CustomerContext.d.ts +1 -1
  274. package/lib/esm/context/ExternalFunctionContext.d.ts +1 -1
  275. package/lib/esm/context/LineItemChildrenContext.d.ts +1 -1
  276. package/lib/esm/context/OrderListChildrenContext.d.ts +1 -1
  277. package/lib/esm/context/OrderListPaginationContext.d.ts +19 -0
  278. package/lib/esm/context/OrderListPaginationContext.js +1 -0
  279. package/lib/esm/context/PaymentMethodContext.d.ts +1 -1
  280. package/lib/esm/context/PaymentSourceContext.d.ts +2 -2
  281. package/lib/esm/context/PlaceOrderContext.d.ts +1 -1
  282. package/lib/esm/context/ShipmentContext.d.ts +1 -1
  283. package/lib/esm/context/ShippingAddressContext.d.ts +1 -1
  284. package/lib/esm/context/SkuChildrenContext.d.ts +1 -1
  285. package/lib/esm/context/SkuContext.d.ts +1 -1
  286. package/lib/esm/hooks/useOrderContainer.d.ts +6 -0
  287. package/lib/esm/hooks/useOrderContainer.js +1 -0
  288. package/lib/esm/index.d.ts +1 -1
  289. package/lib/esm/index.js +1 -1
  290. package/lib/esm/reducers/AddressReducer.d.ts +10 -10
  291. package/lib/esm/reducers/AvailabilityReducer.d.ts +4 -4
  292. package/lib/esm/reducers/BillingAddressReducer.d.ts +4 -4
  293. package/lib/esm/reducers/CustomerReducer.d.ts +6 -6
  294. package/lib/esm/reducers/GiftCardReducer.d.ts +12 -22
  295. package/lib/esm/reducers/GiftCardReducer.js +1 -1
  296. package/lib/esm/reducers/LineItemReducer.d.ts +4 -4
  297. package/lib/esm/reducers/OrderReducer.d.ts +19 -19
  298. package/lib/esm/reducers/OrderReducer.js +1 -1
  299. package/lib/esm/reducers/PaymentMethodReducer.d.ts +17 -17
  300. package/lib/esm/reducers/PlaceOrderReducer.d.ts +5 -5
  301. package/lib/esm/reducers/PriceReducer.d.ts +3 -3
  302. package/lib/esm/reducers/ShipmentReducer.d.ts +6 -6
  303. package/lib/esm/reducers/ShippingAddressReducer.d.ts +4 -4
  304. package/lib/esm/reducers/SkuListsReducer.d.ts +3 -3
  305. package/lib/esm/reducers/SkuReducer.d.ts +3 -3
  306. package/lib/esm/typings/errors.d.ts +5 -5
  307. package/lib/esm/typings/index.d.ts +25 -25
  308. package/lib/esm/utils/PropsType.d.ts +4 -4
  309. package/lib/esm/utils/addressesManager.d.ts +3 -3
  310. package/lib/esm/utils/checkIncludeResource.d.ts +1 -1
  311. package/lib/esm/utils/compareObjAttribute.d.ts +2 -2
  312. package/lib/esm/utils/filterChildren.d.ts +8 -0
  313. package/lib/esm/utils/filterChildren.js +1 -0
  314. package/lib/esm/utils/getCardDetails.d.ts +2 -2
  315. package/lib/esm/utils/getCartLink.d.ts +1 -1
  316. package/lib/esm/utils/getErrors.d.ts +1 -1
  317. package/lib/esm/utils/getLineItemsCount.d.ts +1 -1
  318. package/lib/esm/utils/hooks/useCustomContext.js +1 -1
  319. package/lib/esm/utils/jwt.d.ts +1 -1
  320. package/lib/esm/utils/localStorage.d.ts +1 -1
  321. package/lib/esm/utils/omit.d.ts +1 -0
  322. package/lib/esm/utils/omit.js +1 -0
  323. package/lib/tsconfig.prod.esm.tsbuildinfo +1 -1
  324. package/lib/tsconfig.prod.tsbuildinfo +1 -1
  325. package/package.json +45 -81
  326. package/README.md +0 -302
  327. package/lib/cjs/components/Errors.d.ts +0 -5
  328. package/lib/cjs/components/Errors.js +0 -1
  329. package/lib/cjs/config/components.d.ts +0 -860
  330. package/lib/cjs/config/components.js +0 -1
  331. package/lib/cjs/utils/childrenTypes.d.ts +0 -9
  332. package/lib/cjs/utils/childrenTypes.js +0 -1
  333. package/lib/esm/components/Errors.d.ts +0 -5
  334. package/lib/esm/components/Errors.js +0 -1
  335. package/lib/esm/config/components.d.ts +0 -860
  336. package/lib/esm/config/components.js +0 -1
  337. package/lib/esm/utils/childrenTypes.d.ts +0 -9
  338. package/lib/esm/utils/childrenTypes.js +0 -1
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ import { ChildrenFunction } from '../../typings/index';
3
+ type TAsComponent = keyof Pick<JSX.IntrinsicElements, 'p' | 'span' | 'div'>;
4
+ type ChildrenProps<A extends TAsComponent> = Omit<Props<A>, 'children'> & {
5
+ /**
6
+ * Current number of the first page row to display
7
+ */
8
+ firstRow: number;
9
+ /**
10
+ * Current number of the last page row to display
11
+ */
12
+ lastRow: number;
13
+ /**
14
+ * Total number of rows to display
15
+ */
16
+ totRows: number;
17
+ };
18
+ type Props<A extends TAsComponent> = {
19
+ children?: ChildrenFunction<ChildrenProps<A>>;
20
+ /**
21
+ * HTML Tag to display
22
+ */
23
+ as?: TAsComponent;
24
+ } & Omit<JSX.IntrinsicElements[A], 'children' | 'ref'>;
25
+ export declare function OrderListPaginationInfo<A extends TAsComponent = 'span'>({ as, children, ...props }: Props<A>): JSX.Element;
26
+ export declare namespace OrderListPaginationInfo {
27
+ var displayName: string;
28
+ }
29
+ export default OrderListPaginationInfo;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import OrderListPaginationContext from"../../context/OrderListPaginationContext";import useCustomContext from"../../utils/hooks/useCustomContext";export function OrderListPaginationInfo({as="span",children,...props}){const ctx=useCustomContext({context:OrderListPaginationContext,contextComponentName:"OrderList",currentComponentName:"OrderListPaginationInfo"}),TagElement=as,totRows=ctx?.totalRows??0,pageIndex=ctx?.pageIndex??0,pageSize=ctx?.pageSize??10;let firstRow=pageIndex===0?pageIndex+1:pageIndex,lastRow=firstRow*pageSize;ctx?.canPreviousPage===!0&&(firstRow=Math.floor(firstRow*10)+1,lastRow=Math.floor(firstRow+pageSize-1)),ctx?.canNextPage===!1&&(lastRow=totRows);const parentProps={...props,as,firstRow,lastRow,totRows};return children==null?_jsx(TagElement,{...props,children:`${firstRow} - ${lastRow} of ${totRows}`}):_jsx(Parent,{...parentProps,children})}OrderListPaginationInfo.displayName="OrderListPaginationInfo";export default OrderListPaginationInfo;
@@ -31,4 +31,7 @@ interface Props extends Omit<JSX.IntrinsicElements['td'], 'children'> {
31
31
  field: keyof Order;
32
32
  }
33
33
  export declare function OrderListRow({ field, children, ...p }: Props): JSX.Element;
34
+ export declare namespace OrderListRow {
35
+ var displayName: string;
36
+ }
34
37
  export default OrderListRow;
@@ -1 +1 @@
1
- import{createElement as _createElement}from"react";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{useContext}from"react";import Parent from"../utils/Parent";import OrderListChildrenContext from"../../context/OrderListChildrenContext";import isDate from"../../utils/isDate";import last from"lodash/last";export function OrderListRow({field,children,...p}){const{order,row,showActions,actionsComponent,actionsContainerClassName,infiniteScroll}=useContext(OrderListChildrenContext),cell=row?.cells.filter(cell2=>cell2.column.id===field),isLastRow=last(row?.cells)?.column.id===field,As=infiniteScroll?"div":"td",ActionRow=()=>showActions&&isLastRow&&actionsComponent&&_jsx(As,{"data-testid":"action-cell",...p,className:actionsContainerClassName,children:_jsx(Parent,{...parentProps,children:actionsComponent})})||null,parentProps={...p,field,order,row,cell,infiniteScroll};return children?_jsxs(_Fragment,{children:[_jsx(Parent,{...parentProps,children}),_jsx(ActionRow,{})]}):_jsxs(_Fragment,{children:[cell?.map((cell2,k)=>{const cellValue=cell2.value,value=isDate(cellValue)?new Date(Date.parse(cellValue)).toLocaleString():cell2.render("Cell");return _createElement(As,{"data-testid":`cell-${k}`,...p,...cell2.getCellProps(),key:k},value)}),_jsx(ActionRow,{})]})}export default OrderListRow;
1
+ import{createElement as _createElement}from"react";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";import{useContext}from"react";import Parent from"../utils/Parent";import OrderListChildrenContext from"../../context/OrderListChildrenContext";import isDate from"../../utils/isDate";import last from"lodash/last";export function OrderListRow({field,children,...p}){const{order,row,showActions,actionsComponent,actionsContainerClassName,infiniteScroll}=useContext(OrderListChildrenContext),cell=row?.cells.filter(cell2=>cell2.column.id===field),isLastRow=last(row?.cells)?.column.id===field,As=infiniteScroll?"div":"td",ActionRow=()=>showActions&&isLastRow&&actionsComponent&&_jsx(As,{"data-testid":"action-cell",...p,className:actionsContainerClassName,children:_jsx(Parent,{...parentProps,children:actionsComponent})})||null,parentProps={...p,field,order,row,cell,infiniteScroll};return children?_jsxs(_Fragment,{children:[_jsx(Parent,{...parentProps,children}),_jsx(ActionRow,{})]}):_jsxs(_Fragment,{children:[cell?.map((cell2,k)=>{const cellValue=cell2.value,value=isDate(cellValue)?new Date(Date.parse(cellValue)).toLocaleString():cell2.render("Cell");return _createElement(As,{"data-testid":`cell-${k}`,...p,...cell2.getCellProps(),key:k},value)}),_jsx(ActionRow,{})]})}OrderListRow.displayName="OrderListRow";export default OrderListRow;
@@ -1,11 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { BaseFieldProps } from '../utils/BaseField';
3
- declare type Props = Omit<BaseFieldProps, 'attribute'>;
3
+ type Props = Omit<BaseFieldProps, 'attribute'>;
4
4
  export declare function OrderNumber(props: Props): JSX.Element;
5
- export declare namespace OrderNumber {
6
- var propTypes: {
7
- className: import("prop-types").Requireable<string>;
8
- };
9
- var displayName: string;
10
- }
11
5
  export default OrderNumber;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import components from"../../config/components";import BaseField from"../utils/BaseField";const propTypes=components.OrderNumber.propTypes,displayName=components.OrderNumber.displayName;export function OrderNumber(props){return _jsx(BaseField,{attribute:"number",...props})}OrderNumber.propTypes=propTypes,OrderNumber.displayName=displayName;export default OrderNumber;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import BaseField from"../utils/BaseField";export function OrderNumber(props){return _jsx(BaseField,{attribute:"number",...props})}export default OrderNumber;
@@ -1,16 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
- declare type Props = {
2
+ interface Props {
3
3
  children: ReactNode;
4
4
  persistKey: string;
5
5
  clearWhenPlaced?: boolean;
6
- };
7
- export declare function OrderStorage(props: Props): JSX.Element;
8
- export declare namespace OrderStorage {
9
- var propTypes: {
10
- children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
11
- clearWhenPlaced: import("prop-types").Requireable<boolean>;
12
- persistKey: import("prop-types").Validator<string>;
13
- };
14
- var displayName: string;
15
6
  }
7
+ export declare function OrderStorage(props: Props): JSX.Element;
16
8
  export default OrderStorage;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import OrderStorageContext from"../../context/OrderStorageContext";import components from"../../config/components";import{getLocalOrder,setLocalOrder,deleteLocalOrder}from"../../utils/localStorage";const propTypes=components.OrderStorage.propTypes,displayName=components.OrderStorage.displayName;export function OrderStorage(props){const{children,clearWhenPlaced=!0,...p}=props;return _jsx(OrderStorageContext.Provider,{value:{...p,setLocalOrder,getLocalOrder,deleteLocalOrder,clearWhenPlaced},children})}OrderStorage.propTypes=propTypes,OrderStorage.displayName=displayName;export default OrderStorage;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import OrderStorageContext from"../../context/OrderStorageContext";import{getLocalOrder,setLocalOrder,deleteLocalOrder}from"../../utils/localStorage";export function OrderStorage(props){const{children,clearWhenPlaced=!0,...p}=props;return _jsx(OrderStorageContext.Provider,{value:{...p,setLocalOrder,getLocalOrder,deleteLocalOrder,clearWhenPlaced},children})}export default OrderStorage;
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { ConditionalElement } from '../../typings/index';
3
3
  import { TGenericChildrenProps, TResources } from '../utils/GenericFieldComponent';
4
- declare type ParcelFieldChildrenProps = TGenericChildrenProps<TResources['Parcel']>;
5
- declare type TCondition = ConditionalElement<Exclude<TResources['Parcel'], 'resource'>>;
6
- declare type Props = {
4
+ type ParcelFieldChildrenProps = TGenericChildrenProps<TResources['Parcel']>;
5
+ type TCondition = ConditionalElement<Exclude<TResources['Parcel'], 'resource'>>;
6
+ type Props = {
7
7
  children?: (props: ParcelFieldChildrenProps) => JSX.Element;
8
8
  } & TCondition;
9
9
  /**
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { ConditionalElement } from '../../typings/index';
3
3
  import { TGenericChildrenProps, TResources } from '../utils/GenericFieldComponent';
4
- declare type ParcelLineItemFieldChildrenProps = TGenericChildrenProps<TResources['ParcelLineItem']>;
5
- declare type TCondition = ConditionalElement<Exclude<TResources['ParcelLineItem'], 'resource'>>;
6
- declare type Props = {
4
+ type ParcelLineItemFieldChildrenProps = TGenericChildrenProps<TResources['ParcelLineItem']>;
5
+ type TCondition = ConditionalElement<Exclude<TResources['ParcelLineItem'], 'resource'>>;
6
+ type Props = {
7
7
  children?: (props: ParcelLineItemFieldChildrenProps) => JSX.Element;
8
8
  } & TCondition;
9
9
  /**
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
- declare type Props = GatewayBaseType;
3
+ type Props = GatewayBaseType;
4
4
  export declare function AdyenGateway(props: Props): JSX.Element | null;
5
5
  export default AdyenGateway;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
- declare type Props = GatewayBaseType;
3
+ type Props = GatewayBaseType;
4
4
  export declare function BraintreeGateway(props: Props): JSX.Element | null;
5
5
  export default BraintreeGateway;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
- declare type Props = GatewayBaseType;
3
+ type Props = GatewayBaseType;
4
4
  export declare function CheckoutComGateway(props: Props): JSX.Element | null;
5
5
  export default CheckoutComGateway;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
- declare type Props = GatewayBaseType;
3
+ type Props = GatewayBaseType;
4
4
  export declare function KlarnaGateway(props: Props): JSX.Element | null;
5
5
  export default KlarnaGateway;
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { LoaderType } from '../../typings/index';
3
3
  import { PaymentSourceProps } from '../payment_source/PaymentSource';
4
- export declare type GatewayBaseType = Props & {
4
+ export type GatewayBaseType = Props & {
5
5
  show: boolean;
6
6
  loading: boolean;
7
7
  loaderComponent: JSX.Element;
8
8
  };
9
- declare type Props = PaymentSourceProps & {
9
+ type Props = PaymentSourceProps & {
10
10
  showCard: boolean;
11
11
  handleEditClick: (e: MouseEvent) => void;
12
12
  show: boolean;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
- declare type Props = Partial<GatewayBaseType>;
3
+ type Props = Partial<GatewayBaseType>;
4
4
  export declare function PaypalGateway(props: Props): JSX.Element | null;
5
5
  export default PaypalGateway;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
- declare type Props = GatewayBaseType;
3
+ type Props = GatewayBaseType;
4
4
  export declare function StripeGateway(props: Props): JSX.Element | null;
5
5
  export default StripeGateway;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { GatewayBaseType } from '../payment_gateways/PaymentGateway';
3
- declare type Props = GatewayBaseType;
3
+ type Props = GatewayBaseType;
4
4
  export declare function WireTransferGateway(props: Props): JSX.Element | null;
5
5
  export default WireTransferGateway;
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { LoaderType } from '../../typings/index';
3
3
  import { PaymentMethod as PaymentMethodType } from '@commercelayer/sdk';
4
4
  import { PaymentResource } from '../../reducers/PaymentMethodReducer';
5
- declare type Props = {
5
+ type Props = {
6
6
  /**
7
7
  * Hide payment methods by an array of strings
8
8
  */
@@ -5,7 +5,7 @@ interface ChildrenProps extends Omit<Props, 'children'> {
5
5
  checked: boolean;
6
6
  handleOnChange: (event: ChangeEvent<HTMLInputElement>) => Promise<void>;
7
7
  }
8
- declare type Props = {
8
+ type Props = {
9
9
  children?: ChildrenFunction<ChildrenProps>;
10
10
  onChange?: (payment?: PaymentMethod | Record<string, any>) => void;
11
11
  } & JSX.IntrinsicElements['input'];
@@ -1,12 +1,12 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import { PaymentSourceProps } from './PaymentSource';
3
- declare type Styles = Partial<{
3
+ type Styles = Partial<{
4
4
  base: CSSProperties;
5
5
  error: CSSProperties;
6
6
  placeholder: CSSProperties;
7
7
  validated: CSSProperties;
8
8
  }>;
9
- declare type PaypalStyle = Partial<{
9
+ type PaypalStyle = Partial<{
10
10
  /**
11
11
  * @see {@link https://developer.paypal.com/docs/checkout/integration-features/customize-button/#color}
12
12
  */
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { HostedFieldFieldOptions } from 'braintree-web/modules/hosted-fields';
3
3
  import { PaymentSourceProps } from './PaymentSource';
4
- declare type BraintreeHostedFields<Type> = {
4
+ type BraintreeHostedFields<Type> = {
5
5
  [Property in keyof Type]: {
6
6
  label?: string;
7
7
  } & Type[Property];
8
8
  };
9
- export declare type BraintreeConfig = {
9
+ export type BraintreeConfig = {
10
10
  containerClassName?: string;
11
11
  cardContainerClassName?: string;
12
12
  expDateContainerClassName?: string;
@@ -20,7 +20,7 @@ export declare type BraintreeConfig = {
20
20
  [key: string]: Record<string, string>;
21
21
  };
22
22
  };
23
- declare type Props = {
23
+ type Props = {
24
24
  authorization: string;
25
25
  config?: BraintreeConfig;
26
26
  templateCustomerSaveToWallet?: PaymentSourceProps['templateCustomerSaveToWallet'];
@@ -2,7 +2,7 @@
2
2
  import { PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
3
3
  import { PaymentSourceProps } from './PaymentSource';
4
4
  import { FramesStyle } from 'frames-react';
5
- export declare type CheckoutComConfig = {
5
+ export type CheckoutComConfig = {
6
6
  containerClassName?: string;
7
7
  hintLabel?: string;
8
8
  name?: string;
@@ -13,7 +13,7 @@ export declare type CheckoutComConfig = {
13
13
  };
14
14
  [key: string]: unknown;
15
15
  };
16
- declare type Props = PaymentMethodConfig['checkoutComPayment'] & JSX.IntrinsicElements['div'] & {
16
+ type Props = PaymentMethodConfig['checkoutComPayment'] & JSX.IntrinsicElements['div'] & {
17
17
  show?: boolean;
18
18
  publicKey: string;
19
19
  locale?: string;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
3
3
  import { PaymentSourceProps } from './PaymentSource';
4
- declare type KlarnaPaymentProps = PaymentMethodConfig['klarnaPayment'] & JSX.IntrinsicElements['div'] & Partial<PaymentSourceProps['templateCustomerSaveToWallet']> & {
4
+ type KlarnaPaymentProps = PaymentMethodConfig['klarnaPayment'] & JSX.IntrinsicElements['div'] & Partial<PaymentSourceProps['templateCustomerSaveToWallet']> & {
5
5
  show?: boolean;
6
6
  clientToken: string;
7
7
  locale?: string;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ChildrenFunction } from '../../typings/index';
3
- export declare type PaymentSourceDetailType = 'last4' | 'exp_year' | 'exp_month';
3
+ export type PaymentSourceDetailType = 'last4' | 'exp_year' | 'exp_month';
4
4
  interface ChildrenProps extends Omit<Props, 'children'> {
5
5
  text: string;
6
6
  }
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { ChildrenFunction } from '../../typings/index';
3
3
  interface CustomComponent extends Omit<Props, 'children'> {
4
4
  }
5
- declare type Props = {
5
+ type Props = {
6
6
  children?: ChildrenFunction<CustomComponent>;
7
7
  label?: string | ReactNode;
8
8
  } & Omit<JSX.IntrinsicElements['button'], 'onClick'>;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- export declare type PaypalConfig = {
2
+ export type PaypalConfig = {
3
3
  return_url: string;
4
4
  cancel_url: string;
5
5
  infoMessage?: {
@@ -7,6 +7,6 @@ export declare type PaypalConfig = {
7
7
  className?: string;
8
8
  };
9
9
  };
10
- declare type Props = Omit<PaypalConfig, 'return_url' | 'cancel_url'> & JSX.IntrinsicElements['div'];
10
+ type Props = Omit<PaypalConfig, 'return_url' | 'cancel_url'> & JSX.IntrinsicElements['div'];
11
11
  export declare function PaypalPayment({ infoMessage, ...p }: Props): JSX.Element;
12
12
  export default PaypalPayment;
@@ -2,14 +2,14 @@
2
2
  import { StripeCardElementOptions, StripeElementLocale } from '@stripe/stripe-js';
3
3
  import { PaymentMethodConfig } from '../../reducers/PaymentMethodReducer';
4
4
  import { PaymentSourceProps } from './PaymentSource';
5
- export declare type StripeConfig = {
5
+ export type StripeConfig = {
6
6
  containerClassName?: string;
7
7
  hintLabel?: string;
8
8
  name?: string;
9
9
  options?: StripeCardElementOptions;
10
10
  [key: string]: any;
11
11
  };
12
- declare type Props = PaymentMethodConfig['stripePayment'] & JSX.IntrinsicElements['div'] & Partial<PaymentSourceProps['templateCustomerSaveToWallet']> & {
12
+ type Props = PaymentMethodConfig['stripePayment'] & JSX.IntrinsicElements['div'] & Partial<PaymentSourceProps['templateCustomerSaveToWallet']> & {
13
13
  show?: boolean;
14
14
  publishableKey: string;
15
15
  locale?: StripeElementLocale;
@@ -1,11 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
- export declare type WireTransferConfig = {
2
+ export type WireTransferConfig = {
3
3
  infoMessage?: {
4
4
  text?: string | ReactNode;
5
5
  className?: string;
6
6
  };
7
7
  };
8
- declare type Props = WireTransferConfig & JSX.IntrinsicElements['div'] & {
8
+ type Props = WireTransferConfig & JSX.IntrinsicElements['div'] & {
9
9
  'data-test-id'?: string;
10
10
  };
11
11
  export declare function WireTransferPayment({ infoMessage, ...p }: Props): JSX.Element;
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { Shipment } from '@commercelayer/sdk';
3
- declare type ShipmentFieldChildrenProps = Omit<Props, 'children'> & {
3
+ type ShipmentFieldChildrenProps = Omit<Props, 'children'> & {
4
4
  shipment: Shipment;
5
5
  };
6
- export declare type ShipmentAttribute = 'number' | 'currency_code' | 'status' | 'cost_amount_cents' | 'cost_amount_float' | 'formatted_cost_amount' | 'key_number';
6
+ export type ShipmentAttribute = 'number' | 'currency_code' | 'status' | 'cost_amount_cents' | 'cost_amount_float' | 'formatted_cost_amount' | 'key_number';
7
7
  interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
8
8
  children?: (props: ShipmentFieldChildrenProps) => JSX.Element;
9
9
  name: ShipmentAttribute;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ShippingMethod } from '@commercelayer/sdk';
3
- declare type ChildrenProps = Omit<Props, 'children'> & {
3
+ type ChildrenProps = Omit<Props, 'children'> & {
4
4
  label: string;
5
5
  shippingMethod: ShippingMethod;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { BaseAmountComponent } from '../../typings/index';
3
- declare type Props = BaseAmountComponent & {
3
+ type Props = BaseAmountComponent & {
4
4
  labelFreeOver?: string;
5
5
  } & ({
6
6
  type?: 'amount';
@@ -10,16 +10,4 @@ declare type Props = BaseAmountComponent & {
10
10
  base?: 'price';
11
11
  });
12
12
  export declare function ShippingMethodPrice(props: Props): JSX.Element;
13
- export declare namespace ShippingMethodPrice {
14
- var propTypes: {
15
- type: import("prop-types").Requireable<"amount">;
16
- id: import("prop-types").Requireable<string>;
17
- className: import("prop-types").Requireable<string>;
18
- style: import("prop-types").Requireable<object>;
19
- name: import("prop-types").Requireable<string>;
20
- children: import("prop-types").Requireable<(...args: any[]) => any>;
21
- format: import("prop-types").Requireable<import("../../typings/index").BaseFormatPrice>;
22
- };
23
- var displayName: string;
24
- }
25
13
  export default ShippingMethodPrice;
@@ -1 +1 @@
1
- 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";const propTypes=components.ShippingMethodPrice.propTypes,displayName=components.ShippingMethodPrice.displayName;export function ShippingMethodPrice(props){const{base="price_amount",type="for_shipment",format="formatted",labelFreeOver="Free",...p}=props,{shippingMethod}=useContext(ShippingMethodChildrenContext),[price,setPrice]=useState(""),[priceCents,setPriceCents]=useState(0);useEffect(()=>{if(shippingMethod){const p2=getAmount({base,type,format,obj:shippingMethod});setPrice(p2);const pCents=getAmount({base:"price_amount",type:"for_shipment",format:"cents",obj:shippingMethod});setPriceCents(pCents)}return()=>{setPrice(""),setPriceCents(0)}},[shippingMethod]);const parentProps={price,...p},finalPrice=priceCents===0?labelFreeOver:price;return props.children?_jsx(Parent,{...parentProps,children:props.children}):_jsx("span",{...p,children:finalPrice})}ShippingMethodPrice.propTypes=propTypes,ShippingMethodPrice.displayName=displayName;export default ShippingMethodPrice;
1
+ 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";export function ShippingMethodPrice(props){const{base="price_amount",type="for_shipment",format="formatted",labelFreeOver="Free",...p}=props,{shippingMethod}=useContext(ShippingMethodChildrenContext),[price,setPrice]=useState(""),[priceCents,setPriceCents]=useState(0);useEffect(()=>{if(shippingMethod){const p2=getAmount({base,type,format,obj:shippingMethod});setPrice(p2);const pCents=getAmount({base:"price_amount",type:"for_shipment",format:"cents",obj:shippingMethod});setPriceCents(pCents)}return()=>{setPrice(""),setPriceCents(0)}},[shippingMethod]);const parentProps={price,...p},finalPrice=priceCents===0?labelFreeOver:price;return props.children?_jsx(Parent,{...parentProps,children:props.children}):_jsx("span",{...p,children:finalPrice})}export default ShippingMethodPrice;
@@ -1,19 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  import type { ShippingMethod } from '@commercelayer/sdk';
3
- export declare type ShippingMethodRadioButtonType = Omit<Props, 'children'> & {
3
+ export type ShippingMethodRadioButtonType = Omit<Props, 'children'> & {
4
4
  shippingMethod: ShippingMethod;
5
5
  shipmentId: string;
6
6
  };
7
- export declare type ShippingMethodRadioButtonOnChangeType = (shippingMethod: ShippingMethod, shipmentId: string) => void;
8
- declare type Props = {
7
+ export type ShippingMethodRadioButtonOnChangeType = (shippingMethod: ShippingMethod, shipmentId: string) => void;
8
+ type Props = {
9
9
  children?: (props: ShippingMethodRadioButtonType) => JSX.Element;
10
10
  onChange?: ShippingMethodRadioButtonOnChangeType;
11
11
  } & Omit<JSX.IntrinsicElements['input'], 'onChange'>;
12
12
  export declare function ShippingMethodRadioButton(props: Props): JSX.Element;
13
- export declare namespace ShippingMethodRadioButton {
14
- var propTypes: {
15
- children: import("prop-types").Requireable<(...args: any[]) => any>;
16
- };
17
- var displayName: string;
18
- }
19
13
  export default ShippingMethodRadioButton;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useEffect,useState}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,displayName=components.ShippingMethodRadioButton.displayName;export function ShippingMethodRadioButton(props){const{onChange,...p}=props,[checked,setChecked]=useState(!1),{shippingMethod,currentShippingMethodId,shipmentId}=useContext(ShippingMethodChildrenContext),{setShippingMethod}=useContext(ShipmentContext),shippingMethodId=shippingMethod?.id,name=`shipment-${shipmentId}`,id=`${name}-${shippingMethodId}`;useEffect(()=>(setChecked(shippingMethodId===currentShippingMethodId),()=>{setChecked(!1)}),[currentShippingMethodId]);const handleOnChange=async()=>{shipmentId&&shippingMethodId&&(setChecked(!0),await setShippingMethod(shipmentId,shippingMethodId),shippingMethod&&onChange&&onChange(shippingMethod,shipmentId))},parentProps={shippingMethod,shipmentId,handleOnChange,name,id,...props};return props.children?_jsx(Parent,{...parentProps,children:props.children}):_jsx("input",{type:"radio",name,id,onChange:handleOnChange,checked,...p})}ShippingMethodRadioButton.propTypes=propTypes,ShippingMethodRadioButton.displayName=displayName;export default ShippingMethodRadioButton;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useEffect,useState}from"react";import ShippingMethodChildrenContext from"../../context/ShippingMethodChildrenContext";import Parent from"../utils/Parent";import ShipmentContext from"../../context/ShipmentContext";export function ShippingMethodRadioButton(props){const{onChange,...p}=props,[checked,setChecked]=useState(!1),{shippingMethod,currentShippingMethodId,shipmentId}=useContext(ShippingMethodChildrenContext),{setShippingMethod}=useContext(ShipmentContext),shippingMethodId=shippingMethod?.id,name=`shipment-${shipmentId??""}`,id=`${name}-${shippingMethodId??""}`;useEffect(()=>(setChecked(shippingMethodId===currentShippingMethodId),()=>{setChecked(!1)}),[currentShippingMethodId]);const handleOnChange=async()=>{shipmentId&&shippingMethodId&&(setChecked(!0),await setShippingMethod(shipmentId,shippingMethodId),shippingMethod&&onChange&&onChange(shippingMethod,shipmentId))},parentProps={shippingMethod,shipmentId,handleOnChange,name,id,...props};return props.children?_jsx(Parent,{...parentProps,children:props.children}):_jsx("input",{type:"radio",name,id,onChange:()=>{handleOnChange()},checked,...p})}export default ShippingMethodRadioButton;
@@ -5,7 +5,7 @@ interface AvailabilityTemplateChildrenProps extends Omit<Props, 'children'>, Del
5
5
  text: string;
6
6
  quantity: number;
7
7
  }
8
- declare type FormatRules = {
8
+ type FormatRules = {
9
9
  /**
10
10
  * Set time format for shipping method
11
11
  */
@@ -27,7 +27,7 @@ declare type FormatRules = {
27
27
  showShippingMethodName?: boolean;
28
28
  showShippingMethodPrice: true;
29
29
  };
30
- declare type Props = {
30
+ type Props = {
31
31
  children?: ChildrenFunction<AvailabilityTemplateChildrenProps>;
32
32
  } & Omit<JSX.IntrinsicElements['span'], 'children'> & FormatRules;
33
33
  export declare function AvailabilityTemplate(props: Props): JSX.Element;
@@ -1,17 +1,10 @@
1
1
  /// <reference types="react" />
2
- export declare type DeliveryLeadTimeField = 'min_hours' | 'max_hours' | 'min_days' | 'max_days';
3
- export declare type DeliveryLeadTimeComponentChildren = Omit<Props, 'children'>;
4
- declare type Props = Partial<JSX.IntrinsicElements['span']> & {
2
+ export type DeliveryLeadTimeField = 'min_hours' | 'max_hours' | 'min_days' | 'max_days';
3
+ export type DeliveryLeadTimeComponentChildren = Omit<Props, 'children'>;
4
+ type Props = Partial<JSX.IntrinsicElements['span']> & {
5
5
  children?: (props: DeliveryLeadTimeComponentChildren) => JSX.Element;
6
6
  type: DeliveryLeadTimeField;
7
7
  text?: string;
8
8
  };
9
9
  export declare function DeliveryLeadTime(props: Props): JSX.Element;
10
- export declare namespace DeliveryLeadTime {
11
- var propTypes: {
12
- type: import("prop-types").Validator<NonNullable<DeliveryLeadTimeField>>;
13
- children: import("prop-types").Requireable<(...args: any[]) => any>;
14
- };
15
- var displayName: string;
16
- }
17
10
  export default DeliveryLeadTime;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useState,useEffect}from"react";import ShippingMethodChildrenContext from"../../context/ShippingMethodChildrenContext";import Parent from"../utils/Parent";import components from"../../config/components";const propTypes=components.DeliveryLeadTime.propTypes,displayName=components.DeliveryLeadTime.displayName;export function DeliveryLeadTime(props){const{type,...p}=props,[text,setText]=useState(),{deliveryLeadTimeForShipment}=useContext(ShippingMethodChildrenContext);useEffect(()=>(deliveryLeadTimeForShipment&&deliveryLeadTimeForShipment[type]&&setText(deliveryLeadTimeForShipment[type]),()=>{setText("")}),[deliveryLeadTimeForShipment]);const parentProps={text,...p};return props.children?_jsx(Parent,{...parentProps,children:props.children}):_jsx("span",{...p,children:text})}DeliveryLeadTime.propTypes=propTypes,DeliveryLeadTime.displayName=displayName;export default DeliveryLeadTime;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useState,useEffect}from"react";import ShippingMethodChildrenContext from"../../context/ShippingMethodChildrenContext";import Parent from"../utils/Parent";export function DeliveryLeadTime(props){const{type,...p}=props,[text,setText]=useState(),{deliveryLeadTimeForShipment}=useContext(ShippingMethodChildrenContext);useEffect(()=>(deliveryLeadTimeForShipment?.[type]&&setText(deliveryLeadTimeForShipment[type]),()=>{setText("")}),[deliveryLeadTimeForShipment]);const parentProps={text,...p};return props.children?_jsx(Parent,{...parentProps,children:props.children}):_jsx("span",{...p,children:text})}export default DeliveryLeadTime;
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { ConditionalElement } from '../../typings/index';
3
3
  import { TGenericChildrenProps, TResources } from '../utils/GenericFieldComponent';
4
- declare type SkuFieldChildrenProps = TGenericChildrenProps<TResources['Sku']>;
5
- declare type TCondition = ConditionalElement<Exclude<TResources['Sku'], 'resource'>>;
6
- declare type Props = {
4
+ type SkuFieldChildrenProps = TGenericChildrenProps<TResources['Sku']>;
5
+ type TCondition = ConditionalElement<Exclude<TResources['Sku'], 'resource'>>;
6
+ type Props = {
7
7
  children?: (props: SkuFieldChildrenProps) => JSX.Element;
8
8
  } & TCondition;
9
9
  /**
@@ -1,14 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
- declare type Props = {
2
+ interface Props {
3
3
  children: ReactNode;
4
+ /**
5
+ * ID of the SKU list.
6
+ */
4
7
  id: string;
5
- };
6
- export declare function SkuList(props: Props): JSX.Element;
7
- export declare namespace SkuList {
8
- var propTypes: {
9
- children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
10
- id: import("prop-types").Validator<string>;
11
- };
12
- var displayName: string;
13
8
  }
9
+ export declare function SkuList(props: Props): JSX.Element;
14
10
  export default SkuList;
@@ -1 +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,displayName=components.SkuList.displayName;export function SkuList(props){const{id,children}=props,{listIds}=useContext(SkuListsContext);return useEffect(()=>{listIds&&!listIds.includes(id)&&listIds.push(id)},[]),_jsx(Fragment,{children})}SkuList.propTypes=propTypes,SkuList.displayName=displayName;export default SkuList;
1
+ import{Fragment as _Fragment,jsx as _jsx}from"react/jsx-runtime";import{useContext,useEffect}from"react";import SkuListsContext from"../../context/SkuListsContext";export function SkuList(props){const{id,children}=props,{listIds}=useContext(SkuListsContext);return useEffect(()=>{listIds&&!listIds.includes(id)&&listIds.push(id)},[]),_jsx(_Fragment,{children})}export default SkuList;
@@ -1,12 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- declare type Props = {
2
+ interface Props {
3
3
  children: ReactNode;
4
- };
5
- export declare function SkuListsContainer(props: Props): JSX.Element;
6
- export declare namespace SkuListsContainer {
7
- var propTypes: {
8
- children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
9
- };
10
- var displayName: string;
11
4
  }
5
+ export declare function SkuListsContainer(props: Props): JSX.Element;
12
6
  export default SkuListsContainer;
@@ -1 +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,displayName=components.SkuListsContainer.displayName;export function SkuListsContainer(props){const{children}=props,[state,dispatch]=useReducer(skuListsReducer,skuListsInitialState),config=useContext(CommerceLayerContext);return useEffect(()=>{state.listIds&&state.listIds.length>0&&config.accessToken&&getSkuList({listIds:state.listIds,dispatch,config,state})},[config.accessToken]),_jsx(SkuListsContext.Provider,{value:state,children})}SkuListsContainer.propTypes=propTypes,SkuListsContainer.displayName=displayName;export default SkuListsContainer;
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";export function SkuListsContainer(props){const{children}=props,[state,dispatch]=useReducer(skuListsReducer,skuListsInitialState),config=useContext(CommerceLayerContext);return useEffect(()=>{state.listIds&&state.listIds.length>0&&config.accessToken&&getSkuList({listIds:state.listIds,dispatch,config,state})},[config.accessToken]),_jsx(SkuListsContext.Provider,{value:state,children})}export default SkuListsContainer;
@@ -1,11 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- declare type Props = {
2
+ interface Props {
3
3
  children: ReactNode;
4
- };
5
- export declare function Skus<P extends Props>({ children }: P): JSX.Element;
6
- export declare namespace Skus {
7
- var propTypes: {
8
- children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
9
- };
10
4
  }
5
+ export declare function Skus<P extends Props>({ children }: P): JSX.Element;
11
6
  export default Skus;
@@ -1 +1 @@
1
- import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import components from"../../config/components";import SkuChildrenContext from"../../context/SkuChildrenContext";import SkuContext from"../../context/SkuContext";import{useContext}from"react";export function Skus({children}){const{skus}=useContext(SkuContext),components2=skus&&skus.map((sku,key)=>{const value={sku};return _jsx(SkuChildrenContext.Provider,{value,children},key)});return _jsx(_Fragment,{children:components2})}Skus.propTypes=components.Skus.propTypes;export default Skus;
1
+ import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import SkuChildrenContext from"../../context/SkuChildrenContext";import SkuContext from"../../context/SkuContext";import{useContext}from"react";export function Skus({children}){const{skus}=useContext(SkuContext),components=skus?.map((sku,key)=>{const value={sku};return _jsx(SkuChildrenContext.Provider,{value,children},key)});return _jsx(_Fragment,{children:components})}export default Skus;
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { ConditionalElement } from '../../typings/index';
3
3
  import { TGenericChildrenProps, TResources } from '../utils/GenericFieldComponent';
4
- declare type StockTransferFieldChildrenProps = TGenericChildrenProps<TResources['StockTransfer']>;
5
- declare type TCondition = ConditionalElement<Exclude<TResources['StockTransfer'], 'resource'>>;
6
- declare type Props = {
4
+ type StockTransferFieldChildrenProps = TGenericChildrenProps<TResources['StockTransfer']>;
5
+ type TCondition = ConditionalElement<Exclude<TResources['StockTransfer'], 'resource'>>;
6
+ type Props = {
7
7
  children?: (props: StockTransferFieldChildrenProps) => JSX.Element;
8
8
  } & TCondition;
9
9
  export declare function StockTransferField<P extends Props>(props: P): JSX.Element;
@@ -9,8 +9,8 @@ export interface CustomerAddress extends Address {
9
9
  onClick: () => void;
10
10
  handleSelect?: () => void;
11
11
  }
12
- export declare type AddressCardsTemplateChildren = ChildrenFunction<TAddressCards>;
13
- export declare type HandleSelect = (k: number, addressId: string, customerAddressId: string, disabled: boolean, address: Address) => Promise<void>;
12
+ export type AddressCardsTemplateChildren = ChildrenFunction<TAddressCards>;
13
+ export type HandleSelect = (k: number, addressId: string, customerAddressId: string, disabled: boolean, address: Address) => Promise<void>;
14
14
  interface Props {
15
15
  customerAddresses: CustomerAddress[];
16
16
  countryLock?: string;