@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/react-components",
3
- "version": "4.0.1",
3
+ "version": "4.1.0-beta.2",
4
4
  "description": "The Official Commerce Layer React Components",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -27,10 +27,18 @@
27
27
  "require": "./lib/cjs/components/customers/*.js",
28
28
  "import": "./lib/esm/components/customers/*.js"
29
29
  },
30
+ "./errors/*": {
31
+ "require": "./lib/cjs/components/errors/*.js",
32
+ "import": "./lib/esm/components/errors/*.js"
33
+ },
30
34
  "./gift_cards/*": {
31
35
  "require": "./lib/cjs/components/gift_cards/*.js",
32
36
  "import": "./lib/esm/components/gift_cards/*.js"
33
37
  },
38
+ "./hooks/*": {
39
+ "require": "./lib/cjs/hooks/*.js",
40
+ "import": "./lib/esm/hooks/*.js"
41
+ },
34
42
  "./line_items/*": {
35
43
  "require": "./lib/cjs/components/line_items/*.js",
36
44
  "import": "./lib/esm/components/line_items/*.js"
@@ -83,9 +91,15 @@
83
91
  "customers/*": [
84
92
  "lib/esm/components/customers/*.d.ts"
85
93
  ],
94
+ "errors/*": [
95
+ "lib/esm/components/errors/*.d.ts"
96
+ ],
86
97
  "gift_cards/*": [
87
98
  "lib/esm/components/gift_cards/*.d.ts"
88
99
  ],
100
+ "hooks/*": [
101
+ "lib/esm/hooks/*.d.ts"
102
+ ],
89
103
  "line_items/*": [
90
104
  "lib/esm/components/line_items/*.d.ts"
91
105
  ],
@@ -121,19 +135,6 @@
121
135
  "publishConfig": {
122
136
  "access": "public"
123
137
  },
124
- "scripts": {
125
- "lint": "eslint src",
126
- "lint:fix": "eslint src --fix",
127
- "test": "pnpm run lint && vitest run",
128
- "coverage": "vitest run --coverage",
129
- "test:e2e": "NODE_ENV=test playwright test",
130
- "test:e2e:coverage": "nyc pnpm test:e2e && pnpm coverage:report",
131
- "coverage:report": "nyc report --reporter=html",
132
- "build": "tsc -b tsconfig.prod.json tsconfig.prod.esm.json --verbose && pnpm postbuild",
133
- "build:dev": "tsc -b tsconfig.prod.json tsconfig.prod.esm.json --verbose && tsc-alias -p tsconfig.prod.json && tsc-alias -p tsconfig.prod.esm.json",
134
- "postbuild": "tsc-alias -p tsconfig.prod.json && tsc-alias -p tsconfig.prod.esm.json && minimize-js lib -w -s",
135
- "dev": "NODE_OPTIONS='--inspect' next dev"
136
- },
137
138
  "repository": {
138
139
  "type": "git",
139
140
  "url": "git+https://github.com/commercelayer/commercelayer-react-components.git"
@@ -159,13 +160,13 @@
159
160
  "dependencies": {
160
161
  "@ac-dev/countries-service": "^1.2.0",
161
162
  "@ac-dev/states-service": "^1.1.1",
162
- "@adyen/adyen-web": "^5.27.0",
163
- "@commercelayer/sdk": "^4.16.0",
164
- "@stripe/react-stripe-js": "^1.12.0",
165
- "@stripe/stripe-js": "^1.38.1",
163
+ "@adyen/adyen-web": "^5.29.0",
164
+ "@commercelayer/sdk": "^4.18.0",
165
+ "@stripe/react-stripe-js": "^1.15.0",
166
+ "@stripe/stripe-js": "^1.44.1",
166
167
  "axios": "^1.0.0",
167
- "braintree-web": "^3.88.1",
168
- "frames-react": "^1.0.12",
168
+ "braintree-web": "^3.88.4",
169
+ "frames-react": "^1.0.13",
169
170
  "jwt-decode": "^3.1.2",
170
171
  "lodash": "^4.17.21",
171
172
  "lodash-es": "^4.17.21",
@@ -174,82 +175,45 @@
174
175
  "react-window": "^1.8.7"
175
176
  },
176
177
  "devDependencies": {
177
- "@babel/core": "^7.19.3",
178
- "@babel/plugin-proposal-class-properties": "^7.18.6",
179
- "@babel/plugin-syntax-flow": "^7.18.6",
180
- "@babel/plugin-transform-react-jsx": "^7.19.0",
181
- "@babel/preset-env": "^7.19.3",
182
- "@babel/preset-react": "^7.18.6",
183
- "@babel/preset-typescript": "^7.18.6",
184
- "@commercelayer/eslint-config-ts-react": "^0.1.2",
185
178
  "@commercelayer/js-auth": "^2.3.0",
186
- "@playwright/test": "^1.26.1",
187
- "@semantic-release/changelog": "^6.0.1",
188
- "@semantic-release/commit-analyzer": "^9.0.2",
189
- "@semantic-release/git": "^10.0.1",
190
- "@semantic-release/github": "^8.0.6",
191
- "@semantic-release/npm": "^9.0.1",
192
- "@semantic-release/release-notes-generator": "^10.0.3",
193
- "@tailwindcss/aspect-ratio": "^0.4.2",
194
- "@tailwindcss/forms": "^0.5.3",
195
- "@tailwindcss/line-clamp": "^0.4.2",
196
- "@tailwindcss/typography": "^0.5.7",
179
+ "@playwright/test": "^1.28.0",
197
180
  "@testing-library/react": "^13.4.0",
198
181
  "@types/braintree-web": "^3.75.22",
199
- "@types/lodash": "^4.14.186",
182
+ "@types/lodash": "^4.14.189",
200
183
  "@types/node": "^18.8.2",
201
184
  "@types/prop-types": "^15.7.5",
202
- "@types/react": "^18.0.21",
185
+ "@types/react": "^18.0.25",
203
186
  "@types/react-table": "^7.7.12",
204
187
  "@types/react-test-renderer": "^18.0.0",
205
188
  "@types/react-window": "^1.8.5",
206
- "@typescript-eslint/eslint-plugin": "^5.39.0",
207
- "@typescript-eslint/parser": "^5.39.0",
208
189
  "@vitejs/plugin-react": "^2.1.0",
209
- "@vitest/coverage-c8": "^0.23.4",
210
- "@zerollup/ts-transform-paths": "^1.7.18",
211
- "autoprefixer": "^10.4.12",
212
- "babel-loader": "^8.2.5",
213
- "babel-plugin-istanbul": "^6.1.1",
214
- "dotenv": "^16.0.3",
215
- "eslint": "^8.24.0",
216
- "eslint-config-prettier": "^8.5.0",
217
- "eslint-config-react-app": "^7.0.1",
218
- "eslint-config-standard-jsx": "^11.0.0",
219
- "eslint-config-standard-with-typescript": "^23.0.0",
220
- "eslint-plugin-import": "^2.26.0",
221
- "eslint-plugin-n": "^15.3.0",
222
- "eslint-plugin-prettier": "^4.2.1",
223
- "eslint-plugin-promise": "^6.0.1",
224
- "eslint-plugin-react": "^7.31.8",
225
- "eslint-plugin-react-hooks": "^4.6.0",
226
- "jest": "^29.1.2",
227
- "jsdom": "^20.0.1",
190
+ "@vitest/coverage-c8": "^0.25.2",
191
+ "jsdom": "^20.0.3",
228
192
  "minimize-js": "^1.3.0",
229
- "next": "^12.3.1",
230
- "nyc": "^15.1.0",
231
- "playwright": "^1.26.1",
232
- "postcss": "^8.4.17",
233
- "postcss-loader": "^7.0.1",
234
- "prettier": "^2.7.1",
235
- "prop-types": "^15.8.1",
236
193
  "react": "^18.2.0",
237
194
  "react-dom": "^18.2.0",
238
195
  "react-test-renderer": "^18.2.0",
239
- "semantic-release": "^19.0.5",
240
- "tailwindcss": "^3.1.8",
241
- "ts-loader": "^9.4.1",
242
- "tsc-alias": "^1.7.0",
243
- "tsconfig-paths-jest": "^0.0.1",
196
+ "tsc-alias": "^1.7.1",
244
197
  "tslib": "^2.4.0",
245
- "typescript": "^4.8.4",
246
- "v8-to-istanbul": "^9.0.1",
247
- "vite": "^3.1.6",
248
- "vite-tsconfig-paths": "^3.5.1",
249
- "vitest": "^0.23.4",
250
- "webpack": "^5.73.0"
198
+ "typescript": "^4.9.3",
199
+ "vite": "^3.2.4",
200
+ "vite-tsconfig-paths": "^3.6.0",
201
+ "vitest": "^0.25.2"
251
202
  },
252
203
  "peerDependencies": {
253
204
  "react": "^18.0.0"
205
+ },
206
+ "scripts": {
207
+ "lint": "eslint src",
208
+ "lint:fix": "eslint src --fix",
209
+ "test": "pnpm run lint && vitest run",
210
+ "coverage": "vitest run --coverage",
211
+ "test:e2e": "NODE_ENV=test playwright test",
212
+ "test:e2e:coverage": "nyc pnpm test:e2e && pnpm coverage:report",
213
+ "coverage:report": "nyc report --reporter=html",
214
+ "build": "tsc -b tsconfig.prod.json tsconfig.prod.esm.json --verbose && pnpm postbuild",
215
+ "build:dev": "tsc -b tsconfig.prod.json tsconfig.prod.esm.json --verbose && tsc-alias -p tsconfig.prod.json && tsc-alias -p tsconfig.prod.esm.json",
216
+ "postbuild": "tsc-alias -p tsconfig.prod.json && tsc-alias -p tsconfig.prod.esm.json && minimize-js lib -w -s",
217
+ "dev": "NODE_OPTIONS='--inspect' next dev"
254
218
  }
255
- }
219
+ }
package/README.md DELETED
@@ -1,302 +0,0 @@
1
- # Commerce Layer React Components
2
-
3
- A collection of reusable React components that makes it super fast and simple to build your own custom commerce UI, leveraging [Commerce Layer API](https://docs.commercelayer.io/api/).
4
-
5
- ### What is Commerce Layer?
6
-
7
- [Commerce Layer](https://commercelayer.io) is a multi-market commerce API and order management system that lets you add global shopping capabilities to any website, mobile app, chatbot, wearable, voice, or IoT device, with ease. Compose your stack with the best-of-breed tools you already mastered and love. Make any experience shoppable, anywhere, through a blazing-fast, enterprise-grade, and secure API.
8
-
9
- # Getting started
10
-
11
- To get started with Commerce Layer React Components you need to install them and then get the credentials that will allow you to perform the API calls they wrap.
12
-
13
- - [Installation](#installation)
14
- - [Authentication](#authentication)
15
- - [Import](#import)
16
-
17
- ## Installation
18
-
19
- Commerce Layer React Components are available as an [npm package](https://www.npmjs.com/package/@commercelayer/react-components):
20
-
21
- ```
22
- // npm
23
- npm install @commercelayer/react-components
24
-
25
- // yarn
26
- yarn add @commercelayer/react-components
27
- ```
28
-
29
- ## Authentication
30
-
31
- All requests to Commerce Layer API must be authenticated with an [OAuth2](https://oauth.net/2/) bearer token. Hence, to use these components, you need to get a valid access token. Once you got it, you can pass it as prop — together with the endpoint of your Commerce Layer organization — to the `CommerceLayer` component, as follow:
32
-
33
- ```
34
- <CommerceLayer
35
- accessToken="your-access-token"
36
- endpoint="https://yourdomain.commercelayer.io">
37
-
38
- {/* ... child components */}
39
-
40
- </CommerceLayer>
41
- ```
42
-
43
- This token will be used to authorize the API calls of all its child components. That's why the presence of (at least) one `CommerceLayer` component is mandatory — it must wrap every other component you need to use.
44
-
45
- > Please note that — in case you need to fetch data with different tokens (i.e. from different organizations or using apps with different roles and permissions) — nothing prevents you from putting as many `CommerceLayer` components you want in the same page.
46
-
47
- You can check [our documentation](https://docs.commercelayer.io/api/authentication) for more information about the available authorization flows and leverage [Commerce Layer JS Auth](https://github.com/commercelayer/commercelayer-js-auth) to easily interact with our authentication API.
48
-
49
- ## Import
50
-
51
- You can use ES6 named import with every single component you plan to use (in addition to `CommerceLayer` one), as follow:
52
-
53
- ```
54
- import { CommerceLayer, ...otherComponents } from '@commercelayer/react-components'
55
- ```
56
-
57
- Check [this summary table](#list-of-components) for the complete (and constantly updated) list of available components.
58
-
59
- # Usage
60
-
61
- The code snippets below show how to put into action Commerce Layer React Components in some common use cases. Check the [`pages`](/pages) folder of this repository for more detailed examples.
62
-
63
- - [Prices](#prices)
64
- - [Add to cart](#add-to-cart)
65
- - [Shopping cart](#shopping-cart)
66
- - [Cart summary](#cart-summary)
67
-
68
- Under the hood, our React components are built on top of [Commerce Layer JS SDK](https://github.com/commercelayer/commercelayer-sdk) — feel free to use it if you want to develop your custom ones.
69
-
70
- ## Prices
71
-
72
- This example shows how to use Commerce Layer React Components to display the prices of some SKUs, identified by their SKU codes:
73
-
74
- ```
75
- import {
76
- CommerceLayer,
77
- PricesContainer,
78
- Price
79
- } from '@commercelayer/react-components'
80
-
81
- // your code [...]
82
-
83
- <CommerceLayer accessToken="your-access-token" endpoint="https://yourdomain.commercelayer.io">
84
- <PricesContainer>
85
- <Price
86
- skuCode="BABYONBU000000E63E7412MX"
87
- className="your-custom-class"
88
- compareClassName="your-custom-class"
89
- />
90
- <Price
91
- skuCode="CANVASAU000000FFFFFF1824"
92
- className="your-custom-class"
93
- compareClassName="your-custom-class"
94
- />
95
- <Price
96
- skuCode="LSLEEVMM000000E63E74LXXX"
97
- className="your-custom-class"
98
- compareClassName="your-custom-class"
99
- />
100
- </PricesContainer>
101
- </CommerceLayer>
102
-
103
- // your code [...]
104
- ```
105
-
106
- You can style the selling price and the full price as you like by passing the `className` and `compareClassName` props to the `Price` component. You can choose not to show the full price by passing `showCompare={false}` (default is `true`).
107
-
108
- If you need to paginate the list of prices, pass the `perPage` prop to the `PricesContainer` component (default is `10`) — to learn how pagination works, check our [documentation](https://docs.commercelayer.io/api/pagination).
109
-
110
- ## Add to cart
111
-
112
- This example shows how to use Commerce Layer React Components to implement the "add to cart" functionality on your page, showing the price of the chosen SKU, the possibility to select a variant and its quantity, the information about its availability, and the related button to perform the action:
113
-
114
- ```
115
- import {
116
- CommerceLayer,
117
- OrderContainer,
118
- OrderStorage,
119
- PricesContainer,
120
- Price,
121
- AddToCartButton,
122
- AvailabilityContainer,
123
- AvailabilityTemplate
124
- } from '@commercelayer/react-components'
125
-
126
- // your code [...]
127
-
128
- <CommerceLayer accessToken="your-access-token" endpoint="https://yourdomain.commercelayer.io">
129
- <OrderStorage persistKey="your-persist-key">
130
- <OrderContainer
131
- attributes={{
132
- cart_url: 'https://yourdomain.com/cart',
133
- return_url: 'https://yourdomain.com/return',
134
- privacy_url: 'https://yourdomain.com/privacy'
135
- }}>
136
- <PricesContainer>
137
- <Price skuCode="BABYONBU000000E63E746MXX" />
138
- </PricesContainer>
139
- <AddToCartButton quantity={1} skuCode="BABYONBU000000E63E746MXX" />
140
- <AvailabilityContainer skuCode="BABYONBU000000E63E746MXX">
141
- <AvailabilityTemplate />
142
- </AvailabilityContainer>
143
- </ItemContainer>
144
- </OrderContainer>
145
- </OrderStorage>
146
- </CommerceLayer>
147
-
148
- // your code [...]
149
- ```
150
-
151
- For each variant you can define the custom name (i.e. its translation based on location) and image that will be shown on the corresponding line item, by passing the `lineItem` prop to the `AddToCartButton` component and properly setting the `lineItem` key — all these content data are usually taken from your CMS, since Commerce Layer doesn't manage any kind of content.
152
-
153
- When you add a product to your shopping cart:
154
-
155
- - if there is an order stored in the Local Storage identified by a key that matches the `persistKey` property, a line item is created and it is associated with that order;
156
- - if no order in the Local Storage matches the `persistKey` property, a new order is created and stored.
157
-
158
- > A common best practice — especially for multi-country ecommerce — is to use as `persistKey` a key containing the country code, so that you have a different shopping cart for each country.
159
-
160
- If you need to set some of the [order object](https://docs.commercelayer.io/developers/v/api-reference/orders/object) attributes at the moment of the order creation, pass to the optional prop `attributes` to the `OrderContainer` component.
161
-
162
- ## Shopping cart
163
-
164
- This example shows how to use Commerce Layer React Components to build a shopping cart UI, containing the items that are going to be purchased with all their information (image, name, quantity, price) and the option to possibly remove some of them:
165
-
166
- ```
167
- import {
168
- CommerceLayer,
169
- OrderContainer,
170
- OrderStorage,
171
- LineItemsContainer,
172
- LineItemsCount,
173
- LineItem,
174
- LineItemImage,
175
- LineItemName,
176
- LineItemQuantity,
177
- LineItemAmount,
178
- LineItemRemoveLink,
179
- Errors
180
- } from '@commercelayer/react-components'
181
-
182
- // your code [...]
183
-
184
- <CommerceLayer accessToken="your-access-token" endpoint="https://yourdomain.commercelayer.io">
185
- <OrderStorage persistKey="your-persist-key">
186
- <OrderContainer>
187
- <LineItemsContainer>
188
- <p className="your-custom-class">
189
- Your shopping cart contains <LineItemsCount /> items
190
- </p>
191
- <LineItem>
192
- <LineItemImage width={50} />
193
- <LineItemName />
194
- <LineItemQuantity max={10} />
195
- <Errors resource="lineItem" field="quantity" />
196
- <LineItemAmount />
197
- <LineItemRemoveLink />
198
- </LineItem>
199
- </LineItemsContainer>
200
- </OrderContainer>
201
- </OrderStorage>
202
- </CommerceLayer>
203
-
204
- // your code [...]
205
- ```
206
-
207
- The `Errors` component lets you show the error (if present) returned by our API on a single attribute of a specific resource. You can customize the error message as you like by passing the `messages` prop to the component.
208
-
209
- ## Cart summary
210
-
211
- This example shows how to use Commerce Layer React Components to show a sample order summary with all the order line items (including discounts, shipping costs, taxes, and gift cards — if present) and totals:
212
-
213
- ```
214
- import {
215
- CommerceLayer,
216
- OrderContainer,
217
- OrderStorage,
218
- SubTotalAmount,
219
- DiscountAmount,
220
- ShippingAmount,
221
- TaxesAmount,
222
- GiftCardAmount,
223
- TotalAmount,
224
- CheckoutLink
225
- } from '@commercelayer/react-components'
226
-
227
- // your code [...]
228
-
229
- <CommerceLayer accessToken="your-access-token" endpoint="https://yourdomain.commercelayer.io">
230
- <OrderStorage persistKey="your-persist-key">
231
- <OrderContainer>
232
- <SubTotalAmount />
233
- <DiscountAmount />
234
- <ShippingAmount />
235
- <TaxesAmount />
236
- <GiftCardAmount />
237
- <TotalAmount />
238
- <CheckoutLink />
239
- </OrderContainer>
240
- </OrderStorage>
241
- </CommerceLayer>
242
-
243
- // your code [...]
244
- ```
245
-
246
- You can change the amount format of each line of the summary by passing the `format` prop to the desired component (default is `formatted`).
247
-
248
- The `CheckoutLink` component lets you proceed to checkout and links to the checkout URL configured on Commerce Layer (_Settings → Markets_).
249
-
250
- # List of components
251
-
252
- These are the currently available Commerce Layer React Components.
253
-
254
- > Please note that not every Commerce Layer React component can be nested into any other one.
255
-
256
- For each component, the table below shows its props and the list of the permitted children (if any):
257
-
258
- >
259
-
260
- | Name | Props | Children |
261
- | -------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
262
- | `AddToCartButton` | `disabled`<br />`label`<br />`skuCode`<br />`lineItem`<br/>`lineItemOption`<br/>`quantity` |
263
- | `AvailabilityContainer` | `skuCode` | `AvailabilityTemplate` |
264
- | `AvailabilityTemplate` | `showShippingMethodName`<br />`timeFormat` |
265
- | `CheckoutLink` | `label` |
266
- | `CommerceLayer` | `accessToken`<br />`endpoint` | `GiftCardContainer`<br />`OrderContainer`<br />`PricesContainer` |
267
- | `DiscountAmount` | `className`<br />`format`<br />`id`<br />`name`<br />`style` |
268
- | `Errors` | `field`<br />`messages`<br />`resource` |
269
- | `ExternalFunction` | `url` | `AddToCartButton` |
270
- | `GiftCard` | `onSubmit` | `Errors`<br />`GiftCardCurrencySelector`<br />`GiftCardInput`<br />`MetadataInput`<br />`SubmitButton` |
271
- | `GiftCardAmount` | `className`<br />`format`<br />`id`<br />`name`<br />`style` |
272
- | `GiftCardContainer` | | `GiftCard`<br/>`Errors` |
273
- | `GiftCardCurrencySelector` | `placeholder`<br />`required`<br />`value` |
274
- | `GiftCardInput` | `name`<br />`placeholder`<br />`type` |
275
- `LineItem` | `type` | `Errors`<br />`LineItemAmount`<br />`LineItemImage`<br />`LineItemName`<br />`LineItemOptions`<br />`LineItemQuantity`<br />`LineItemRemoveLink` |
276
- | `LineItemAmount` | `className`<br />`format`<br />`id`<br />`name`<br />`style`<br />`type` |
277
- | `LineItemImage` | `width` |
278
- | `LineItemName` | |
279
- | `LineItemOption` | `keyClassName`<br />`keyId`<br />`keyStyle`<br />`name`<br />`valueClassName` |
280
- | `LineItemOptions` | `title`<br /> `showName`<br />`skuOptionId` | `LineItemOption` |
281
- | `LineItemQuantity` | `disabled`<br />`max` |
282
- | `LineItemRemoveLink` | `label` |
283
- | `LineItemsContainer` | `filters`<br />`loader` | `LineItem`<br />`LineItemsCount` |
284
- | `LineItemsCount` | `className`<br />`id`<br />`name`<br />`style` |
285
- | `MetadataInput` | `name`<br />`onChange`<br />`placeholder`<br />`type` |
286
- | `OrderContainer` | `attributes`<br />`metadata`<br />`orderId` | `CheckoutLink`<br />`DiscountAmount`<br />`GiftCardAmount`<br />`GiftCardContainer`<br />`ItemContainer`<br />`LineItemsContainer`<br />`ShippingAmount`<br />`SubTotalAmount`<br />`TaxesAmount`<br />`TotalAmount` |
287
- | `OrderStorage` | `clearWhenPlaced`<br />`persistKey` | `OrderContainer` |
288
- | `Price` | `compareClassName`<br />`showCompare`<br />`skuCode` |
289
- | `PricesContainer` | `filters`<br />`loader`<br />`perPage`<br />`skuCode` | `Price` |
290
- `ShippingAmount` | `className`<br />`format`<br />`id`<br />`name`<br />`style` |
291
- | `SubmitButton` | `label` |
292
- | `SubTotalAmount` | `className`<br />`format`<br />`id`<br />`name`<br />`style` |
293
- | `TaxesAmount` | `className`<br />`format`<br />`id`<br />`name`<br />`style` |
294
- | `TotalAmount` | `className`<br />`format`<br />`id`<br />`name`<br />`style` |
295
-
296
- For more detailed information on each components (i.e. prop types and default values, required props, etc.), have a look at the components folder [`src/components`](/src/components).
297
-
298
- ---
299
-
300
- ### License
301
-
302
- This repository is published under the [MIT](LICENSE) license.
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- import type { ErrorComponentProps } from '../typings/errors';
3
- declare type Props = ErrorComponentProps & Omit<JSX.IntrinsicElements['span'], 'children'>;
4
- export declare function Errors(props: Props): JSX.Element;
5
- export default Errors;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Errors=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("./utils/Parent")),GiftCardContext_1=tslib_1.__importDefault(require("../context/GiftCardContext")),OrderContext_1=tslib_1.__importDefault(require("../context/OrderContext")),AddressContext_1=tslib_1.__importDefault(require("../context/AddressContext")),getAllErrors_1=tslib_1.__importDefault(require("./utils/getAllErrors")),LineItemContext_1=tslib_1.__importDefault(require("../context/LineItemContext")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../context/LineItemChildrenContext")),CustomerContext_1=tslib_1.__importDefault(require("../context/CustomerContext")),PaymentMethodContext_1=tslib_1.__importDefault(require("../context/PaymentMethodContext")),PaymentMethodChildrenContext_1=tslib_1.__importDefault(require("../context/PaymentMethodChildrenContext")),ShipmentContext_1=tslib_1.__importDefault(require("../context/ShipmentContext"));function Errors(props){const{children,messages=[],resource,field,...p}=props,{payment}=(0,react_1.useContext)(PaymentMethodChildrenContext_1.default),{errors:orderErrors}=(0,react_1.useContext)(OrderContext_1.default),{errors:giftCardErrors}=(0,react_1.useContext)(GiftCardContext_1.default),{errors:lineItemErrors}=(0,react_1.useContext)(LineItemContext_1.default),{errors:addressErrors}=(0,react_1.useContext)(AddressContext_1.default),{errors:customerErrors}=(0,react_1.useContext)(CustomerContext_1.default),{errors:shipmentErrors}=(0,react_1.useContext)(ShipmentContext_1.default),{errors:paymentMethodErrors,currentPaymentMethodType,currentPaymentMethodId}=(0,react_1.useContext)(PaymentMethodContext_1.default),{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),allErrors=(0,react_1.useMemo)(()=>[...giftCardErrors||[],...orderErrors||[],...lineItemErrors||[],...addressErrors||[],...customerErrors||[],...shipmentErrors||[],...paymentMethodErrors?.filter(v=>v.field===currentPaymentMethodType&&payment?.id===currentPaymentMethodId)||[]],[giftCardErrors,orderErrors,lineItemErrors,addressErrors,customerErrors,shipmentErrors,paymentMethodErrors]).filter((v,k,a)=>v?.code!==a[k-1]?.code),msgErrors=(0,getAllErrors_1.default)({allErrors,field,messages,props:p,lineItem,resource,returnHtml:!children}),parentProps={messages,resource,field,errors:msgErrors,...p};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):(0,jsx_runtime_1.jsx)(react_1.Fragment,{children:msgErrors})}exports.Errors=Errors,exports.default=Errors;