@commercelayer/react-components 4.0.0-alpha.2 → 4.0.0-alpha.4

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 (570) hide show
  1. package/lib/cjs/components/Errors.js +1 -1
  2. package/lib/cjs/components/ExternalFunction.d.ts +1 -1
  3. package/lib/cjs/components/MetadataInput.d.ts +1 -1
  4. package/lib/cjs/components/SubmitButton.d.ts +1 -1
  5. package/lib/cjs/components/addresses/Address.d.ts +1 -1
  6. package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +2 -2
  7. package/lib/cjs/components/addresses/AddressField.d.ts +4 -4
  8. package/lib/cjs/components/addresses/AddressField.js +1 -1
  9. package/lib/cjs/components/addresses/AddressInput.d.ts +2 -2
  10. package/lib/cjs/components/addresses/AddressStateSelector.d.ts +2 -2
  11. package/lib/cjs/components/addresses/AddressesContainer.d.ts +1 -1
  12. package/lib/cjs/components/addresses/BillingAddressContainer.d.ts +6 -0
  13. package/lib/cjs/components/addresses/BillingAddressContainer.js +1 -0
  14. package/lib/{esm/components → cjs/components/addresses}/BillingAddressForm.d.ts +1 -1
  15. package/lib/cjs/components/addresses/BillingAddressForm.js +1 -0
  16. package/lib/cjs/components/addresses/SaveAddressesButton.d.ts +11 -0
  17. package/lib/cjs/components/addresses/SaveAddressesButton.js +1 -0
  18. package/lib/{esm/components → cjs/components/addresses}/ShippingAddressContainer.d.ts +1 -1
  19. package/lib/cjs/components/addresses/ShippingAddressContainer.js +1 -0
  20. package/lib/cjs/components/{ShippingAddressForm.d.ts → addresses/ShippingAddressForm.d.ts} +1 -1
  21. package/lib/cjs/components/addresses/ShippingAddressForm.js +1 -0
  22. package/lib/cjs/components/auth/CommerceLayer.d.ts +1 -1
  23. package/lib/cjs/components/customers/CustomerAddressForm.d.ts +1 -1
  24. package/lib/cjs/components/customers/CustomerAddressForm.js +1 -1
  25. package/lib/cjs/components/customers/SaveCustomerButton.d.ts +13 -0
  26. package/lib/cjs/components/{SaveCustomerButton.js → customers/SaveCustomerButton.js} +1 -1
  27. package/lib/cjs/components/{GiftCard.d.ts → gift_cards/GiftCard.d.ts} +2 -2
  28. package/lib/cjs/components/gift_cards/GiftCard.js +1 -0
  29. package/lib/{esm/components → cjs/components/gift_cards}/GiftCardContainer.d.ts +1 -1
  30. package/lib/cjs/components/gift_cards/GiftCardContainer.js +1 -0
  31. package/lib/cjs/components/{GiftCardCurrencySelector.d.ts → gift_cards/GiftCardCurrencySelector.d.ts} +2 -2
  32. package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.js +1 -0
  33. package/lib/{esm/components → cjs/components/gift_cards}/GiftCardInput.d.ts +3 -3
  34. package/lib/cjs/components/gift_cards/GiftCardInput.js +1 -0
  35. package/lib/cjs/components/{GiftCardOrCouponCode.d.ts → gift_cards/GiftCardOrCouponCode.d.ts} +2 -2
  36. package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.js +1 -0
  37. package/lib/{esm/components → cjs/components/gift_cards}/GiftCardOrCouponForm.d.ts +1 -1
  38. package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.js +1 -0
  39. package/lib/cjs/components/{GiftCardOrCouponInput.d.ts → gift_cards/GiftCardOrCouponInput.d.ts} +2 -2
  40. package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.js +1 -0
  41. package/lib/cjs/components/{GiftCardOrCouponRemoveButton.d.ts → gift_cards/GiftCardOrCouponRemoveButton.d.ts} +3 -3
  42. package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.js +1 -0
  43. package/lib/cjs/components/{GiftCardOrCouponSubmit.d.ts → gift_cards/GiftCardOrCouponSubmit.d.ts} +2 -2
  44. package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.js +1 -0
  45. package/lib/cjs/components/{GiftCardRecipient.d.ts → gift_cards/GiftCardRecipient.d.ts} +0 -0
  46. package/lib/cjs/components/{GiftCardRecipient.js → gift_cards/GiftCardRecipient.js} +0 -0
  47. package/lib/cjs/components/{GiftCardRecipientInput.d.ts → gift_cards/GiftCardRecipientInput.d.ts} +0 -0
  48. package/lib/cjs/components/{GiftCardRecipientInput.js → gift_cards/GiftCardRecipientInput.js} +0 -0
  49. package/lib/{esm/components → cjs/components/line_items}/LineItem.d.ts +2 -2
  50. package/lib/cjs/components/line_items/LineItem.js +1 -0
  51. package/lib/{esm/components → cjs/components/line_items}/LineItemAmount.d.ts +2 -2
  52. package/lib/cjs/components/line_items/LineItemAmount.js +1 -0
  53. package/lib/cjs/components/{LineItemCode.d.ts → line_items/LineItemCode.d.ts} +2 -2
  54. package/lib/cjs/components/line_items/LineItemCode.js +1 -0
  55. package/lib/cjs/components/{LineItemImage.d.ts → line_items/LineItemImage.d.ts} +3 -3
  56. package/lib/cjs/components/line_items/LineItemImage.js +1 -0
  57. package/lib/cjs/components/{LineItemName.d.ts → line_items/LineItemName.d.ts} +2 -2
  58. package/lib/cjs/components/line_items/LineItemName.js +1 -0
  59. package/lib/cjs/components/{LineItemOption.d.ts → line_items/LineItemOption.d.ts} +1 -1
  60. package/lib/cjs/components/line_items/LineItemOption.js +1 -0
  61. package/lib/cjs/components/{LineItemOptions.d.ts → line_items/LineItemOptions.d.ts} +0 -0
  62. package/lib/cjs/components/line_items/LineItemOptions.js +1 -0
  63. package/lib/{esm/components → cjs/components/line_items}/LineItemQuantity.d.ts +1 -1
  64. package/lib/cjs/components/line_items/LineItemQuantity.js +1 -0
  65. package/lib/cjs/components/{LineItemRemoveLink.d.ts → line_items/LineItemRemoveLink.d.ts} +1 -1
  66. package/lib/cjs/components/line_items/LineItemRemoveLink.js +1 -0
  67. package/lib/{esm/components → cjs/components/line_items}/LineItemsContainer.d.ts +2 -2
  68. package/lib/cjs/components/line_items/LineItemsContainer.js +1 -0
  69. package/lib/{esm/components → cjs/components/line_items}/LineItemsCount.d.ts +2 -2
  70. package/lib/cjs/components/line_items/LineItemsCount.js +1 -0
  71. package/lib/cjs/components/{LineItemsEmpty.d.ts → line_items/LineItemsEmpty.d.ts} +1 -1
  72. package/lib/cjs/components/line_items/LineItemsEmpty.js +1 -0
  73. package/lib/cjs/components/orders/AddToCartButton.d.ts +3 -3
  74. package/lib/cjs/components/orders/AddToCartButton.js +1 -1
  75. package/lib/cjs/components/orders/AdjustmentAmount.d.ts +2 -16
  76. package/lib/cjs/components/orders/AdjustmentAmount.js +1 -1
  77. package/lib/cjs/components/orders/CartLink.js +1 -1
  78. package/lib/cjs/components/{CheckoutLink.d.ts → orders/CheckoutLink.d.ts} +1 -11
  79. package/lib/cjs/components/orders/CheckoutLink.js +1 -0
  80. package/lib/cjs/components/{DiscountAmount.d.ts → orders/DiscountAmount.d.ts} +3 -3
  81. package/lib/cjs/components/orders/DiscountAmount.js +1 -0
  82. package/lib/{esm/components → cjs/components/orders}/ItemContainer.d.ts +1 -1
  83. package/lib/cjs/components/orders/ItemContainer.js +1 -0
  84. package/lib/cjs/components/orders/OrderContainer.d.ts +1 -1
  85. package/lib/cjs/components/orders/OrderList.d.ts +1 -1
  86. package/lib/cjs/components/orders/OrderListRow.d.ts +2 -2
  87. package/lib/cjs/components/orders/OrderStorage.d.ts +1 -1
  88. package/lib/cjs/components/orders/PlaceOrderButton.d.ts +1 -1
  89. package/lib/cjs/components/orders/PlaceOrderButton.js +1 -1
  90. package/lib/cjs/components/orders/PlaceOrderContainer.d.ts +1 -1
  91. package/lib/cjs/components/orders/PlaceOrderContainer.js +1 -1
  92. package/lib/{esm/components → cjs/components/orders}/ShippingAmount.d.ts +2 -2
  93. package/lib/cjs/components/orders/ShippingAmount.js +1 -0
  94. package/lib/cjs/components/{gateways → payment_gateways}/AdyenGateway.d.ts +1 -1
  95. package/lib/cjs/components/payment_gateways/AdyenGateway.js +1 -0
  96. package/lib/{esm/components/gateways → cjs/components/payment_gateways}/BraintreeGateway.d.ts +1 -1
  97. package/lib/cjs/components/payment_gateways/BraintreeGateway.js +1 -0
  98. package/lib/cjs/components/{gateways → payment_gateways}/CheckoutComGateway.d.ts +1 -1
  99. package/lib/cjs/components/payment_gateways/CheckoutComGateway.js +1 -0
  100. package/lib/{esm/components/gateways → cjs/components/payment_gateways}/KlarnaGateway.d.ts +1 -1
  101. package/lib/cjs/components/payment_gateways/KlarnaGateway.js +1 -0
  102. package/lib/cjs/components/{PaymentGateway.d.ts → payment_gateways/PaymentGateway.d.ts} +2 -2
  103. package/lib/cjs/components/payment_gateways/PaymentGateway.js +1 -0
  104. package/lib/cjs/components/{gateways → payment_gateways}/PaypalGateway.d.ts +1 -1
  105. package/lib/cjs/components/payment_gateways/PaypalGateway.js +1 -0
  106. package/lib/cjs/components/{gateways → payment_gateways}/StripeGateway.d.ts +1 -1
  107. package/lib/cjs/components/payment_gateways/StripeGateway.js +1 -0
  108. package/lib/cjs/components/{gateways → payment_gateways}/WireTransferGateway.d.ts +1 -1
  109. package/lib/cjs/components/payment_gateways/WireTransferGateway.js +1 -0
  110. package/lib/cjs/components/{PaymentMethod.d.ts → payment_methods/PaymentMethod.d.ts} +8 -3
  111. package/lib/cjs/components/payment_methods/PaymentMethod.js +1 -0
  112. package/lib/cjs/components/{PaymentMethodAmount.d.ts → payment_methods/PaymentMethodAmount.d.ts} +3 -3
  113. package/lib/cjs/components/payment_methods/PaymentMethodAmount.js +1 -0
  114. package/lib/{esm/components → cjs/components/payment_methods}/PaymentMethodName.d.ts +2 -2
  115. package/lib/cjs/components/payment_methods/PaymentMethodName.js +1 -0
  116. package/lib/cjs/components/{PaymentMethodPrice.d.ts → payment_methods/PaymentMethodPrice.d.ts} +2 -2
  117. package/lib/cjs/components/payment_methods/PaymentMethodPrice.js +1 -0
  118. package/lib/cjs/components/{PaymentMethodRadioButton.d.ts → payment_methods/PaymentMethodRadioButton.d.ts} +2 -2
  119. package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.js +1 -0
  120. package/lib/{esm/components → cjs/components/payment_methods}/PaymentMethodsContainer.d.ts +2 -2
  121. package/lib/cjs/components/payment_methods/PaymentMethodsContainer.js +1 -0
  122. package/lib/cjs/components/payment_source/AdyenPayment.d.ts +55 -0
  123. package/lib/cjs/components/payment_source/AdyenPayment.js +1 -0
  124. package/lib/cjs/components/{BraintreePayment.d.ts → payment_source/BraintreePayment.d.ts} +0 -0
  125. package/lib/cjs/components/payment_source/BraintreePayment.js +1 -0
  126. package/lib/{esm/components → cjs/components/payment_source}/CheckoutComPayment.d.ts +1 -1
  127. package/lib/cjs/components/payment_source/CheckoutComPayment.js +1 -0
  128. package/lib/cjs/components/{KlarnaPayment.d.ts → payment_source/KlarnaPayment.d.ts} +1 -1
  129. package/lib/cjs/components/payment_source/KlarnaPayment.js +1 -0
  130. package/lib/cjs/components/{PaymentSource.d.ts → payment_source/PaymentSource.d.ts} +4 -4
  131. package/lib/cjs/components/payment_source/PaymentSource.js +1 -0
  132. package/lib/{esm/components → cjs/components/payment_source}/PaymentSourceBrandIcon.d.ts +2 -2
  133. package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.js +1 -0
  134. package/lib/{esm/components → cjs/components/payment_source}/PaymentSourceBrandName.d.ts +2 -2
  135. package/lib/cjs/components/payment_source/PaymentSourceBrandName.js +1 -0
  136. package/lib/{esm/components → cjs/components/payment_source}/PaymentSourceDetail.d.ts +2 -2
  137. package/lib/cjs/components/payment_source/PaymentSourceDetail.js +1 -0
  138. package/lib/cjs/components/{PaymentSourceEditButton.d.ts → payment_source/PaymentSourceEditButton.d.ts} +2 -2
  139. package/lib/cjs/components/payment_source/PaymentSourceEditButton.js +1 -0
  140. package/lib/cjs/components/{PaypalPayment.d.ts → payment_source/PaypalPayment.d.ts} +0 -0
  141. package/lib/cjs/components/payment_source/PaypalPayment.js +1 -0
  142. package/lib/cjs/components/{StripePayment.d.ts → payment_source/StripePayment.d.ts} +1 -1
  143. package/lib/cjs/components/payment_source/StripePayment.js +1 -0
  144. package/lib/cjs/components/{WireTransferPayment.d.ts → payment_source/WireTransferPayment.d.ts} +3 -1
  145. package/lib/cjs/components/payment_source/WireTransferPayment.js +1 -0
  146. package/lib/cjs/components/{Price.d.ts → prices/Price.d.ts} +1 -1
  147. package/lib/cjs/components/prices/Price.js +1 -0
  148. package/lib/{esm/components → cjs/components/prices}/PricesContainer.d.ts +3 -3
  149. package/lib/cjs/components/prices/PricesContainer.js +1 -0
  150. package/lib/cjs/components/shipments/Shipment.d.ts +1 -1
  151. package/lib/cjs/components/shipments/ShipmentField.d.ts +3 -3
  152. package/lib/cjs/components/shipments/ShipmentsContainer.d.ts +1 -1
  153. package/lib/cjs/components/shipping_methods/ShippingMethod.d.ts +1 -1
  154. package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +2 -2
  155. package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.d.ts +2 -2
  156. package/lib/cjs/components/{AvailabilityContainer.d.ts → skus/AvailabilityContainer.d.ts} +1 -1
  157. package/lib/cjs/components/skus/AvailabilityContainer.js +1 -0
  158. package/lib/{esm/components → cjs/components/skus}/AvailabilityTemplate.d.ts +2 -2
  159. package/lib/cjs/components/skus/AvailabilityTemplate.js +1 -0
  160. package/lib/{esm/components → cjs/components/skus}/DeliveryLeadTime.d.ts +3 -3
  161. package/lib/cjs/components/skus/DeliveryLeadTime.js +1 -0
  162. package/lib/cjs/components/{QuantitySelector.d.ts → skus/QuantitySelector.d.ts} +1 -1
  163. package/lib/cjs/components/skus/QuantitySelector.js +1 -0
  164. package/lib/cjs/components/skus/SkuList.d.ts +1 -1
  165. package/lib/cjs/components/skus/SkuListsContainer.d.ts +1 -1
  166. package/lib/cjs/components/skus/SkuOption.d.ts +1 -1
  167. package/lib/cjs/components/skus/SkuOptionInput.d.ts +1 -1
  168. package/lib/cjs/components/skus/SkuOptionsContainer.d.ts +1 -1
  169. package/lib/cjs/components/skus/Skus.d.ts +1 -1
  170. package/lib/cjs/components/skus/SkusContainer.d.ts +0 -5
  171. package/lib/cjs/components/skus/SkusContainer.js +1 -1
  172. package/lib/cjs/components/{VariantSelector.d.ts → skus/VariantSelector.d.ts} +6 -6
  173. package/lib/cjs/components/skus/VariantSelector.js +1 -0
  174. package/lib/cjs/components/{VariantsContainer.d.ts → skus/VariantsContainer.d.ts} +1 -1
  175. package/lib/cjs/components/skus/VariantsContainer.js +1 -0
  176. package/lib/{esm/components → cjs/components/stock_transfers}/StockTransfer.d.ts +1 -1
  177. package/lib/cjs/components/stock_transfers/StockTransfer.js +1 -0
  178. package/lib/{esm/components → cjs/components/stock_transfers}/StockTransferField.d.ts +2 -2
  179. package/lib/cjs/components/stock_transfers/StockTransferField.js +1 -0
  180. package/lib/cjs/components/utils/BaseField.d.ts +2 -2
  181. package/lib/cjs/components/utils/BaseOrderPrice.js +1 -1
  182. package/lib/cjs/components/utils/Parent.d.ts +5 -5
  183. package/lib/cjs/components/utils/Parent.js +1 -1
  184. package/lib/cjs/components/utils/PriceTemplate.d.ts +1 -1
  185. package/lib/cjs/components/utils/VariantTemplate.d.ts +3 -3
  186. package/lib/cjs/components/utils/VariantTemplate.js +1 -1
  187. package/lib/cjs/components/utils/getAllErrors.d.ts +2 -2
  188. package/lib/cjs/config/components.d.ts +66 -66
  189. package/lib/cjs/context/OrderListChildrenContext.d.ts +3 -3
  190. package/lib/cjs/context/PlaceOrderContext.d.ts +2 -1
  191. package/lib/cjs/index.d.ts +55 -55
  192. package/lib/cjs/index.js +1 -1
  193. package/lib/cjs/reducers/AddressReducer.d.ts +1 -0
  194. package/lib/cjs/reducers/PaymentMethodReducer.d.ts +7 -6
  195. package/lib/cjs/reducers/PlaceOrderReducer.d.ts +7 -4
  196. package/lib/cjs/reducers/PlaceOrderReducer.js +1 -1
  197. package/lib/cjs/reducers/VariantReducer.d.ts +1 -1
  198. package/lib/cjs/typings/errors.d.ts +2 -2
  199. package/lib/cjs/typings/index.d.ts +10 -10
  200. package/lib/cjs/utils/childrenTypes.d.ts +1 -1
  201. package/lib/cjs/utils/getCardDetails.js +1 -1
  202. package/lib/cjs/utils/getLoaderComponent.js +1 -1
  203. package/lib/cjs/utils/paypalPayment.d.ts +1 -1
  204. package/lib/esm/components/Errors.js +1 -1
  205. package/lib/esm/components/ExternalFunction.d.ts +1 -1
  206. package/lib/esm/components/MetadataInput.d.ts +1 -1
  207. package/lib/esm/components/SubmitButton.d.ts +1 -1
  208. package/lib/esm/components/addresses/Address.d.ts +1 -1
  209. package/lib/esm/components/addresses/AddressCountrySelector.d.ts +2 -2
  210. package/lib/esm/components/addresses/AddressField.d.ts +4 -4
  211. package/lib/esm/components/addresses/AddressField.js +1 -1
  212. package/lib/esm/components/addresses/AddressInput.d.ts +2 -2
  213. package/lib/esm/components/addresses/AddressStateSelector.d.ts +2 -2
  214. package/lib/esm/components/addresses/AddressesContainer.d.ts +1 -1
  215. package/lib/esm/components/addresses/BillingAddressContainer.d.ts +6 -0
  216. package/lib/esm/components/addresses/BillingAddressContainer.js +1 -0
  217. package/lib/{cjs/components → esm/components/addresses}/BillingAddressForm.d.ts +1 -1
  218. package/lib/esm/components/addresses/BillingAddressForm.js +1 -0
  219. package/lib/esm/components/addresses/SaveAddressesButton.d.ts +11 -0
  220. package/lib/esm/components/addresses/SaveAddressesButton.js +1 -0
  221. package/lib/{cjs/components → esm/components/addresses}/ShippingAddressContainer.d.ts +1 -1
  222. package/lib/esm/components/addresses/ShippingAddressContainer.js +1 -0
  223. package/lib/esm/components/{ShippingAddressForm.d.ts → addresses/ShippingAddressForm.d.ts} +1 -1
  224. package/lib/esm/components/addresses/ShippingAddressForm.js +1 -0
  225. package/lib/esm/components/auth/CommerceLayer.d.ts +1 -1
  226. package/lib/esm/components/customers/CustomerAddressForm.d.ts +1 -1
  227. package/lib/esm/components/customers/CustomerAddressForm.js +1 -1
  228. package/lib/esm/components/customers/SaveCustomerButton.d.ts +13 -0
  229. package/lib/esm/components/customers/SaveCustomerButton.js +1 -0
  230. package/lib/esm/components/{GiftCard.d.ts → gift_cards/GiftCard.d.ts} +2 -2
  231. package/lib/esm/components/gift_cards/GiftCard.js +1 -0
  232. package/lib/{cjs/components → esm/components/gift_cards}/GiftCardContainer.d.ts +1 -1
  233. package/lib/esm/components/gift_cards/GiftCardContainer.js +1 -0
  234. package/lib/esm/components/{GiftCardCurrencySelector.d.ts → gift_cards/GiftCardCurrencySelector.d.ts} +2 -2
  235. package/lib/esm/components/gift_cards/GiftCardCurrencySelector.js +1 -0
  236. package/lib/{cjs/components → esm/components/gift_cards}/GiftCardInput.d.ts +3 -3
  237. package/lib/esm/components/gift_cards/GiftCardInput.js +1 -0
  238. package/lib/esm/components/{GiftCardOrCouponCode.d.ts → gift_cards/GiftCardOrCouponCode.d.ts} +2 -2
  239. package/lib/esm/components/gift_cards/GiftCardOrCouponCode.js +1 -0
  240. package/lib/{cjs/components → esm/components/gift_cards}/GiftCardOrCouponForm.d.ts +1 -1
  241. package/lib/esm/components/gift_cards/GiftCardOrCouponForm.js +1 -0
  242. package/lib/esm/components/{GiftCardOrCouponInput.d.ts → gift_cards/GiftCardOrCouponInput.d.ts} +2 -2
  243. package/lib/esm/components/gift_cards/GiftCardOrCouponInput.js +1 -0
  244. package/lib/esm/components/{GiftCardOrCouponRemoveButton.d.ts → gift_cards/GiftCardOrCouponRemoveButton.d.ts} +3 -3
  245. package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.js +1 -0
  246. package/lib/esm/components/{GiftCardOrCouponSubmit.d.ts → gift_cards/GiftCardOrCouponSubmit.d.ts} +2 -2
  247. package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.js +1 -0
  248. package/lib/esm/components/{GiftCardRecipient.d.ts → gift_cards/GiftCardRecipient.d.ts} +0 -0
  249. package/lib/esm/components/{GiftCardRecipient.js → gift_cards/GiftCardRecipient.js} +0 -0
  250. package/lib/esm/components/{GiftCardRecipientInput.d.ts → gift_cards/GiftCardRecipientInput.d.ts} +0 -0
  251. package/lib/esm/components/{GiftCardRecipientInput.js → gift_cards/GiftCardRecipientInput.js} +0 -0
  252. package/lib/{cjs/components → esm/components/line_items}/LineItem.d.ts +2 -2
  253. package/lib/esm/components/line_items/LineItem.js +1 -0
  254. package/lib/{cjs/components → esm/components/line_items}/LineItemAmount.d.ts +2 -2
  255. package/lib/esm/components/line_items/LineItemAmount.js +1 -0
  256. package/lib/esm/components/{LineItemCode.d.ts → line_items/LineItemCode.d.ts} +2 -2
  257. package/lib/esm/components/line_items/LineItemCode.js +1 -0
  258. package/lib/esm/components/{LineItemImage.d.ts → line_items/LineItemImage.d.ts} +3 -3
  259. package/lib/esm/components/line_items/LineItemImage.js +1 -0
  260. package/lib/esm/components/{LineItemName.d.ts → line_items/LineItemName.d.ts} +2 -2
  261. package/lib/esm/components/line_items/LineItemName.js +1 -0
  262. package/lib/esm/components/{LineItemOption.d.ts → line_items/LineItemOption.d.ts} +1 -1
  263. package/lib/esm/components/line_items/LineItemOption.js +1 -0
  264. package/lib/esm/components/{LineItemOptions.d.ts → line_items/LineItemOptions.d.ts} +0 -0
  265. package/lib/esm/components/line_items/LineItemOptions.js +1 -0
  266. package/lib/{cjs/components → esm/components/line_items}/LineItemQuantity.d.ts +1 -1
  267. package/lib/esm/components/line_items/LineItemQuantity.js +1 -0
  268. package/lib/esm/components/{LineItemRemoveLink.d.ts → line_items/LineItemRemoveLink.d.ts} +1 -1
  269. package/lib/esm/components/line_items/LineItemRemoveLink.js +1 -0
  270. package/lib/{cjs/components → esm/components/line_items}/LineItemsContainer.d.ts +2 -2
  271. package/lib/esm/components/line_items/LineItemsContainer.js +1 -0
  272. package/lib/{cjs/components → esm/components/line_items}/LineItemsCount.d.ts +2 -2
  273. package/lib/esm/components/line_items/LineItemsCount.js +1 -0
  274. package/lib/esm/components/{LineItemsEmpty.d.ts → line_items/LineItemsEmpty.d.ts} +1 -1
  275. package/lib/esm/components/line_items/LineItemsEmpty.js +1 -0
  276. package/lib/esm/components/orders/AddToCartButton.d.ts +3 -3
  277. package/lib/esm/components/orders/AddToCartButton.js +1 -1
  278. package/lib/esm/components/orders/AdjustmentAmount.d.ts +2 -16
  279. package/lib/esm/components/orders/AdjustmentAmount.js +1 -1
  280. package/lib/esm/components/orders/CartLink.js +1 -1
  281. package/lib/esm/components/{CheckoutLink.d.ts → orders/CheckoutLink.d.ts} +1 -11
  282. package/lib/esm/components/orders/CheckoutLink.js +1 -0
  283. package/lib/esm/components/{DiscountAmount.d.ts → orders/DiscountAmount.d.ts} +3 -3
  284. package/lib/esm/components/orders/DiscountAmount.js +1 -0
  285. package/lib/{cjs/components → esm/components/orders}/ItemContainer.d.ts +1 -1
  286. package/lib/esm/components/orders/ItemContainer.js +1 -0
  287. package/lib/esm/components/orders/OrderContainer.d.ts +1 -1
  288. package/lib/esm/components/orders/OrderList.d.ts +1 -1
  289. package/lib/esm/components/orders/OrderListRow.d.ts +2 -2
  290. package/lib/esm/components/orders/OrderStorage.d.ts +1 -1
  291. package/lib/esm/components/orders/PlaceOrderButton.d.ts +1 -1
  292. package/lib/esm/components/orders/PlaceOrderButton.js +1 -1
  293. package/lib/esm/components/orders/PlaceOrderContainer.d.ts +1 -1
  294. package/lib/esm/components/orders/PlaceOrderContainer.js +1 -1
  295. package/lib/{cjs/components → esm/components/orders}/ShippingAmount.d.ts +2 -2
  296. package/lib/esm/components/orders/ShippingAmount.js +1 -0
  297. package/lib/esm/components/{gateways → payment_gateways}/AdyenGateway.d.ts +1 -1
  298. package/lib/esm/components/payment_gateways/AdyenGateway.js +1 -0
  299. package/lib/{cjs/components/gateways → esm/components/payment_gateways}/BraintreeGateway.d.ts +1 -1
  300. package/lib/esm/components/payment_gateways/BraintreeGateway.js +1 -0
  301. package/lib/esm/components/{gateways → payment_gateways}/CheckoutComGateway.d.ts +1 -1
  302. package/lib/esm/components/payment_gateways/CheckoutComGateway.js +1 -0
  303. package/lib/{cjs/components/gateways → esm/components/payment_gateways}/KlarnaGateway.d.ts +1 -1
  304. package/lib/esm/components/payment_gateways/KlarnaGateway.js +1 -0
  305. package/lib/esm/components/{PaymentGateway.d.ts → payment_gateways/PaymentGateway.d.ts} +2 -2
  306. package/lib/esm/components/payment_gateways/PaymentGateway.js +1 -0
  307. package/lib/esm/components/{gateways → payment_gateways}/PaypalGateway.d.ts +1 -1
  308. package/lib/esm/components/payment_gateways/PaypalGateway.js +1 -0
  309. package/lib/esm/components/{gateways → payment_gateways}/StripeGateway.d.ts +1 -1
  310. package/lib/esm/components/payment_gateways/StripeGateway.js +1 -0
  311. package/lib/esm/components/{gateways → payment_gateways}/WireTransferGateway.d.ts +1 -1
  312. package/lib/esm/components/payment_gateways/WireTransferGateway.js +1 -0
  313. package/lib/esm/components/{PaymentMethod.d.ts → payment_methods/PaymentMethod.d.ts} +8 -3
  314. package/lib/esm/components/payment_methods/PaymentMethod.js +1 -0
  315. package/lib/esm/components/{PaymentMethodAmount.d.ts → payment_methods/PaymentMethodAmount.d.ts} +3 -3
  316. package/lib/esm/components/payment_methods/PaymentMethodAmount.js +1 -0
  317. package/lib/{cjs/components → esm/components/payment_methods}/PaymentMethodName.d.ts +2 -2
  318. package/lib/esm/components/payment_methods/PaymentMethodName.js +1 -0
  319. package/lib/esm/components/{PaymentMethodPrice.d.ts → payment_methods/PaymentMethodPrice.d.ts} +2 -2
  320. package/lib/esm/components/payment_methods/PaymentMethodPrice.js +1 -0
  321. package/lib/esm/components/{PaymentMethodRadioButton.d.ts → payment_methods/PaymentMethodRadioButton.d.ts} +2 -2
  322. package/lib/esm/components/payment_methods/PaymentMethodRadioButton.js +1 -0
  323. package/lib/{cjs/components → esm/components/payment_methods}/PaymentMethodsContainer.d.ts +2 -2
  324. package/lib/esm/components/payment_methods/PaymentMethodsContainer.js +1 -0
  325. package/lib/esm/components/payment_source/AdyenPayment.d.ts +55 -0
  326. package/lib/esm/components/payment_source/AdyenPayment.js +1 -0
  327. package/lib/esm/components/{BraintreePayment.d.ts → payment_source/BraintreePayment.d.ts} +0 -0
  328. package/lib/esm/components/payment_source/BraintreePayment.js +1 -0
  329. package/lib/{cjs/components → esm/components/payment_source}/CheckoutComPayment.d.ts +1 -1
  330. package/lib/esm/components/payment_source/CheckoutComPayment.js +1 -0
  331. package/lib/esm/components/{KlarnaPayment.d.ts → payment_source/KlarnaPayment.d.ts} +1 -1
  332. package/lib/esm/components/payment_source/KlarnaPayment.js +1 -0
  333. package/lib/esm/components/{PaymentSource.d.ts → payment_source/PaymentSource.d.ts} +4 -4
  334. package/lib/esm/components/payment_source/PaymentSource.js +1 -0
  335. package/lib/{cjs/components → esm/components/payment_source}/PaymentSourceBrandIcon.d.ts +2 -2
  336. package/lib/esm/components/payment_source/PaymentSourceBrandIcon.js +1 -0
  337. package/lib/{cjs/components → esm/components/payment_source}/PaymentSourceBrandName.d.ts +2 -2
  338. package/lib/esm/components/payment_source/PaymentSourceBrandName.js +1 -0
  339. package/lib/{cjs/components → esm/components/payment_source}/PaymentSourceDetail.d.ts +2 -2
  340. package/lib/esm/components/payment_source/PaymentSourceDetail.js +1 -0
  341. package/lib/esm/components/{PaymentSourceEditButton.d.ts → payment_source/PaymentSourceEditButton.d.ts} +2 -2
  342. package/lib/esm/components/payment_source/PaymentSourceEditButton.js +1 -0
  343. package/lib/esm/components/{PaypalPayment.d.ts → payment_source/PaypalPayment.d.ts} +0 -0
  344. package/lib/esm/components/payment_source/PaypalPayment.js +1 -0
  345. package/lib/esm/components/{StripePayment.d.ts → payment_source/StripePayment.d.ts} +1 -1
  346. package/lib/esm/components/payment_source/StripePayment.js +1 -0
  347. package/lib/esm/components/{WireTransferPayment.d.ts → payment_source/WireTransferPayment.d.ts} +3 -1
  348. package/lib/esm/components/payment_source/WireTransferPayment.js +1 -0
  349. package/lib/esm/components/{Price.d.ts → prices/Price.d.ts} +1 -1
  350. package/lib/esm/components/prices/Price.js +1 -0
  351. package/lib/{cjs/components → esm/components/prices}/PricesContainer.d.ts +3 -3
  352. package/lib/esm/components/prices/PricesContainer.js +1 -0
  353. package/lib/esm/components/shipments/Shipment.d.ts +1 -1
  354. package/lib/esm/components/shipments/ShipmentField.d.ts +3 -3
  355. package/lib/esm/components/shipments/ShipmentsContainer.d.ts +1 -1
  356. package/lib/esm/components/shipping_methods/ShippingMethod.d.ts +1 -1
  357. package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +2 -2
  358. package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.d.ts +2 -2
  359. package/lib/esm/components/{AvailabilityContainer.d.ts → skus/AvailabilityContainer.d.ts} +1 -1
  360. package/lib/esm/components/skus/AvailabilityContainer.js +1 -0
  361. package/lib/{cjs/components → esm/components/skus}/AvailabilityTemplate.d.ts +2 -2
  362. package/lib/esm/components/skus/AvailabilityTemplate.js +1 -0
  363. package/lib/{cjs/components → esm/components/skus}/DeliveryLeadTime.d.ts +3 -3
  364. package/lib/esm/components/skus/DeliveryLeadTime.js +1 -0
  365. package/lib/esm/components/{QuantitySelector.d.ts → skus/QuantitySelector.d.ts} +1 -1
  366. package/lib/esm/components/skus/QuantitySelector.js +1 -0
  367. package/lib/esm/components/skus/SkuList.d.ts +1 -1
  368. package/lib/esm/components/skus/SkuListsContainer.d.ts +1 -1
  369. package/lib/esm/components/skus/SkuOption.d.ts +1 -1
  370. package/lib/esm/components/skus/SkuOptionInput.d.ts +1 -1
  371. package/lib/esm/components/skus/SkuOptionsContainer.d.ts +1 -1
  372. package/lib/esm/components/skus/Skus.d.ts +1 -1
  373. package/lib/esm/components/skus/SkusContainer.d.ts +0 -5
  374. package/lib/esm/components/skus/SkusContainer.js +1 -1
  375. package/lib/esm/components/{VariantSelector.d.ts → skus/VariantSelector.d.ts} +6 -6
  376. package/lib/esm/components/skus/VariantSelector.js +1 -0
  377. package/lib/esm/components/{VariantsContainer.d.ts → skus/VariantsContainer.d.ts} +1 -1
  378. package/lib/esm/components/skus/VariantsContainer.js +1 -0
  379. package/lib/{cjs/components → esm/components/stock_transfers}/StockTransfer.d.ts +1 -1
  380. package/lib/esm/components/stock_transfers/StockTransfer.js +1 -0
  381. package/lib/{cjs/components → esm/components/stock_transfers}/StockTransferField.d.ts +2 -2
  382. package/lib/esm/components/stock_transfers/StockTransferField.js +1 -0
  383. package/lib/esm/components/utils/BaseField.d.ts +2 -2
  384. package/lib/esm/components/utils/BaseOrderPrice.js +1 -1
  385. package/lib/esm/components/utils/Parent.d.ts +5 -5
  386. package/lib/esm/components/utils/Parent.js +1 -1
  387. package/lib/esm/components/utils/PriceTemplate.d.ts +1 -1
  388. package/lib/esm/components/utils/VariantTemplate.d.ts +3 -3
  389. package/lib/esm/components/utils/VariantTemplate.js +1 -1
  390. package/lib/esm/components/utils/getAllErrors.d.ts +2 -2
  391. package/lib/esm/config/components.d.ts +66 -66
  392. package/lib/esm/context/OrderListChildrenContext.d.ts +3 -3
  393. package/lib/esm/context/PlaceOrderContext.d.ts +2 -1
  394. package/lib/esm/index.d.ts +55 -55
  395. package/lib/esm/index.js +1 -1
  396. package/lib/esm/reducers/AddressReducer.d.ts +1 -0
  397. package/lib/esm/reducers/PaymentMethodReducer.d.ts +7 -6
  398. package/lib/esm/reducers/PlaceOrderReducer.d.ts +7 -4
  399. package/lib/esm/reducers/PlaceOrderReducer.js +1 -1
  400. package/lib/esm/reducers/VariantReducer.d.ts +1 -1
  401. package/lib/esm/typings/errors.d.ts +2 -2
  402. package/lib/esm/typings/index.d.ts +10 -10
  403. package/lib/esm/utils/childrenTypes.d.ts +1 -1
  404. package/lib/esm/utils/getCardDetails.js +1 -1
  405. package/lib/esm/utils/getLoaderComponent.js +1 -1
  406. package/lib/esm/utils/paypalPayment.d.ts +1 -1
  407. package/lib/tsconfig.prod.esm.tsbuildinfo +1 -1
  408. package/lib/tsconfig.prod.tsbuildinfo +1 -1
  409. package/package.json +76 -20
  410. package/lib/cjs/components/AdjustmentAmount.d.ts +0 -4
  411. package/lib/cjs/components/AdjustmentAmount.js +0 -1
  412. package/lib/cjs/components/AdyenPayment.d.ts +0 -25
  413. package/lib/cjs/components/AdyenPayment.js +0 -1
  414. package/lib/cjs/components/AvailabilityContainer.js +0 -1
  415. package/lib/cjs/components/AvailabilityTemplate.js +0 -1
  416. package/lib/cjs/components/BillingAddressContainer.d.ts +0 -11
  417. package/lib/cjs/components/BillingAddressContainer.js +0 -1
  418. package/lib/cjs/components/BillingAddressForm.js +0 -1
  419. package/lib/cjs/components/BraintreePayment.js +0 -1
  420. package/lib/cjs/components/CartLink.d.ts +0 -12
  421. package/lib/cjs/components/CartLink.js +0 -1
  422. package/lib/cjs/components/CheckoutComPayment.js +0 -1
  423. package/lib/cjs/components/CheckoutLink.js +0 -1
  424. package/lib/cjs/components/DeliveryLeadTime.js +0 -1
  425. package/lib/cjs/components/DiscountAmount.js +0 -1
  426. package/lib/cjs/components/GiftCard.js +0 -1
  427. package/lib/cjs/components/GiftCardContainer.js +0 -1
  428. package/lib/cjs/components/GiftCardCurrencySelector.js +0 -1
  429. package/lib/cjs/components/GiftCardInput.js +0 -1
  430. package/lib/cjs/components/GiftCardOrCouponCode.js +0 -1
  431. package/lib/cjs/components/GiftCardOrCouponForm.js +0 -1
  432. package/lib/cjs/components/GiftCardOrCouponInput.js +0 -1
  433. package/lib/cjs/components/GiftCardOrCouponRemoveButton.js +0 -1
  434. package/lib/cjs/components/GiftCardOrCouponSubmit.js +0 -1
  435. package/lib/cjs/components/ItemContainer.js +0 -1
  436. package/lib/cjs/components/KlarnaPayment.js +0 -1
  437. package/lib/cjs/components/LineItem.js +0 -1
  438. package/lib/cjs/components/LineItemAmount.js +0 -1
  439. package/lib/cjs/components/LineItemCode.js +0 -1
  440. package/lib/cjs/components/LineItemImage.js +0 -1
  441. package/lib/cjs/components/LineItemName.js +0 -1
  442. package/lib/cjs/components/LineItemOption.js +0 -1
  443. package/lib/cjs/components/LineItemOptions.js +0 -1
  444. package/lib/cjs/components/LineItemQuantity.js +0 -1
  445. package/lib/cjs/components/LineItemRemoveLink.js +0 -1
  446. package/lib/cjs/components/LineItemsContainer.js +0 -1
  447. package/lib/cjs/components/LineItemsCount.js +0 -1
  448. package/lib/cjs/components/LineItemsEmpty.js +0 -1
  449. package/lib/cjs/components/PaymentGateway.js +0 -1
  450. package/lib/cjs/components/PaymentMethod.js +0 -1
  451. package/lib/cjs/components/PaymentMethodAmount.js +0 -1
  452. package/lib/cjs/components/PaymentMethodName.js +0 -1
  453. package/lib/cjs/components/PaymentMethodPrice.js +0 -1
  454. package/lib/cjs/components/PaymentMethodRadioButton.js +0 -1
  455. package/lib/cjs/components/PaymentMethodsContainer.js +0 -1
  456. package/lib/cjs/components/PaymentSource.js +0 -1
  457. package/lib/cjs/components/PaymentSourceBrandIcon.js +0 -1
  458. package/lib/cjs/components/PaymentSourceBrandName.js +0 -1
  459. package/lib/cjs/components/PaymentSourceDetail.js +0 -1
  460. package/lib/cjs/components/PaymentSourceEditButton.js +0 -1
  461. package/lib/cjs/components/PaypalPayment.js +0 -1
  462. package/lib/cjs/components/Price.js +0 -1
  463. package/lib/cjs/components/PricesContainer.js +0 -1
  464. package/lib/cjs/components/QuantitySelector.js +0 -1
  465. package/lib/cjs/components/SaveAddressesButton.d.ts +0 -23
  466. package/lib/cjs/components/SaveAddressesButton.js +0 -1
  467. package/lib/cjs/components/SaveCustomerButton.d.ts +0 -24
  468. package/lib/cjs/components/ShippingAddressContainer.js +0 -1
  469. package/lib/cjs/components/ShippingAddressForm.js +0 -1
  470. package/lib/cjs/components/ShippingAmount.js +0 -1
  471. package/lib/cjs/components/SkuField.d.ts +0 -10
  472. package/lib/cjs/components/SkuField.js +0 -1
  473. package/lib/cjs/components/Skus.d.ts +0 -11
  474. package/lib/cjs/components/Skus.js +0 -1
  475. package/lib/cjs/components/SkusContainer.d.ts +0 -14
  476. package/lib/cjs/components/SkusContainer.js +0 -1
  477. package/lib/cjs/components/StockTransfer.js +0 -1
  478. package/lib/cjs/components/StockTransferField.js +0 -1
  479. package/lib/cjs/components/StripePayment.js +0 -1
  480. package/lib/cjs/components/VariantSelector.js +0 -1
  481. package/lib/cjs/components/VariantsContainer.js +0 -1
  482. package/lib/cjs/components/WireTransferPayment.js +0 -1
  483. package/lib/cjs/components/gateways/AdyenGateway.js +0 -1
  484. package/lib/cjs/components/gateways/BraintreeGateway.js +0 -1
  485. package/lib/cjs/components/gateways/CheckoutComGateway.js +0 -1
  486. package/lib/cjs/components/gateways/KlarnaGateway.js +0 -1
  487. package/lib/cjs/components/gateways/PaypalGateway.js +0 -1
  488. package/lib/cjs/components/gateways/StripeGateway.js +0 -1
  489. package/lib/cjs/components/gateways/WireTransferGateway.js +0 -1
  490. package/lib/esm/components/AdjustmentAmount.d.ts +0 -4
  491. package/lib/esm/components/AdjustmentAmount.js +0 -1
  492. package/lib/esm/components/AdyenPayment.d.ts +0 -25
  493. package/lib/esm/components/AdyenPayment.js +0 -1
  494. package/lib/esm/components/AvailabilityContainer.js +0 -1
  495. package/lib/esm/components/AvailabilityTemplate.js +0 -1
  496. package/lib/esm/components/BillingAddressContainer.d.ts +0 -11
  497. package/lib/esm/components/BillingAddressContainer.js +0 -1
  498. package/lib/esm/components/BillingAddressForm.js +0 -1
  499. package/lib/esm/components/BraintreePayment.js +0 -1
  500. package/lib/esm/components/CartLink.d.ts +0 -12
  501. package/lib/esm/components/CartLink.js +0 -1
  502. package/lib/esm/components/CheckoutComPayment.js +0 -1
  503. package/lib/esm/components/CheckoutLink.js +0 -1
  504. package/lib/esm/components/DeliveryLeadTime.js +0 -1
  505. package/lib/esm/components/DiscountAmount.js +0 -1
  506. package/lib/esm/components/GiftCard.js +0 -1
  507. package/lib/esm/components/GiftCardContainer.js +0 -1
  508. package/lib/esm/components/GiftCardCurrencySelector.js +0 -1
  509. package/lib/esm/components/GiftCardInput.js +0 -1
  510. package/lib/esm/components/GiftCardOrCouponCode.js +0 -1
  511. package/lib/esm/components/GiftCardOrCouponForm.js +0 -1
  512. package/lib/esm/components/GiftCardOrCouponInput.js +0 -1
  513. package/lib/esm/components/GiftCardOrCouponRemoveButton.js +0 -1
  514. package/lib/esm/components/GiftCardOrCouponSubmit.js +0 -1
  515. package/lib/esm/components/ItemContainer.js +0 -1
  516. package/lib/esm/components/KlarnaPayment.js +0 -1
  517. package/lib/esm/components/LineItem.js +0 -1
  518. package/lib/esm/components/LineItemAmount.js +0 -1
  519. package/lib/esm/components/LineItemCode.js +0 -1
  520. package/lib/esm/components/LineItemImage.js +0 -1
  521. package/lib/esm/components/LineItemName.js +0 -1
  522. package/lib/esm/components/LineItemOption.js +0 -1
  523. package/lib/esm/components/LineItemOptions.js +0 -1
  524. package/lib/esm/components/LineItemQuantity.js +0 -1
  525. package/lib/esm/components/LineItemRemoveLink.js +0 -1
  526. package/lib/esm/components/LineItemsContainer.js +0 -1
  527. package/lib/esm/components/LineItemsCount.js +0 -1
  528. package/lib/esm/components/LineItemsEmpty.js +0 -1
  529. package/lib/esm/components/PaymentGateway.js +0 -1
  530. package/lib/esm/components/PaymentMethod.js +0 -1
  531. package/lib/esm/components/PaymentMethodAmount.js +0 -1
  532. package/lib/esm/components/PaymentMethodName.js +0 -1
  533. package/lib/esm/components/PaymentMethodPrice.js +0 -1
  534. package/lib/esm/components/PaymentMethodRadioButton.js +0 -1
  535. package/lib/esm/components/PaymentMethodsContainer.js +0 -1
  536. package/lib/esm/components/PaymentSource.js +0 -1
  537. package/lib/esm/components/PaymentSourceBrandIcon.js +0 -1
  538. package/lib/esm/components/PaymentSourceBrandName.js +0 -1
  539. package/lib/esm/components/PaymentSourceDetail.js +0 -1
  540. package/lib/esm/components/PaymentSourceEditButton.js +0 -1
  541. package/lib/esm/components/PaypalPayment.js +0 -1
  542. package/lib/esm/components/Price.js +0 -1
  543. package/lib/esm/components/PricesContainer.js +0 -1
  544. package/lib/esm/components/QuantitySelector.js +0 -1
  545. package/lib/esm/components/SaveAddressesButton.d.ts +0 -23
  546. package/lib/esm/components/SaveAddressesButton.js +0 -1
  547. package/lib/esm/components/SaveCustomerButton.d.ts +0 -24
  548. package/lib/esm/components/SaveCustomerButton.js +0 -1
  549. package/lib/esm/components/ShippingAddressContainer.js +0 -1
  550. package/lib/esm/components/ShippingAddressForm.js +0 -1
  551. package/lib/esm/components/ShippingAmount.js +0 -1
  552. package/lib/esm/components/SkuField.d.ts +0 -10
  553. package/lib/esm/components/SkuField.js +0 -1
  554. package/lib/esm/components/Skus.d.ts +0 -11
  555. package/lib/esm/components/Skus.js +0 -1
  556. package/lib/esm/components/SkusContainer.d.ts +0 -14
  557. package/lib/esm/components/SkusContainer.js +0 -1
  558. package/lib/esm/components/StockTransfer.js +0 -1
  559. package/lib/esm/components/StockTransferField.js +0 -1
  560. package/lib/esm/components/StripePayment.js +0 -1
  561. package/lib/esm/components/VariantSelector.js +0 -1
  562. package/lib/esm/components/VariantsContainer.js +0 -1
  563. package/lib/esm/components/WireTransferPayment.js +0 -1
  564. package/lib/esm/components/gateways/AdyenGateway.js +0 -1
  565. package/lib/esm/components/gateways/BraintreeGateway.js +0 -1
  566. package/lib/esm/components/gateways/CheckoutComGateway.js +0 -1
  567. package/lib/esm/components/gateways/KlarnaGateway.js +0 -1
  568. package/lib/esm/components/gateways/PaypalGateway.js +0 -1
  569. package/lib/esm/components/gateways/StripeGateway.js +0 -1
  570. package/lib/esm/components/gateways/WireTransferGateway.js +0 -1
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ import { FunctionChildren } from '../../typings/index';
3
+ declare type ChildrenProps = FunctionChildren<Omit<Props, 'children'>>;
4
+ declare type Props = {
5
+ children?: ChildrenProps;
6
+ label?: string | ReactNode;
7
+ onClick?: () => void;
8
+ addressId?: string;
9
+ } & JSX.IntrinsicElements['button'];
10
+ export declare function SaveAddressesButton(props: Props): JSX.Element;
11
+ export default SaveAddressesButton;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useState}from"react";import Parent from"../utils/Parent";import AddressContext from"../../context/AddressContext";import{shippingAddressController,countryLockController,billingAddressController}from"../../utils/addressesManager";import OrderContext from"../../context/OrderContext";import CustomerContext from"../../context/CustomerContext";import isFunction from"lodash/isFunction";export function SaveAddressesButton(props){const{children,label="Continue to delivery",resource,disabled=!1,addressId,onClick,...p}=props,{errors,billing_address,shipToDifferentAddress,shipping_address,saveAddresses,billingAddressId,shippingAddressId}=useContext(AddressContext),{order}=useContext(OrderContext),{addresses,isGuest,createCustomerAddress}=useContext(CustomerContext),[forceDisable,setForceDisable]=useState(disabled),customerEmail=(isGuest===!0||typeof isGuest>"u")&&!order?.customer_email,billingDisable=billingAddressController({billing_address,errors,billingAddressId,requiresBillingInfo:order?.requires_billing_info}),shippingDisable=shippingAddressController({billingDisable,errors,shipToDifferentAddress,shipping_address,shippingAddressId}),countryLockDisable=countryLockController({countryCodeLock:order?.shipping_country_code_lock,addresses,shipToDifferentAddress,billingAddressId,billing_address,shipping_address,shippingAddressId}),disable=disabled||customerEmail||billingDisable||shippingDisable||countryLockDisable,handleClick=()=>{if(errors&&Object.keys(errors).length===0&&!disable){if(setForceDisable(!0),order)saveAddresses();else if(createCustomerAddress&&billing_address){const address={...billing_address};addressId&&(address.id=addressId),createCustomerAddress(address)}setForceDisable(!1),onClick&&onClick()}},parentProps={...p,label,resource,handleClick,disabled:disable};return children?_jsx(Parent,{...parentProps,children}):_jsx("button",{type:"button",disabled:disable||forceDisable,onClick:handleClick,...p,children:isFunction(label)?label():label})}export default SaveAddressesButton;
@@ -5,7 +5,7 @@ declare type Props = {
5
5
  export declare function ShippingAddressContainer(props: Props): JSX.Element;
6
6
  export declare namespace ShippingAddressContainer {
7
7
  var propTypes: {
8
- children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
8
+ children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
9
9
  };
10
10
  }
11
11
  export default ShippingAddressContainer;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import ShippingAddressContext from"../../context/ShippingAddressContext";import{useContext,useEffect,useReducer}from"react";import shippingAddressReducer,{setShippingAddress,shippingAddressInitialState,setShippingCustomerAddressId}from"../../reducers/ShippingAddressReducer";import CommerceLayerContext from"../../context/CommerceLayerContext";import components from"../../config/components";import OrderContext from"../../context/OrderContext";import AddressContext from"../../context/AddressContext";const propTypes=components.ShippingAddressContainer.propTypes;export function ShippingAddressContainer(props){const{children}=props,[state,dispatch]=useReducer(shippingAddressReducer,shippingAddressInitialState),config=useContext(CommerceLayerContext),{order}=useContext(OrderContext),{setCloneAddress}=useContext(AddressContext);useEffect(()=>(order&&config&&setShippingCustomerAddressId({dispatch,order,setCloneAddress}),()=>{dispatch({type:"cleanup",payload:{}})}),[config,order]);const contextValue={...state,setShippingAddress:async(id,options)=>{await setShippingAddress(id,{config,dispatch,order,customerAddressId:options?.customerAddressId}),setCloneAddress(id,"shipping_address")}};return _jsx(ShippingAddressContext.Provider,{value:contextValue,children})}ShippingAddressContainer.propTypes=propTypes;export default ShippingAddressContainer;
@@ -7,7 +7,7 @@ declare type Props = {
7
7
  export declare function ShippingAddressForm(props: Props): JSX.Element;
8
8
  export declare namespace ShippingAddressForm {
9
9
  var propTypes: {
10
- children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
10
+ children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
11
11
  };
12
12
  }
13
13
  export default ShippingAddressForm;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import AddressesContext from"../../context/AddressContext";import{useRapidForm}from"rapid-form";import{useContext,useEffect,useRef}from"react";import ShippingAddressFormContext from"../../context/ShippingAddressFormContext";import{isEmpty}from"lodash";import components from"../../config/components";import OrderContext from"../../context/OrderContext";import{getSaveShippingAddressToAddressBook}from"../../utils/localStorage";import{businessMandatoryField}from"../../utils/validateFormFields";const propTypes=components.ShippingAddressForm.propTypes;export function ShippingAddressForm(props){const{children,errorClassName,autoComplete="on",reset=!1,...p}=props,{validation,values,errors,reset:resetForm}=useRapidForm(),{setAddressErrors,setAddress,shipToDifferentAddress,isBusiness}=useContext(AddressesContext),{saveAddressToCustomerAddressBook,include,addResourceToInclude,includeLoaded}=useContext(OrderContext),ref=useRef(null);useEffect(()=>{if(include?.includes("shipping_address")?includeLoaded?.shipping_address||addResourceToInclude({newResourceLoaded:{shipping_address:!0}}):addResourceToInclude({newResource:"shipping_address"}),isEmpty(errors)){if(!isEmpty(values)&&shipToDifferentAddress){setAddressErrors([],"shipping_address");for(const name in values){const field=values[name];businessMandatoryField(name,isBusiness)||delete values[name],(field?.value||field?.required===!1&&field?.type!=="checkbox")&&(values[name.replace("shipping_address_","")]=field.value,delete values[name]),field?.type==="checkbox"&&(delete values[name],saveAddressToCustomerAddressBook({type:"shipping_address",value:field.checked}))}setAddress({values:{...values,...isBusiness&&{business:isBusiness}},resource:"shipping_address"})}}else{const formErrors=[];for(const fieldName in errors){const code=errors[fieldName]?.code,message=errors[fieldName]?.message;["shipping_address_state_code"].includes(fieldName)?isEmpty(values.state_code)?delete errors[fieldName]:formErrors.push({code,message:message||"",resource:"shipping_address",field:fieldName}):formErrors.push({code,message:message||"",resource:"shipping_address",field:fieldName})}shipToDifferentAddress&&setAddressErrors(formErrors,"shipping_address")}const checkboxChecked=ref.current?.querySelector('[name="shipping_address_save_to_customer_book"]')?.checked||getSaveShippingAddressToAddressBook();reset&&(!isEmpty(values)||!isEmpty(errors)||checkboxChecked)&&(saveAddressToCustomerAddressBook&&saveAddressToCustomerAddressBook({type:"shipping_address",value:!1}),ref&&(ref.current?.reset(),resetForm({target:ref.current}),setAddressErrors([],"shipping_address"),setAddress({values:{},resource:"shipping_address"})))},[values,errors,shipToDifferentAddress,reset,include,includeLoaded,isBusiness]);const providerValues={values,validation,setValue:(name,value)=>{const field={[name.replace("shipping_address_","")]:value};setAddress({values:{...values,...field,...isBusiness&&{business:isBusiness}},resource:"shipping_address"})},errorClassName,errors,resetField:name=>resetForm({currentTarget:ref.current},name)};return _jsx(ShippingAddressFormContext.Provider,{value:providerValues,children:_jsx("form",{ref,autoComplete,...p,children})})}ShippingAddressForm.propTypes=propTypes;export default ShippingAddressForm;
@@ -7,7 +7,7 @@ declare type Props = {
7
7
  export declare function CommerceLayer(props: Props): JSX.Element;
8
8
  export declare namespace CommerceLayer {
9
9
  var propTypes: {
10
- children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
10
+ children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
11
11
  accessToken: import("prop-types").Validator<string>;
12
12
  endpoint: import("prop-types").Validator<string>;
13
13
  };
@@ -7,7 +7,7 @@ declare type Props = {
7
7
  export declare function CustomerAddressForm(props: Props): JSX.Element;
8
8
  export declare namespace CustomerAddressForm {
9
9
  var propTypes: {
10
- children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
10
+ children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
11
11
  };
12
12
  }
13
13
  export default CustomerAddressForm;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import AddressesContext from"../../context/AddressContext";import{useRapidForm}from"rapid-form";import{useContext,useEffect,useRef}from"react";import CustomerAddressFormContext from"../../context/CustomerAddressFormContext";import components from"../../config/components";import OrderContext from"../../context/OrderContext";import isEmptyStates from"../../utils/isEmptyStates";const propTypes=components.CustomerAddressForm.propTypes;export function CustomerAddressForm(props){const{children,errorClassName,autoComplete="on",reset=!1,...p}=props,{validation,values,errors,reset:resetForm}=useRapidForm(),{setAddressErrors,setAddress}=useContext(AddressesContext),{order}=useContext(OrderContext),ref=useRef(null);useEffect(()=>{if(Object.keys(errors).length>0){const formErrors=[];for(const fieldName in errors){const code=errors[fieldName]?.code,message=errors[fieldName]?.message||"";fieldName==="billing_address_state_code"?values.state_code?delete errors[fieldName]:formErrors.push({code,message,resource:"billing_address",field:fieldName}):formErrors.push({code,message,resource:"billing_address",field:fieldName})}setAddressErrors(formErrors,"billing_address")}else if(Object.keys(values).length>0){setAddressErrors([],"billing_address");for(const name in values){const field=values[name];if(field?.value&&(values[name.replace("billing_address_","")]=field.value,delete values[name]),["billing_address_state_code"].includes(name)){const countryCode=values.billing_address_country_code?.value||values.country_code;!isEmptyStates(countryCode)&&!field.value&&delete values.billing_address_state_code}}setAddress({values,resource:"billing_address"})}reset&&(Object.keys(values).length>0||Object.keys(errors).length>0)&&ref&&(ref.current?.reset(),resetForm({target:ref.current}),setAddressErrors([],"billing_address"),setAddress({values:{},resource:"billing_address"}))},[errors,values,reset]);const providerValues={values,validation,setValue:(name,value)=>{const field={[name.replace("billing_address_","")]:value};setAddress({values:{...values,...field},resource:"billing_address"})},errorClassName,requiresBillingInfo:order?.requiresBillingInfo||!1,errors,resetField:name=>resetForm({currentTarget:ref.current},name)};return _jsx(CustomerAddressFormContext.Provider,{value:providerValues,children:_jsx("form",{ref,autoComplete,...p,children})})}CustomerAddressForm.propTypes=propTypes;export default CustomerAddressForm;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import AddressesContext from"../../context/AddressContext";import{useRapidForm}from"rapid-form";import{useContext,useEffect,useRef}from"react";import CustomerAddressFormContext from"../../context/CustomerAddressFormContext";import components from"../../config/components";import OrderContext from"../../context/OrderContext";import isEmptyStates from"../../utils/isEmptyStates";const propTypes=components.CustomerAddressForm.propTypes;export function CustomerAddressForm(props){const{children,errorClassName,autoComplete="on",reset=!1,...p}=props;console.log(useRapidForm);debugger;const{validation,values,errors,reset:resetForm}=useRapidForm(),{setAddressErrors,setAddress}=useContext(AddressesContext),{order}=useContext(OrderContext),ref=useRef(null);useEffect(()=>{if(Object.keys(errors).length>0){const formErrors=[];for(const fieldName in errors){const code=errors[fieldName]?.code,message=errors[fieldName]?.message||"";fieldName==="billing_address_state_code"?values.state_code?delete errors[fieldName]:formErrors.push({code,message,resource:"billing_address",field:fieldName}):formErrors.push({code,message,resource:"billing_address",field:fieldName})}setAddressErrors(formErrors,"billing_address")}else if(Object.keys(values).length>0){setAddressErrors([],"billing_address");for(const name in values){const field=values[name];if(field?.value&&(values[name.replace("billing_address_","")]=field.value,delete values[name]),["billing_address_state_code"].includes(name)){const countryCode=values.billing_address_country_code?.value||values.country_code;!isEmptyStates(countryCode)&&!field.value&&delete values.billing_address_state_code}}setAddress({values,resource:"billing_address"})}reset&&(Object.keys(values).length>0||Object.keys(errors).length>0)&&ref&&(ref.current?.reset(),resetForm({target:ref.current}),setAddressErrors([],"billing_address"),setAddress({values:{},resource:"billing_address"}))},[errors,values,reset]);const providerValues={values,validation,setValue:(name,value)=>{const field={[name.replace("billing_address_","")]:value};setAddress({values:{...values,...field},resource:"billing_address"})},errorClassName,requiresBillingInfo:order?.requiresBillingInfo||!1,errors,resetField:name=>resetForm({currentTarget:ref.current},name)};return _jsx(CustomerAddressFormContext.Provider,{value:providerValues,children:_jsx("form",{ref,autoComplete,...p,children})})}CustomerAddressForm.propTypes=propTypes;export default CustomerAddressForm;
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ import { FunctionChildren } from '../../typings/index';
3
+ declare type ParentProps = {
4
+ handleClick: () => void;
5
+ };
6
+ declare type ChildrenProps = FunctionChildren<Omit<Props & ParentProps, 'children'>>;
7
+ declare type Props = {
8
+ children?: ChildrenProps;
9
+ label?: string | ReactNode;
10
+ onClick?: () => void;
11
+ } & JSX.IntrinsicElements['button'];
12
+ export declare function SaveCustomerButton(props: Props): JSX.Element;
13
+ export default SaveCustomerButton;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import Parent from"../utils/Parent";import{isEmpty}from"lodash";import CustomerContext from"../../context/CustomerContext";export function SaveCustomerButton(props){const{children,label="Save",resource,disabled,onClick,...p}=props,{errors,saveCustomerUser,customerEmail}=useContext(CustomerContext),disable=disabled||!isEmpty(errors)||isEmpty(customerEmail),handleClick=async()=>{isEmpty(errors)&&!disable&&(saveCustomerUser&&await saveCustomerUser(customerEmail),onClick&&onClick())},parentProps={...p,label,resource,handleClick,disabled:disable};return children?_jsx(Parent,{...parentProps,children}):_jsx("button",{type:"button",disabled:disable,onClick:void 0,...p,children:label})}export default SaveCustomerButton;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { BaseState } from '../typings/index';
2
+ import { BaseState } from '../../typings/index';
3
3
  declare type Props = {
4
4
  children: ReactNode;
5
5
  onSubmit?: (values: BaseState) => void;
@@ -7,7 +7,7 @@ declare type Props = {
7
7
  export declare function GiftCard(props: Props): JSX.Element;
8
8
  export declare namespace GiftCard {
9
9
  var propTypes: {
10
- children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
10
+ children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
11
11
  onSubmit: import("prop-types").Requireable<(...args: any[]) => any>;
12
12
  };
13
13
  var defaultProps: {
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useRef,useContext}from"react";import validateFormFields from"../../utils/validateFormFields";import{isEmpty}from"lodash";import GiftCardContext from"../../context/GiftCardContext";import components from"../../config/components";const propTypes=components.GiftCard.propTypes,defaultProps=components.GiftCard.defaultProps,displayName=components.GiftCard.displayName;export function GiftCard(props){const{children,onSubmit}=props,name="giftCardForm",ref=useRef(null),{addGiftCard,addGiftCardError}=useContext(GiftCardContext);return _jsx(Fragment,{children:_jsx("form",{name,ref,onSubmit:e=>{e.preventDefault();const currentForm=ref.current,elements=currentForm?.elements,{errors,values}=validateFormFields(elements,["currencyCode","balanceCents"],"gift_cards");isEmpty(errors)?(addGiftCard(values),currentForm?.reset(),onSubmit&&onSubmit(values)):addGiftCardError(errors)},children},name)})}GiftCard.propTypes=propTypes,GiftCard.defaultProps=defaultProps,GiftCard.displayName=displayName;export default GiftCard;
@@ -5,7 +5,7 @@ export declare type Props = {
5
5
  export declare function GiftCardContainer(props: Props): JSX.Element;
6
6
  export declare namespace GiftCardContainer {
7
7
  var propTypes: {
8
- children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
8
+ children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
9
9
  };
10
10
  var displayName: string;
11
11
  }
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useReducer,useContext}from"react";import GiftCardContext from"../../context/GiftCardContext";import CommerceLayerContext from"../../context/CommerceLayerContext";import giftCardReducer,{giftCardInitialState,addGiftCardRecipient,addGiftCard,addGiftCardError,addGiftCardLoading}from"../../reducers/GiftCardReducer";import OrderContext from"../../context/OrderContext";import components from"../../config/components";const propTypes=components.GiftCardContainer.propTypes,displayName=components.GiftCardContainer.displayName;export function GiftCardContainer(props){const{children}=props,[state,dispatch]=useReducer(giftCardReducer,giftCardInitialState),config=useContext(CommerceLayerContext),{getOrder,createOrder,order}=useContext(OrderContext),giftCardValue={...state,addGiftCardRecipient:values=>addGiftCardRecipient(values,config,dispatch),addGiftCard:values=>addGiftCard({...values},{config,dispatch,getOrder,createOrder,order}),addGiftCardError:errors=>addGiftCardError(errors,dispatch),addGiftCardLoading:loading=>addGiftCardLoading(loading,dispatch)};return _jsx(GiftCardContext.Provider,{value:giftCardValue,children})}GiftCardContainer.propTypes=propTypes,GiftCardContainer.displayName=displayName;export default GiftCardContainer;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { BaseSelectComponentProps } from '../typings/index';
2
+ import { BaseSelectComponentProps } from '../../typings/index';
3
3
  declare type Props = Omit<BaseSelectComponentProps, 'options' | 'name'> & {
4
4
  required?: boolean;
5
5
  } & Pick<JSX.IntrinsicElements['select'], 'className' | 'id' | 'style'>;
@@ -8,7 +8,7 @@ export declare namespace GiftCardCurrencySelector {
8
8
  var propTypes: {
9
9
  children: import("prop-types").Requireable<(...args: any[]) => any>;
10
10
  placeholder: import("prop-types").Requireable<import("prop-types").InferProps<{
11
- value: import("prop-types").Validator<string | number>;
11
+ value: import("prop-types").Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
12
12
  label: import("prop-types").Validator<string>;
13
13
  }>>;
14
14
  value: import("prop-types").Requireable<string>;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import BaseSelect from"../utils/BaseSelect";import currencyOptions from"../../config/currency";import components from"../../config/components";const propTypes=components.GiftCardCurrencySelector.propTypes,defaultProps=components.GiftCardCurrencySelector.defaultProps,displayName=components.GiftCardCurrencySelector.displayName;export function GiftCardCurrencySelector(props){return _jsx(BaseSelect,{options:currencyOptions,name:"currencyCode",...props})}GiftCardCurrencySelector.propTypes=propTypes,GiftCardCurrencySelector.defaultProps=defaultProps,GiftCardCurrencySelector.displayName=displayName;export default GiftCardCurrencySelector;
@@ -1,13 +1,13 @@
1
1
  /// <reference types="react" />
2
- import { BaseInputComponentProps, GiftCardInputName } from '../typings/index';
2
+ import { BaseInputComponentProps, GiftCardInputName } from '../../typings/index';
3
3
  declare type Props = {
4
4
  name: GiftCardInputName;
5
5
  } & Omit<BaseInputComponentProps, 'name'> & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['textarea'];
6
6
  export declare function GiftCardInput(props: Props): JSX.Element;
7
7
  export declare namespace GiftCardInput {
8
8
  var propTypes: {
9
- type: import("prop-types").Validator<import("../typings/index").BaseInputType>;
10
- name: import("prop-types").Validator<GiftCardInputName>;
9
+ type: import("prop-types").Validator<NonNullable<import("../../typings/index").BaseInputType>>;
10
+ name: import("prop-types").Validator<NonNullable<GiftCardInputName>>;
11
11
  children: import("prop-types").Requireable<(...args: any[]) => any>;
12
12
  placeholder: import("prop-types").Requireable<string>;
13
13
  };
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import BaseInput from"../utils/BaseInput";import components from"../../config/components";const propTypes=components.GiftCardInput.propTypes,displayName=components.GiftCardInput.displayName;export function GiftCardInput(props){const{placeholder="",...p}=props;return _jsx(BaseInput,{placeholder,...p})}GiftCardInput.propTypes=propTypes,GiftCardInput.displayName=displayName;export default GiftCardInput;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { FunctionChildren } from '../typings/index';
3
- import type { CodeType } from '../reducers/OrderReducer';
2
+ import { FunctionChildren } from '../../typings/index';
3
+ import type { CodeType } from '../../reducers/OrderReducer';
4
4
  declare type ChildrenProps = Omit<Props, 'children'> & {
5
5
  code?: string;
6
6
  hide?: boolean;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import components from"../../config/components";import Parent from"../utils/Parent";import OrderContext from"../../context/OrderContext";import has from"lodash/has";import isEmpty from"lodash/isEmpty";const propTypes=components.GiftCardOrCouponCode.propTypes,displayName=components.GiftCardOrCouponCode.displayName;export function GiftCardOrCouponCode({children,type,...props}){const{order}=useContext(OrderContext);let codeType=type&&`${type}_code`;!type&&order&&has(order,"coupon_code")&&!isEmpty(order.coupon_code)?codeType="coupon_code":type||(codeType="gift_card_code");const code=order&&codeType?order[codeType]:"",hide=!(order&&code),parentProps={...props,code,hide,discountAmountCents:order?.discount_amount_cents,discountAmountFloat:order?.discount_amount_float,formattedDiscountAmount:order?.formatted_discount_amount};return children?_jsx(Parent,{...parentProps,children}):hide?null:_jsx("span",{...props,children:code})}GiftCardOrCouponCode.propTypes=propTypes,GiftCardOrCouponCode.displayName=displayName;export default GiftCardOrCouponCode;
@@ -9,7 +9,7 @@ declare type Props = {
9
9
  export declare function GiftCardOrCouponForm(props: Props): JSX.Element | null;
10
10
  export declare namespace GiftCardOrCouponForm {
11
11
  var propTypes: {
12
- children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
12
+ children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
13
13
  };
14
14
  }
15
15
  export default GiftCardOrCouponForm;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useRapidForm}from"rapid-form";import{useContext,useEffect,useRef,useState}from"react";import CouponAndGiftCardFormContext from"../../context/CouponAndGiftCardFormContext";import OrderContext from"../../context/OrderContext";import isEmpty from"lodash/isEmpty";import components from"../../config/components";import camelCase from"lodash/camelCase";import dropWhile from"lodash/dropWhile";import has from"lodash/has";import{findIndex}from"lodash";const propTypes=components.GiftCardOrCouponForm.propTypes;export function GiftCardOrCouponForm(props){const{children,autoComplete="on",onSubmit,...p}=props,{validation,values,reset}=useRapidForm(),[codeType,setCodeType]=useState("gift_card_or_coupon_code"),{setGiftCardOrCouponCode,order,errors,setOrderErrors}=useContext(OrderContext),ref=useRef(null),inputName="gift_card_or_coupon_code";useEffect(()=>{if(values[inputName]?.value===""&&findIndex(errors,{field:camelCase(inputName)})!==-1){const err=dropWhile(errors,i=>i.field===camelCase(inputName));setOrderErrors(err),onSubmit&&onSubmit({value:values[inputName]?.value,success:!1})}values[inputName]?.value===""&&(setOrderErrors([]),onSubmit&&onSubmit({value:values[inputName]?.value,success:!1}))},[values]),useEffect(()=>{order?.gift_card_code&&!order?.coupon_code&&setCodeType("coupon_code"),!order?.gift_card_code&&order?.coupon_code&&setCodeType("gift_card_code"),!order?.gift_card_code&&!order?.coupon_code&&setCodeType("gift_card_or_coupon_code")},[order]);const handleSubmit=async e=>{e.preventDefault();const code=has(values,inputName)?values[inputName].value:void 0;if(code){const{success}=await setGiftCardOrCouponCode({code,codeType}),value=values[inputName]?.value;onSubmit&&onSubmit({success,value}),success&&reset(e)}};return order?.gift_card_code&&order?.coupon_code||isEmpty(order)?null:_jsx(CouponAndGiftCardFormContext.Provider,{value:{validation,codeType},children:_jsx("form",{ref,autoComplete,onSubmit:handleSubmit,...p,children})})}GiftCardOrCouponForm.propTypes=propTypes;export default GiftCardOrCouponForm;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { BaseInputComponentProps } from '../typings/index';
3
- import { OrderCodeType } from '../reducers/OrderReducer';
2
+ import { BaseInputComponentProps } from '../../typings/index';
3
+ import { OrderCodeType } from '../../reducers/OrderReducer';
4
4
  declare type Props = {
5
5
  name?: 'gift_card_or_coupon_code';
6
6
  type?: 'text';
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import components from"../../config/components";import BaseInput from"../utils/BaseInput";import CouponAndGiftCardFormContext from"../../context/CouponAndGiftCardFormContext";const propTypes=components.GiftCardOrCouponInput.propTypes,displayName=components.GiftCardOrCouponInput.displayName;export function GiftCardOrCouponInput(props){const{placeholder="",required,value,placeholderTranslation,...p}=props,{validation,codeType}=useContext(CouponAndGiftCardFormContext);let placeholderLabel=placeholder;return placeholderTranslation&&codeType&&(placeholderLabel=placeholderTranslation(codeType)),_jsx(BaseInput,{type:"text",name:"gift_card_or_coupon_code",ref:validation,required:required!==void 0?required:!0,placeholder:placeholderLabel,defaultValue:value,...p})}GiftCardOrCouponInput.propTypes=propTypes,GiftCardOrCouponInput.displayName=displayName;export default GiftCardOrCouponInput;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { FunctionChildren } from '../typings/index';
3
- import { CodeType, OrderCodeType } from '../reducers/OrderReducer';
2
+ import { FunctionChildren } from '../../typings/index';
3
+ import { CodeType, OrderCodeType } from '../../reducers/OrderReducer';
4
4
  declare type GiftCardOrCouponRemoveButtonChildrenProps = FunctionChildren<Omit<Props, 'children'> & {
5
5
  codeType?: OrderCodeType;
6
6
  hide?: boolean;
@@ -19,7 +19,7 @@ export declare namespace GiftCardOrCouponRemoveButton {
19
19
  var propTypes: {
20
20
  children: import("prop-types").Requireable<(...args: any[]) => any>;
21
21
  type: import("prop-types").Requireable<CodeType>;
22
- label: import("prop-types").Requireable<string | object>;
22
+ label: import("prop-types").Requireable<NonNullable<string | object | null | undefined>>;
23
23
  };
24
24
  var displayName: string;
25
25
  }
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import Parent from"../utils/Parent";import components from"../../config/components";import OrderContext from"../../context/OrderContext";import{has,isEmpty}from"lodash";const propTypes=components.GiftCardOrCouponRemoveButton.propTypes,displayName=components.GiftCardOrCouponRemoveButton.displayName;export function GiftCardOrCouponRemoveButton(props){const{children,label="Remove",onClick,type,...p}=props,{order,removeGiftCardOrCouponCode}=useContext(OrderContext);let codeType=`${type}_code`;!type&&order&&has(order,"coupon_code")&&!isEmpty(order.coupon_code)?codeType="coupon_code":type||(codeType="gift_card_code");const code=order&&codeType?order[codeType]:"",hide=!(order&&code),handleClick=async()=>{const response=removeGiftCardOrCouponCode&&await removeGiftCardOrCouponCode({codeType});onClick&&onClick(response)},parentProps={...p,label,handleClick,codeType};return children?_jsx(Parent,{...parentProps,children}):hide?null:_jsx("button",{type:"button",onClick:handleClick,...p,children:label})}GiftCardOrCouponRemoveButton.propTypes=propTypes,GiftCardOrCouponRemoveButton.displayName=displayName;export default GiftCardOrCouponRemoveButton;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { FunctionChildren } from '../typings/index';
2
+ import { FunctionChildren } from '../../typings/index';
3
3
  declare type GiftCardOrCouponSubmitChildrenProps = FunctionChildren<Omit<Props, 'children'>>;
4
4
  declare type Props = {
5
5
  children?: GiftCardOrCouponSubmitChildrenProps;
@@ -9,7 +9,7 @@ export declare function GiftCardOrCouponSubmit(props: Props): JSX.Element;
9
9
  export declare namespace GiftCardOrCouponSubmit {
10
10
  var propTypes: {
11
11
  children: import("prop-types").Requireable<(...args: any[]) => any>;
12
- label: import("prop-types").Requireable<string | object>;
12
+ label: import("prop-types").Requireable<NonNullable<string | object | null | undefined>>;
13
13
  };
14
14
  var displayName: string;
15
15
  }
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import components from"../../config/components";const propTypes=components.GiftCardOrCouponSubmit.propTypes,displayName=components.GiftCardOrCouponSubmit.displayName;export function GiftCardOrCouponSubmit(props){const{children,label="Submit",...p}=props,parentProps={...p,label};return children?_jsx(Parent,{...parentProps,children}):_jsx("button",{type:"submit",...p,children:label})}GiftCardOrCouponSubmit.propTypes=propTypes,GiftCardOrCouponSubmit.displayName=displayName;export default GiftCardOrCouponSubmit;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { LineItemType } from '../typings/index';
2
+ import { LineItemType } from '../../typings/index';
3
3
  declare type Props = {
4
4
  children: ReactNode;
5
5
  type?: LineItemType;
@@ -7,7 +7,7 @@ declare type Props = {
7
7
  export declare function LineItem(props: Props): JSX.Element;
8
8
  export declare namespace LineItem {
9
9
  var propTypes: {
10
- children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
10
+ children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
11
11
  type: import("prop-types").Requireable<LineItemType>;
12
12
  };
13
13
  var displayName: string;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import{useContext}from"react";import LineItemContext from"../../context/LineItemContext";import LineItemChildrenContext from"../../context/LineItemChildrenContext";import components from"../../config/components";import ShipmentChildrenContext from"../../context/ShipmentChildrenContext";const propTypes=components.LineItem.propTypes,displayName=components.LineItem.displayName;export function LineItem(props){const{type="skus",children}=props,{lineItems}=useContext(LineItemContext),{lineItems:shipmentLineItems}=useContext(ShipmentChildrenContext),items=shipmentLineItems&&shipmentLineItems?.length>0?shipmentLineItems:lineItems,components2=items&&items.filter(l=>l.item_type===type).map((lineItem,k,check)=>{if(lineItem.item_type==="bundles"&&k>0&&check[k-1]?.bundle_code===lineItem.bundle_code||lineItem.item_type==="gift_cards"&&lineItem?.total_amount_cents&&lineItem?.total_amount_cents<=0)return null;const lineProps={lineItem};return _jsx(LineItemChildrenContext.Provider,{value:lineProps,children},k)});return _jsx(_Fragment,{children:components2})}LineItem.propTypes=propTypes,LineItem.displayName=displayName;export default LineItem;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { BaseAmountComponent, BasePriceType } from '../typings/index';
2
+ import { BaseAmountComponent, BasePriceType } from '../../typings/index';
3
3
  declare type Props = BaseAmountComponent & {
4
4
  type?: BasePriceType;
5
5
  };
@@ -12,7 +12,7 @@ export declare namespace LineItemAmount {
12
12
  style: import("prop-types").Requireable<object>;
13
13
  name: import("prop-types").Requireable<string>;
14
14
  children: import("prop-types").Requireable<(...args: any[]) => any>;
15
- format: import("prop-types").Requireable<import("../typings/index").BaseFormatPrice>;
15
+ format: import("prop-types").Requireable<import("../../typings/index").BaseFormatPrice>;
16
16
  };
17
17
  var defaultProps: Props;
18
18
  var displayName: string;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useState,useEffect,useContext}from"react";import getAmount from"../../utils/getAmount";import LineItemChildrenContext from"../../context/LineItemChildrenContext";import Parent from"../utils/Parent";import components from"../../config/components";const propTypes=components.LineItemAmount.propTypes,defaultProps=components.LineItemAmount.defaultProps,displayName=components.LineItemAmount.displayName;export function LineItemAmount(props){const{format="formatted",type="total",...p}=props,{lineItem}=useContext(LineItemChildrenContext),[price,setPrice]=useState("");useEffect(()=>{if(lineItem){const p2=getAmount({base:"amount",type,format,obj:lineItem});setPrice(p2)}return()=>{setPrice("")}},[lineItem]);const parentProps={price,...p};return props.children?_jsx(Parent,{...parentProps,children:props.children}):_jsx("span",{...p,children:price})}LineItemAmount.propTypes=propTypes,LineItemAmount.defaultProps=defaultProps,LineItemAmount.displayName=displayName;export default LineItemAmount;
@@ -1,11 +1,11 @@
1
- import { ReactNode } from 'react';
1
+ /// <reference types="react" />
2
2
  import { LineItem } from '@commercelayer/sdk';
3
3
  export declare type LineItemCodeType = Omit<Props, 'children'> & {
4
4
  lineItem: LineItem;
5
5
  skuCode: string;
6
6
  };
7
7
  declare type Props = {
8
- children?: (props: LineItemCodeType) => ReactNode;
8
+ children?: (props: LineItemCodeType) => JSX.Element;
9
9
  type?: 'sku_code' | 'bundle_code';
10
10
  } & JSX.IntrinsicElements['p'];
11
11
  export declare function LineItemCode({ type, children, ...p }: Props): JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import LineItemChildrenContext from"../../context/LineItemChildrenContext";import Parent from"../utils/Parent";import components from"../../config/components";const propTypes=components.LineItemCode.propTypes,displayName=components.LineItemCode.displayName;export function LineItemCode({type="sku_code",children,...p}){const{lineItem}=useContext(LineItemChildrenContext),labelName=lineItem?.[type],parentProps={lineItem,skuCode:labelName,...p};return children?_jsx(Parent,{...parentProps,children}):_jsx("p",{...p,children:labelName})}LineItemCode.propTypes=propTypes,LineItemCode.displayName=displayName;export default LineItemCode;
@@ -1,12 +1,12 @@
1
- import { ReactNode } from 'react';
1
+ /// <reference types="react" />
2
2
  import { LineItem } from '@commercelayer/sdk';
3
- import { LineItemType } from '../typings/index';
3
+ import { LineItemType } from '../../typings/index';
4
4
  export declare type LineItemImageType = Omit<Props, 'children'> & {
5
5
  src: string;
6
6
  lineItem: LineItem;
7
7
  };
8
8
  declare type Props = {
9
- children?: (props: LineItemImageType) => ReactNode;
9
+ children?: (props: LineItemImageType) => JSX.Element;
10
10
  width?: number;
11
11
  placeholder?: {
12
12
  [K in LineItemType]?: string;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import Parent from"../utils/Parent";import LineItemChildrenContext from"../../context/LineItemChildrenContext";import components from"../../config/components";import{defaultGiftCardImgUrl,defaultImgUrl}from"../../utils/placeholderImages";const propTypes=components.LineItemImage.propTypes,displayName=components.LineItemImage.displayName;export function LineItemImage(props){const{placeholder,children,...p}=props,{lineItem}=useContext(LineItemChildrenContext),itemType=lineItem?.item_type;let src=lineItem?.image_url;src||(placeholder?.[itemType]?src=placeholder?.[itemType]:src=itemType==="gift_cards"?defaultGiftCardImgUrl:defaultImgUrl);const parenProps={lineItem,src,placeholder,...p};return children?_jsx(Parent,{...parenProps,children}):src?_jsx("img",{alt:"",src,...p}):null}LineItemImage.propTypes=propTypes,LineItemImage.displayName=displayName;export default LineItemImage;
@@ -1,11 +1,11 @@
1
- import { ReactNode } from 'react';
1
+ /// <reference types="react" />
2
2
  import type { LineItem } from '@commercelayer/sdk';
3
3
  export declare type LineItemNameType = Omit<Props, 'children'> & {
4
4
  label: string;
5
5
  lineItem: LineItem;
6
6
  };
7
7
  declare type Props = {
8
- children?: (props: LineItemNameType) => ReactNode;
8
+ children?: (props: LineItemNameType) => JSX.Element;
9
9
  } & JSX.IntrinsicElements['p'];
10
10
  export declare function LineItemName(props: Props): JSX.Element;
11
11
  export declare namespace LineItemName {
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import LineItemChildrenContext from"../../context/LineItemChildrenContext";import Parent from"../utils/Parent";import components from"../../config/components";const propTypes=components.LineItemName.propTypes,displayName=components.LineItemName.displayName;export function LineItemName(props){const{lineItem}=useContext(LineItemChildrenContext),label=lineItem?.name,parentProps={label,lineItem,...props};return props.children?_jsx(Parent,{...parentProps,children:props.children}):_jsx("p",{...props,children:label})}LineItemName.propTypes=propTypes,LineItemName.displayName=displayName;export default LineItemName;
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties } from 'react';
2
2
  import { LineItemOption as LineItemOptionType } from '@commercelayer/sdk';
3
- import { FunctionChildren } from '../typings/index';
3
+ import { FunctionChildren } from '../../typings/index';
4
4
  declare type LineItemOptionChildrenProps = FunctionChildren<Omit<Props, 'children'> & {
5
5
  lineItemOption: LineItemOptionType;
6
6
  }>;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext}from"react";import LineItemOptionChildrenContext from"../../context/LineItemOptionChildrenContext";import get from"lodash/get";import has from"lodash/has";import map from"lodash/map";import Parent from"../utils/Parent";import components from"../../config/components";import isJSON from"../../utils/isJSON";const propTypes=components.LineItemOption.propTypes,displayName=components.LineItemOption.displayName;export function LineItemOption(props){const{name,children,valueClassName,key,tagElement="li",tagContainer="ul",...p}=props,{lineItemOption,showAll}=useContext(LineItemOptionChildrenContext),parentProps={...props,lineItemOption},TagElement=tagElement,TagContainer=tagContainer,components2=showAll&&isJSON(JSON.stringify(lineItemOption?.options))?map(lineItemOption?.options,(value,key2)=>_jsxs(TagElement,{...p,children:[`${key2}:`,_jsx("span",{className:valueClassName,children:`${value}`})]},key2)):has(lineItemOption,`options.${name}`)?_jsxs(TagElement,{...p,children:[`${name}:`,_jsx("span",{className:valueClassName,...p,children:`${get(lineItemOption,`options.${name}`)}`})]},key):null;return children?_jsx(Parent,{...parentProps,children:props.children}):_jsx(TagContainer,{children:components2})}LineItemOption.propTypes=propTypes,LineItemOption.displayName=displayName;export default LineItemOption;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{useContext}from"react";import LineItemChildrenContext from"../../context/LineItemChildrenContext";import LineItemOptionChildrenContext from"../../context/LineItemOptionChildrenContext";import{isEmpty}from"lodash";import components from"../../config/components";const displayName=components.LineItemOptions.displayName;export function LineItemOptions(props){const{skuOptionId,title,children,showName=!0,showAll,className,titleTagElement="h6",titleClassName,...p}=props,{lineItem}=useContext(LineItemChildrenContext),lineItemOptions=isEmpty(lineItem)?[]:lineItem?.line_item_options||[],TitleTagElement=titleTagElement,options=lineItemOptions.filter(o=>showAll?!0:o.skuOption().id===skuOptionId).map((o,k)=>{const showTitle=showName?_jsx(TitleTagElement,{className:titleClassName,children:title||o.name}):null,valueProps={lineItemOption:o,showAll};return _jsxs("div",{className,...p,children:[showTitle,_jsx(LineItemOptionChildrenContext.Provider,{value:valueProps,children})]},k)});return _jsx(_Fragment,{children:options})}LineItemOptions.displayName=displayName;export default LineItemOptions;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { FunctionChildren } from '../typings/index';
2
+ import { FunctionChildren } from '../../typings/index';
3
3
  declare type LineItemQuantityChildrenProps = FunctionChildren<Omit<Props, 'children'> & {
4
4
  quantity: number;
5
5
  handleChange: (event: React.MouseEvent<HTMLSelectElement>) => void;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import LineItemChildrenContext from"../../context/LineItemChildrenContext";import LineItemContext from"../../context/LineItemContext";import Parent from"../utils/Parent";import components from"../../config/components";const propTypes=components.LineItemQuantity.propTypes,defaultProps=components.LineItemQuantity.defaultProps,displayName=components.LineItemQuantity.displayName;export function LineItemQuantity(props){const{max=50,readonly=!1,...p}=props,{lineItem}=useContext(LineItemChildrenContext),{updateLineItem}=useContext(LineItemContext),options=[];for(let i=1;i<=max;i++)options.push(_jsx("option",{value:`${i}`,children:i},i));const handleChange=e=>{const quantity2=Number(e.target.value);updateLineItem&&lineItem&&updateLineItem(lineItem.id,quantity2)},quantity=lineItem?.quantity,parentProps={handleChange,quantity,...props};return props.children?_jsx(Parent,{...parentProps,children:props.children}):readonly?_jsx("span",{...p,children:quantity}):_jsx("select",{title:lineItem?.name,value:quantity,onChange:handleChange,...p,children:options})}LineItemQuantity.propTypes=propTypes,LineItemQuantity.defaultProps=defaultProps,LineItemQuantity.displayName=displayName;export default LineItemQuantity;
@@ -1,5 +1,5 @@
1
1
  import { PropsWithoutRef } from 'react';
2
- import { FunctionChildren } from '../typings/index';
2
+ import { FunctionChildren } from '../../typings/index';
3
3
  declare type ChildrenProps = FunctionChildren<{
4
4
  handleRemove: (event: React.MouseEvent<HTMLAnchorElement>) => void;
5
5
  label?: string;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import LineItemChildrenContext from"../../context/LineItemChildrenContext";import LineItemContext from"../../context/LineItemContext";import Parent from"../utils/Parent";import components from"../../config/components";const propTypes=components.LineItemRemoveLink.propTypes,defaultProps=components.LineItemRemoveLink.defaultProps,displayName=components.LineItemRemoveLink.displayName;export function LineItemRemoveLink(props){const{label="Remove"}=props,{lineItem}=useContext(LineItemChildrenContext),{deleteLineItem}=useContext(LineItemContext),handleRemove=e=>{e.preventDefault(),deleteLineItem&&lineItem&&deleteLineItem(lineItem.id)},parentProps={handleRemove,...props};return props.children?_jsx(Parent,{...parentProps,children:props.children}):_jsx("a",{...props,href:"#",onClick:handleRemove,children:label})}LineItemRemoveLink.propTypes=propTypes,LineItemRemoveLink.defaultProps=defaultProps,LineItemRemoveLink.displayName=displayName;export default LineItemRemoveLink;
@@ -7,9 +7,9 @@ declare type Props = {
7
7
  export declare function LineItemsContainer(props: Props): JSX.Element;
8
8
  export declare namespace LineItemsContainer {
9
9
  var propTypes: {
10
- children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
10
+ children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
11
11
  filters: import("prop-types").Requireable<object>;
12
- loader: import("prop-types").Requireable<string | import("prop-types").ReactElementLike>;
12
+ loader: import("prop-types").Requireable<NonNullable<string | import("prop-types").ReactElementLike | null | undefined>>;
13
13
  };
14
14
  var defaultProps: {
15
15
  filters: {};
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useEffect,useReducer,useContext}from"react";import lineItemReducer,{lineItemInitialState,updateLineItem,deleteLineItem}from"../../reducers/LineItemReducer";import OrderContext from"../../context/OrderContext";import LineItemContext from"../../context/LineItemContext";import CommerceLayerContext from"../../context/CommerceLayerContext";import components from"../../config/components";const propTypes=components.LineItemsContainer.propTypes,defaultProps=components.LineItemsContainer.defaultProps,displayName=components.LineItemsContainer.displayName;export function LineItemsContainer(props){const{children,loader="Loading..."}=props,{order,addResourceToInclude,include,orderId,getOrder,includeLoaded}=useContext(OrderContext),config=useContext(CommerceLayerContext),[state,dispatch]=useReducer(lineItemReducer,lineItemInitialState);useEffect(()=>{include?.includes("line_items.line_item_options.sku_option")?includeLoaded?.["line_items.line_item_options.sku_option"]||addResourceToInclude({newResourceLoaded:{"line_items.line_item_options.sku_option":!0}}):addResourceToInclude({newResource:["line_items.line_item_options.sku_option"]}),include?.includes("line_items.item")?includeLoaded?.["line_items.item"]||addResourceToInclude({newResourceLoaded:{"line_items.item":!0}}):addResourceToInclude({newResource:["line_items.item"]})},[include,includeLoaded]),useEffect(()=>{order?.line_items&&dispatch({type:"setLineItems",payload:{lineItems:order.line_items}})},[order?.line_items]);const lineItemValue={...state,loader,updateLineItem:(lineItemId,quantity=1)=>updateLineItem({lineItemId,quantity,dispatch,config,getOrder,orderId,errors:state.errors}),deleteLineItem:lineItemId=>deleteLineItem({lineItemId,dispatch,config,getOrder,orderId,errors:state.errors})};return _jsx(LineItemContext.Provider,{value:lineItemValue,children:state.loading?loader:children})}LineItemsContainer.propTypes=propTypes,LineItemsContainer.defaultProps=defaultProps,LineItemsContainer.displayName=displayName;export default LineItemsContainer;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { TypeAccepted } from '../utils/getLineItemsCount';
3
- import { FunctionChildren } from '../typings/index';
2
+ import { TypeAccepted } from '../../utils/getLineItemsCount';
3
+ import { FunctionChildren } from '../../typings/index';
4
4
  declare type LineItemsCountChildrenProps = FunctionChildren<Omit<Props, 'children'> & {
5
5
  quantity: number;
6
6
  }>;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useState,useEffect}from"react";import Parent from"../utils/Parent";import getLineItemsCount from"../../utils/getLineItemsCount";import LineItemContext from"../../context/LineItemContext";import components from"../../config/components";const propTypes=components.LineItemsCount.propTypes,displayName=components.LineItemsCount.displayName;export function LineItemsCount(props){const{children,typeAccepted,...p}=props,{lineItems}=useContext(LineItemContext),[quantity,setQuantity]=useState(0);useEffect(()=>{if(lineItems&&lineItems.length>0){const qty=getLineItemsCount({lineItems:lineItems||[],typeAccepted});setQuantity(qty)}return()=>{setQuantity(0)}},[lineItems,typeAccepted]);const parentProps={quantity,typeAccepted,...p};return children?_jsx(Parent,{...parentProps,children}):_jsx("span",{...p,children:quantity})}LineItemsCount.propTypes=propTypes,LineItemsCount.displayName=displayName;export default LineItemsCount;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { FunctionChildren } from '../typings/index';
2
+ import { FunctionChildren } from '../../typings/index';
3
3
  export declare type LineItemsCountType = FunctionChildren<Omit<LineItemsCountProps, 'children'> & {
4
4
  quantity: number;
5
5
  text: string;
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useState,useEffect}from"react";import Parent from"../utils/Parent";import getLineItemsCount from"../../utils/getLineItemsCount";import LineItemContext from"../../context/LineItemContext";import components from"../../config/components";const propTypes=components.LineItemsEmpty.propTypes,displayName=components.LineItemsEmpty.displayName;export function LineItemsEmpty(props){const{children,text="Your shopping bag is empty",...p}=props,{lineItems}=useContext(LineItemContext),[quantity,setQuantity]=useState(),emptyText=quantity===0?_jsx("span",{...p,children:text}):null;useEffect(()=>{if(lineItems)if(lineItems.length>0){const qty=getLineItemsCount({lineItems:lineItems||[]});setQuantity(qty)}else setQuantity(0);return()=>{setQuantity(void 0)}},[lineItems]);const parentProps={quantity,text,...p};return children?_jsx(Parent,{...parentProps,children}):emptyText}LineItemsEmpty.propTypes=propTypes,LineItemsEmpty.displayName=displayName;export default LineItemsEmpty;
@@ -1,7 +1,7 @@
1
- import { PropsWithoutRef, ReactNode } from 'react';
1
+ import { PropsWithoutRef } from 'react';
2
2
  import { FunctionChildren } from '../../typings/index';
3
3
  import { AddToCartReturn } from '../../reducers/OrderReducer';
4
- import { VariantOption } from '../VariantSelector';
4
+ import { VariantOption } from '../skus/VariantSelector';
5
5
  declare type ChildrenProps = {
6
6
  handleClick: () => AddToCartReturn;
7
7
  } & Omit<Props, 'children'>;
@@ -23,7 +23,7 @@ declare type THostedCart = {
23
23
  };
24
24
  declare type Props = {
25
25
  children?: AddToCartButtonChildrenProps;
26
- label?: string | ReactNode;
26
+ label?: string | JSX.Element;
27
27
  skuCode?: string;
28
28
  bundleCode?: string;
29
29
  disabled?: boolean;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import Parent from"../utils/Parent";import OrderContext from"../../context/OrderContext";import isEmpty from"lodash/isEmpty";import has from"lodash/has";import ItemContext from"../../context/ItemContext";import getCurrentItemKey from"../../utils/getCurrentItemKey";import SkuListsContext from"../../context/SkuListsContext";import ExternalFunctionContext from"../../context/ExternalFunctionContext";import isFunction from"lodash/isFunction";import SkuChildrenContext from"../../context/SkuChildrenContext";import getCartLink from"../../utils/getCartLink";import CommerceLayerContext from"../../context/CommerceLayerContext";export function AddToCartButton(props){const{label="Add to cart",children,skuCode,bundleCode,disabled,skuListId,lineItem,buyNowMode=!1,checkoutUrl,redirectToHostedCart,hostedCartUrl,...p}=props,{accessToken,endpoint}=useContext(CommerceLayerContext),{addToCart,orderId,getOrder,setOrderErrors}=useContext(OrderContext),{url,callExternalFunction}=useContext(ExternalFunctionContext),{item,items,quantity,option,prices,lineItems,lineItem:lineItemContext,skuCode:itemSkuCode}=useContext(ItemContext),{skuLists}=useContext(SkuListsContext),{sku}=useContext(SkuChildrenContext),[slug]=endpoint?endpoint.split(".commercelayer"):[""],sCode=!isEmpty(items)&&skuCode?items[skuCode]?.code:sku?.code||skuCode||getCurrentItemKey(item)||itemSkuCode,availabilityQuantity=item[sCode]?.inventory?.quantity,handleClick=async()=>{const qty=quantity[sCode],opt=option[sCode],customLineItem=isEmpty(lineItem||lineItemContext)?lineItems[sCode]:lineItem||lineItemContext;if(!isEmpty(skuLists)&&skuListId&&url){const slQty=quantity[skuListId]||1;if(has(skuLists,skuListId)){const lineItems2=skuLists&&skuLists[skuListId].map(skuCode2=>({skuCode:skuCode2,quantity:slQty,_update_quantity:1}));return callExternalFunction({url,data:{resourceType:"orders",inputs:[{id:orderId,lineItems:lineItems2}]}}).then(async res=>(getOrder&&orderId&&await getOrder(orderId),res)).catch(({response})=>(setOrderErrors&&setOrderErrors(response.data),response))}}if(!url&&addToCart){const res=await addToCart({bundleCode,skuCode:sCode,skuId:item[sCode]?.id,quantity:qty,option:opt,lineItem:customLineItem,buyNowMode,checkoutUrl});if(redirectToHostedCart){const orderId2=res.orderId;hostedCartUrl?location.href=`https://${hostedCartUrl}/${orderId2}?accessToken=${accessToken}`:orderId2&&slug&&(location.href=getCartLink({orderId:orderId2,slug,accessToken}))}return res}else if(url)return callExternalFunction({url,data:{bundleCode,skuCode:sCode,skuId:item[sCode]?.id,quantity:qty,option:opt,lineItem:customLineItem,buyNowMode,checkoutUrl}}).then(async res=>(getOrder&&orderId&&await getOrder(orderId),res)).catch(({response})=>(setOrderErrors&&setOrderErrors(response.data),response))},autoDisabled=!isEmpty(skuLists)||skuListId?!1:disabled||!prices[sCode]||!sCode||availabilityQuantity===0,parentProps={handleClick,disabled:disabled||autoDisabled,label,...props};return children?_jsx(Parent,{...parentProps,children}):_jsx("button",{...p,disabled:autoDisabled,onClick:handleClick,children:isFunction(label)?label():label})}export default AddToCartButton;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import Parent from"../utils/Parent";import OrderContext from"../../context/OrderContext";import isEmpty from"lodash/isEmpty";import has from"lodash/has";import ItemContext from"../../context/ItemContext";import getCurrentItemKey from"../../utils/getCurrentItemKey";import SkuListsContext from"../../context/SkuListsContext";import ExternalFunctionContext from"../../context/ExternalFunctionContext";import SkuChildrenContext from"../../context/SkuChildrenContext";import getCartLink from"../../utils/getCartLink";import CommerceLayerContext from"../../context/CommerceLayerContext";export function AddToCartButton(props){const{label="Add to cart",children,skuCode,bundleCode,disabled,skuListId,lineItem,buyNowMode=!1,checkoutUrl,redirectToHostedCart,hostedCartUrl,...p}=props,{accessToken,endpoint}=useContext(CommerceLayerContext),{addToCart,orderId,getOrder,setOrderErrors}=useContext(OrderContext),{url,callExternalFunction}=useContext(ExternalFunctionContext),{item,items,quantity,option,prices,lineItems,lineItem:lineItemContext,skuCode:itemSkuCode}=useContext(ItemContext),{skuLists}=useContext(SkuListsContext),{sku}=useContext(SkuChildrenContext),[slug]=endpoint?endpoint.split(".commercelayer"):[""],sCode=!isEmpty(items)&&skuCode?items[skuCode]?.code:sku?.code||skuCode||getCurrentItemKey(item)||itemSkuCode,availabilityQuantity=item[sCode]?.inventory?.quantity,handleClick=async()=>{const qty=quantity[sCode],opt=option[sCode],customLineItem=isEmpty(lineItem||lineItemContext)?lineItems[sCode]:lineItem||lineItemContext;if(!isEmpty(skuLists)&&skuListId&&url){const slQty=quantity[skuListId]||1;if(has(skuLists,skuListId)){const lineItems2=skuLists&&skuLists[skuListId].map(skuCode2=>({skuCode:skuCode2,quantity:slQty,_update_quantity:1}));return callExternalFunction({url,data:{resourceType:"orders",inputs:[{id:orderId,lineItems:lineItems2}]}}).then(async res=>(getOrder&&orderId&&await getOrder(orderId),res)).catch(({response})=>(setOrderErrors&&setOrderErrors(response.data),response))}}if(!url&&addToCart){const res=await addToCart({bundleCode,skuCode:sCode,skuId:item[sCode]?.id,quantity:qty,option:opt,lineItem:customLineItem,buyNowMode,checkoutUrl});if(redirectToHostedCart){const orderId2=res.orderId;hostedCartUrl?location.href=`https://${hostedCartUrl}/${orderId2}?accessToken=${accessToken}`:orderId2&&slug&&(location.href=getCartLink({orderId:orderId2,slug,accessToken}))}return res}else if(url)return callExternalFunction({url,data:{bundleCode,skuCode:sCode,skuId:item[sCode]?.id,quantity:qty,option:opt,lineItem:customLineItem,buyNowMode,checkoutUrl}}).then(async res=>(getOrder&&orderId&&await getOrder(orderId),res)).catch(({response})=>(setOrderErrors&&setOrderErrors(response.data),response))},autoDisabled=!isEmpty(skuLists)||skuListId?!1:disabled||!prices[sCode]||!sCode||availabilityQuantity===0,parentProps={handleClick,disabled:disabled||autoDisabled,label,...props};return children?_jsx(Parent,{...parentProps,children}):_jsx("button",{...p,disabled:autoDisabled,onClick:handleClick,children:label})}export default AddToCartButton;
@@ -1,18 +1,4 @@
1
- /// <reference types="react" />
1
+ import { FunctionComponent } from 'react';
2
2
  import { BaseAmountComponent } from '../../typings/index';
3
- export declare function AdjustmentAmount(props: BaseAmountComponent): JSX.Element;
4
- export declare namespace AdjustmentAmount {
5
- var propTypes: {
6
- id: import("prop-types").Requireable<string>;
7
- className: import("prop-types").Requireable<string>;
8
- style: import("prop-types").Requireable<object>;
9
- name: import("prop-types").Requireable<string>;
10
- children: import("prop-types").Requireable<(...args: any[]) => any>;
11
- format: import("prop-types").Requireable<import("../../typings/index").BaseFormatPrice>;
12
- };
13
- var defaultProps: {
14
- format: import("../../typings/index").BaseFormatPrice;
15
- };
16
- var displayName: string;
17
- }
3
+ declare const AdjustmentAmount: FunctionComponent<BaseAmountComponent>;
18
4
  export default AdjustmentAmount;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"../utils/BaseOrderPrice";import components from"../../config/components";const propTypes=components.AdjustmentAmount.propTypes,defaultProps=components.AdjustmentAmount.defaultProps,displayName=components.AdjustmentAmount.displayName;export function AdjustmentAmount(props){return _jsx(BaseOrderPrice,{base:"amount",type:"adjustment",...props})}AdjustmentAmount.propTypes=propTypes,AdjustmentAmount.defaultProps=defaultProps,AdjustmentAmount.displayName=displayName;export default AdjustmentAmount;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"../utils/BaseOrderPrice";const AdjustmentAmount=props=>_jsx(BaseOrderPrice,{base:"amount",type:"adjustment",...props});export default AdjustmentAmount;