@commercelayer/react-components 2.53.2 → 3.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (807) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +3 -3
  3. package/lib/cjs/components/AdjustmentAmount.js +1 -1
  4. package/lib/cjs/components/AdyenPayment.d.ts +3 -3
  5. package/lib/cjs/components/AdyenPayment.js +1 -1
  6. package/lib/cjs/components/AvailabilityContainer.d.ts +10 -3
  7. package/lib/cjs/components/AvailabilityContainer.js +1 -1
  8. package/lib/cjs/components/AvailabilityTemplate.d.ts +13 -4
  9. package/lib/cjs/components/AvailabilityTemplate.js +1 -1
  10. package/lib/cjs/components/BillingAddressContainer.d.ts +7 -2
  11. package/lib/cjs/components/BillingAddressContainer.js +1 -1
  12. package/lib/cjs/components/BillingAddressForm.d.ts +8 -3
  13. package/lib/cjs/components/BillingAddressForm.js +1 -1
  14. package/lib/cjs/components/BraintreePayment.d.ts +3 -3
  15. package/lib/cjs/components/BraintreePayment.js +1 -1
  16. package/lib/cjs/components/CartLink.d.ts +12 -0
  17. package/lib/cjs/components/CartLink.js +1 -0
  18. package/lib/cjs/components/CheckoutComPayment.d.ts +23 -0
  19. package/lib/cjs/components/CheckoutComPayment.js +1 -0
  20. package/lib/cjs/components/CheckoutLink.d.ts +16 -4
  21. package/lib/cjs/components/CheckoutLink.js +1 -1
  22. package/lib/cjs/components/DeliveryLeadTime.d.ts +11 -4
  23. package/lib/cjs/components/DeliveryLeadTime.js +1 -1
  24. package/lib/cjs/components/DiscountAmount.d.ts +16 -2
  25. package/lib/cjs/components/DiscountAmount.js +1 -1
  26. package/lib/cjs/components/Errors.d.ts +4 -4
  27. package/lib/cjs/components/Errors.js +1 -1
  28. package/lib/cjs/components/ExternalFunction.d.ts +9 -2
  29. package/lib/cjs/components/ExternalFunction.js +1 -1
  30. package/lib/cjs/components/GiftCard.d.ts +13 -3
  31. package/lib/cjs/components/GiftCard.js +1 -1
  32. package/lib/cjs/components/GiftCardContainer.d.ts +9 -3
  33. package/lib/cjs/components/GiftCardContainer.js +1 -1
  34. package/lib/cjs/components/GiftCardCurrencySelector.d.ts +18 -3
  35. package/lib/cjs/components/GiftCardCurrencySelector.js +1 -1
  36. package/lib/cjs/components/GiftCardInput.d.ts +12 -3
  37. package/lib/cjs/components/GiftCardInput.js +1 -1
  38. package/lib/cjs/components/GiftCardOrCouponCode.d.ts +17 -6
  39. package/lib/cjs/components/GiftCardOrCouponCode.js +1 -1
  40. package/lib/cjs/components/GiftCardOrCouponForm.d.ts +9 -4
  41. package/lib/cjs/components/GiftCardOrCouponForm.js +1 -1
  42. package/lib/cjs/components/GiftCardOrCouponInput.d.ts +14 -3
  43. package/lib/cjs/components/GiftCardOrCouponInput.js +1 -1
  44. package/lib/cjs/components/GiftCardOrCouponRemoveButton.d.ts +15 -5
  45. package/lib/cjs/components/GiftCardOrCouponRemoveButton.js +1 -1
  46. package/lib/cjs/components/GiftCardOrCouponSubmit.d.ts +11 -4
  47. package/lib/cjs/components/GiftCardOrCouponSubmit.js +1 -1
  48. package/lib/cjs/components/ItemContainer.d.ts +14 -3
  49. package/lib/cjs/components/ItemContainer.js +1 -1
  50. package/lib/cjs/components/KlarnaPayment.d.ts +10 -0
  51. package/lib/cjs/components/KlarnaPayment.js +1 -0
  52. package/lib/cjs/components/LineItem.d.ts +10 -3
  53. package/lib/cjs/components/LineItem.js +1 -1
  54. package/lib/cjs/components/LineItemAmount.d.ts +16 -3
  55. package/lib/cjs/components/LineItemAmount.js +1 -1
  56. package/lib/cjs/components/LineItemCode.d.ts +10 -4
  57. package/lib/cjs/components/LineItemCode.js +1 -1
  58. package/lib/cjs/components/LineItemImage.d.ts +11 -4
  59. package/lib/cjs/components/LineItemImage.js +1 -1
  60. package/lib/cjs/components/LineItemName.d.ts +11 -5
  61. package/lib/cjs/components/LineItemName.js +1 -1
  62. package/lib/cjs/components/LineItemOption.d.ts +15 -4
  63. package/lib/cjs/components/LineItemOption.js +1 -1
  64. package/lib/cjs/components/LineItemOptions.d.ts +8 -3
  65. package/lib/cjs/components/LineItemOptions.js +1 -1
  66. package/lib/cjs/components/LineItemQuantity.d.ts +16 -4
  67. package/lib/cjs/components/LineItemQuantity.js +1 -1
  68. package/lib/cjs/components/LineItemRemoveLink.d.ts +15 -5
  69. package/lib/cjs/components/LineItemRemoveLink.js +1 -1
  70. package/lib/cjs/components/LineItemsContainer.d.ts +15 -3
  71. package/lib/cjs/components/LineItemsContainer.js +1 -1
  72. package/lib/cjs/components/LineItemsCount.d.ts +14 -4
  73. package/lib/cjs/components/LineItemsCount.js +1 -1
  74. package/lib/cjs/components/LineItemsEmpty.d.ts +13 -2
  75. package/lib/cjs/components/LineItemsEmpty.js +1 -1
  76. package/lib/cjs/components/MetadataInput.d.ts +13 -3
  77. package/lib/cjs/components/MetadataInput.js +1 -1
  78. package/lib/cjs/components/PaymentGateway.d.ts +4 -4
  79. package/lib/cjs/components/PaymentGateway.js +1 -1
  80. package/lib/cjs/components/PaymentMethod.d.ts +9 -3
  81. package/lib/cjs/components/PaymentMethod.js +1 -1
  82. package/lib/cjs/components/PaymentMethodAmount.d.ts +16 -2
  83. package/lib/cjs/components/PaymentMethodAmount.js +1 -1
  84. package/lib/cjs/components/PaymentMethodName.d.ts +10 -4
  85. package/lib/cjs/components/PaymentMethodName.js +1 -1
  86. package/lib/cjs/components/PaymentMethodPrice.d.ts +15 -4
  87. package/lib/cjs/components/PaymentMethodPrice.js +1 -1
  88. package/lib/cjs/components/PaymentMethodRadioButton.d.ts +11 -4
  89. package/lib/cjs/components/PaymentMethodRadioButton.js +1 -1
  90. package/lib/cjs/components/PaymentMethodsContainer.d.ts +9 -3
  91. package/lib/cjs/components/PaymentMethodsContainer.js +1 -1
  92. package/lib/cjs/components/PaymentSource.d.ts +9 -2
  93. package/lib/cjs/components/PaymentSource.js +1 -1
  94. package/lib/cjs/components/PaymentSourceBrandIcon.d.ts +14 -4
  95. package/lib/cjs/components/PaymentSourceBrandIcon.js +1 -1
  96. package/lib/cjs/components/PaymentSourceBrandName.d.ts +11 -4
  97. package/lib/cjs/components/PaymentSourceBrandName.js +1 -1
  98. package/lib/cjs/components/PaymentSourceDetail.d.ts +8 -2
  99. package/lib/cjs/components/PaymentSourceDetail.js +1 -1
  100. package/lib/cjs/components/PaymentSourceEditButton.d.ts +9 -2
  101. package/lib/cjs/components/PaymentSourceEditButton.js +1 -1
  102. package/lib/cjs/components/PaypalPayment.d.ts +2 -2
  103. package/lib/cjs/components/PaypalPayment.js +1 -1
  104. package/lib/cjs/components/Price.d.ts +15 -3
  105. package/lib/cjs/components/Price.js +1 -1
  106. package/lib/cjs/components/PricesContainer.d.ts +19 -3
  107. package/lib/cjs/components/PricesContainer.js +1 -1
  108. package/lib/cjs/components/QuantitySelector.d.ts +19 -5
  109. package/lib/cjs/components/QuantitySelector.js +1 -1
  110. package/lib/cjs/components/SaveAddressesButton.d.ts +18 -5
  111. package/lib/cjs/components/SaveAddressesButton.js +1 -1
  112. package/lib/cjs/components/SaveCustomerButton.d.ts +16 -5
  113. package/lib/cjs/components/SaveCustomerButton.js +1 -1
  114. package/lib/cjs/components/ShippingAddressContainer.d.ts +7 -2
  115. package/lib/cjs/components/ShippingAddressContainer.js +1 -1
  116. package/lib/cjs/components/ShippingAddressForm.d.ts +8 -3
  117. package/lib/cjs/components/ShippingAddressForm.js +1 -1
  118. package/lib/cjs/components/ShippingAmount.d.ts +13 -2
  119. package/lib/cjs/components/ShippingAmount.js +1 -1
  120. package/lib/cjs/components/ShippingMethod.d.ts +10 -3
  121. package/lib/cjs/components/ShippingMethod.js +1 -1
  122. package/lib/cjs/components/ShippingMethodName.d.ts +11 -5
  123. package/lib/cjs/components/ShippingMethodName.js +1 -1
  124. package/lib/cjs/components/ShippingMethodPrice.d.ts +15 -3
  125. package/lib/cjs/components/ShippingMethodPrice.js +1 -1
  126. package/lib/cjs/components/ShippingMethodRadioButton.d.ts +11 -5
  127. package/lib/cjs/components/ShippingMethodRadioButton.js +1 -1
  128. package/lib/cjs/components/SkuField.d.ts +10 -0
  129. package/lib/cjs/components/SkuField.js +1 -0
  130. package/lib/cjs/components/Skus.d.ts +11 -0
  131. package/lib/cjs/components/Skus.js +1 -0
  132. package/lib/cjs/components/SkusContainer.d.ts +14 -0
  133. package/lib/cjs/components/SkusContainer.js +1 -0
  134. package/lib/cjs/components/StockTransfer.d.ts +9 -3
  135. package/lib/cjs/components/StockTransfer.js +1 -1
  136. package/lib/cjs/components/StockTransferField.d.ts +9 -8
  137. package/lib/cjs/components/StockTransferField.js +1 -1
  138. package/lib/cjs/components/StripePayment.d.ts +3 -3
  139. package/lib/cjs/components/StripePayment.js +1 -1
  140. package/lib/cjs/components/SubmitButton.d.ts +15 -5
  141. package/lib/cjs/components/SubmitButton.js +1 -1
  142. package/lib/cjs/components/VariantSelector.d.ts +28 -5
  143. package/lib/cjs/components/VariantSelector.js +1 -1
  144. package/lib/cjs/components/VariantsContainer.d.ts +15 -3
  145. package/lib/cjs/components/VariantsContainer.js +1 -1
  146. package/lib/cjs/components/WireTransferPayment.d.ts +2 -2
  147. package/lib/cjs/components/WireTransferPayment.js +1 -1
  148. package/lib/cjs/components/addresses/Address.d.ts +18 -0
  149. package/lib/cjs/components/addresses/Address.js +1 -0
  150. package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +26 -0
  151. package/lib/cjs/components/addresses/AddressCountrySelector.js +1 -0
  152. package/lib/cjs/components/addresses/AddressField.d.ts +43 -0
  153. package/lib/cjs/components/addresses/AddressField.js +1 -0
  154. package/lib/cjs/components/addresses/AddressInput.d.ts +19 -0
  155. package/lib/cjs/components/addresses/AddressInput.js +1 -0
  156. package/lib/cjs/components/addresses/AddressStateSelector.d.ts +27 -0
  157. package/lib/cjs/components/addresses/AddressStateSelector.js +1 -0
  158. package/lib/cjs/components/addresses/AddressesContainer.d.ts +15 -0
  159. package/lib/cjs/components/addresses/AddressesContainer.js +1 -0
  160. package/lib/cjs/components/auth/CommerceLayer.d.ts +15 -0
  161. package/lib/cjs/components/auth/CommerceLayer.js +1 -0
  162. package/lib/cjs/components/customers/CustomerAddressForm.d.ts +13 -0
  163. package/lib/cjs/components/customers/CustomerAddressForm.js +1 -0
  164. package/lib/cjs/components/customers/CustomerContainer.d.ts +17 -0
  165. package/lib/cjs/components/customers/CustomerContainer.js +1 -0
  166. package/lib/cjs/components/customers/CustomerField.d.ts +10 -0
  167. package/lib/cjs/components/customers/CustomerField.js +1 -0
  168. package/lib/cjs/components/customers/CustomerInput.d.ts +23 -0
  169. package/lib/cjs/components/customers/CustomerInput.js +1 -0
  170. package/lib/cjs/components/gateways/AdyenGateway.d.ts +2 -2
  171. package/lib/cjs/components/gateways/AdyenGateway.js +1 -1
  172. package/lib/cjs/components/gateways/BraintreeGateway.d.ts +2 -2
  173. package/lib/cjs/components/gateways/BraintreeGateway.js +1 -1
  174. package/lib/cjs/components/gateways/CheckoutComGateway.d.ts +5 -0
  175. package/lib/cjs/components/gateways/CheckoutComGateway.js +1 -0
  176. package/lib/cjs/components/gateways/KlarnaGateway.d.ts +5 -0
  177. package/lib/cjs/components/gateways/KlarnaGateway.js +1 -0
  178. package/lib/cjs/components/gateways/PaypalGateway.d.ts +3 -3
  179. package/lib/cjs/components/gateways/PaypalGateway.js +1 -1
  180. package/lib/cjs/components/gateways/StripeGateway.d.ts +2 -2
  181. package/lib/cjs/components/gateways/StripeGateway.js +1 -1
  182. package/lib/cjs/components/gateways/WireTransferGateway.d.ts +2 -2
  183. package/lib/cjs/components/gateways/WireTransferGateway.js +1 -1
  184. package/lib/cjs/components/orders/AddToCartButton.d.ts +34 -0
  185. package/lib/cjs/components/orders/AddToCartButton.js +1 -0
  186. package/lib/cjs/components/orders/AdjustmentAmount.d.ts +18 -0
  187. package/lib/cjs/components/orders/AdjustmentAmount.js +1 -0
  188. package/lib/cjs/components/orders/CartLink.d.ts +12 -0
  189. package/lib/cjs/components/orders/CartLink.js +1 -0
  190. package/lib/cjs/components/orders/GiftCardAmount.d.ts +15 -0
  191. package/lib/cjs/components/orders/GiftCardAmount.js +1 -0
  192. package/lib/cjs/components/orders/OrderContainer.d.ts +26 -0
  193. package/lib/cjs/components/orders/OrderContainer.js +1 -0
  194. package/lib/cjs/components/orders/OrderList.d.ts +61 -0
  195. package/lib/cjs/components/orders/OrderList.js +1 -0
  196. package/lib/cjs/components/orders/OrderListRow.d.ts +30 -0
  197. package/lib/cjs/components/orders/OrderListRow.js +1 -0
  198. package/lib/cjs/components/orders/OrderNumber.d.ts +11 -0
  199. package/lib/cjs/components/orders/OrderNumber.js +1 -0
  200. package/lib/cjs/components/orders/OrderStorage.d.ts +16 -0
  201. package/lib/cjs/components/orders/OrderStorage.js +1 -0
  202. package/lib/cjs/components/orders/PlaceOrderButton.d.ts +24 -0
  203. package/lib/cjs/components/orders/PlaceOrderButton.js +1 -0
  204. package/lib/cjs/components/orders/PlaceOrderContainer.d.ts +14 -0
  205. package/lib/cjs/components/orders/PlaceOrderContainer.js +1 -0
  206. package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.d.ts +10 -0
  207. package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.js +1 -0
  208. package/lib/cjs/components/orders/SubTotalAmount.d.ts +18 -0
  209. package/lib/cjs/components/orders/SubTotalAmount.js +1 -0
  210. package/lib/cjs/components/orders/TaxesAmount.d.ts +18 -0
  211. package/lib/cjs/components/orders/TaxesAmount.js +1 -0
  212. package/lib/cjs/components/orders/TotalAmount.d.ts +18 -0
  213. package/lib/cjs/components/orders/TotalAmount.js +1 -0
  214. package/lib/cjs/components/shipments/Shipment.d.ts +15 -0
  215. package/lib/cjs/components/shipments/Shipment.js +1 -0
  216. package/lib/cjs/components/shipments/ShipmentField.d.ts +19 -0
  217. package/lib/cjs/components/shipments/ShipmentField.js +1 -0
  218. package/lib/cjs/components/shipments/ShipmentsContainer.d.ts +12 -0
  219. package/lib/cjs/components/shipments/ShipmentsContainer.js +1 -0
  220. package/lib/cjs/components/skus/SkuField.d.ts +14 -0
  221. package/lib/cjs/components/skus/SkuField.js +1 -0
  222. package/lib/cjs/components/skus/SkuList.d.ts +14 -0
  223. package/lib/cjs/components/skus/SkuList.js +1 -0
  224. package/lib/cjs/components/skus/SkuListsContainer.d.ts +12 -0
  225. package/lib/cjs/components/skus/SkuListsContainer.js +1 -0
  226. package/lib/cjs/components/skus/SkuOption.d.ts +14 -0
  227. package/lib/cjs/components/skus/SkuOption.js +1 -0
  228. package/lib/cjs/components/skus/SkuOptionInput.d.ts +15 -0
  229. package/lib/cjs/components/skus/SkuOptionInput.js +1 -0
  230. package/lib/cjs/components/skus/SkuOptionsContainer.d.ts +14 -0
  231. package/lib/cjs/components/skus/SkuOptionsContainer.js +1 -0
  232. package/lib/cjs/components/skus/Skus.d.ts +11 -0
  233. package/lib/cjs/components/skus/Skus.js +1 -0
  234. package/lib/cjs/components/skus/SkusContainer.d.ts +23 -0
  235. package/lib/cjs/components/skus/SkusContainer.js +1 -0
  236. package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +1 -1
  237. package/lib/cjs/components/utils/AddressCardsTemplate.js +1 -1
  238. package/lib/cjs/components/utils/BaseField.js +1 -1
  239. package/lib/cjs/components/utils/BaseInput.d.ts +1 -1
  240. package/lib/cjs/components/utils/BaseInput.js +1 -1
  241. package/lib/cjs/components/utils/BaseOrderPrice.js +1 -1
  242. package/lib/cjs/components/utils/BaseSelect.js +1 -1
  243. package/lib/cjs/components/utils/GenericFieldComponent.d.ts +42 -0
  244. package/lib/cjs/components/utils/GenericFieldComponent.js +1 -0
  245. package/lib/cjs/components/utils/Parent.d.ts +3 -5
  246. package/lib/cjs/components/utils/Parent.js +1 -1
  247. package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +2 -2
  248. package/lib/cjs/components/utils/PaymentCardsTemplate.js +1 -1
  249. package/lib/cjs/components/utils/PriceTemplate.d.ts +2 -2
  250. package/lib/cjs/components/utils/PriceTemplate.js +1 -1
  251. package/lib/cjs/components/utils/VariantTemplate.js +1 -1
  252. package/lib/cjs/components/utils/getAllErrors.js +1 -1
  253. package/lib/cjs/config/components.d.ts +78 -36
  254. package/lib/cjs/config/components.js +1 -1
  255. package/lib/cjs/context/AddressChildrenContext.d.ts +1 -1
  256. package/lib/cjs/context/AddressChildrenContext.js +1 -1
  257. package/lib/cjs/context/AddressContext.d.ts +1 -1
  258. package/lib/cjs/context/BillingAddressContext.d.ts +2 -4
  259. package/lib/cjs/context/BillingAddressContext.js +1 -1
  260. package/lib/cjs/context/BillingAddressFormContext.d.ts +18 -11
  261. package/lib/cjs/context/CouponAndGiftCardFormContext.d.ts +4 -2
  262. package/lib/cjs/context/CustomerAddressFormContext.d.ts +20 -0
  263. package/lib/cjs/context/CustomerAddressFormContext.js +1 -0
  264. package/lib/cjs/context/CustomerContext.d.ts +17 -11
  265. package/lib/cjs/context/CustomerContext.js +1 -1
  266. package/lib/cjs/context/ExternalFunctionContext.js +1 -1
  267. package/lib/cjs/context/OrderContext.d.ts +8 -4
  268. package/lib/cjs/context/OrderContext.js +1 -1
  269. package/lib/cjs/context/OrderListChildrenContext.d.ts +60 -0
  270. package/lib/cjs/context/OrderListChildrenContext.js +1 -0
  271. package/lib/cjs/context/PaymentSourceContext.d.ts +4 -4
  272. package/lib/cjs/context/PlaceOrderContext.d.ts +4 -2
  273. package/lib/cjs/context/ShippingAddressContext.d.ts +1 -1
  274. package/lib/cjs/context/SkuChildrenContext.d.ts +9 -0
  275. package/lib/cjs/context/SkuChildrenContext.js +1 -0
  276. package/lib/cjs/context/SkuContext.d.ts +9 -0
  277. package/lib/cjs/context/SkuContext.js +1 -0
  278. package/lib/cjs/index.d.ts +101 -90
  279. package/lib/cjs/index.js +1 -1
  280. package/lib/cjs/reducers/AddressReducer.d.ts +4 -2
  281. package/lib/cjs/reducers/AddressReducer.js +1 -1
  282. package/lib/cjs/reducers/AvailabilityReducer.d.ts +8 -0
  283. package/lib/cjs/reducers/AvailabilityReducer.js +1 -1
  284. package/lib/cjs/reducers/BillingAddressReducer.js +1 -1
  285. package/lib/cjs/reducers/CustomerReducer.d.ts +98 -17
  286. package/lib/cjs/reducers/CustomerReducer.js +1 -1
  287. package/lib/cjs/reducers/GiftCardReducer.js +1 -1
  288. package/lib/cjs/reducers/ItemReducer.js +1 -1
  289. package/lib/cjs/reducers/LineItemReducer.js +1 -1
  290. package/lib/cjs/reducers/OrderReducer.d.ts +24 -8
  291. package/lib/cjs/reducers/OrderReducer.js +1 -1
  292. package/lib/cjs/reducers/PaymentMethodReducer.d.ts +51 -5
  293. package/lib/cjs/reducers/PaymentMethodReducer.js +1 -1
  294. package/lib/cjs/reducers/PlaceOrderReducer.d.ts +9 -2
  295. package/lib/cjs/reducers/PlaceOrderReducer.js +1 -1
  296. package/lib/cjs/reducers/PriceReducer.js +1 -1
  297. package/lib/cjs/reducers/ShipmentReducer.js +1 -1
  298. package/lib/cjs/reducers/ShippingAddressReducer.js +1 -1
  299. package/lib/cjs/reducers/SkuListsReducer.js +1 -1
  300. package/lib/cjs/reducers/SkuOptionsReducer.js +1 -1
  301. package/lib/cjs/reducers/SkuReducer.d.ts +21 -0
  302. package/lib/cjs/reducers/SkuReducer.js +1 -0
  303. package/lib/cjs/reducers/VariantReducer.d.ts +1 -0
  304. package/lib/cjs/reducers/VariantReducer.js +1 -1
  305. package/lib/cjs/typings/errors.d.ts +13 -4
  306. package/lib/cjs/typings/errors.js +1 -1
  307. package/lib/cjs/typings/index.d.ts +18 -7
  308. package/lib/cjs/typings/index.js +1 -1
  309. package/lib/cjs/utils/addressesManager.d.ts +1 -1
  310. package/lib/cjs/utils/addressesManager.js +1 -1
  311. package/lib/cjs/utils/baseReducer.js +1 -1
  312. package/lib/cjs/utils/checkIncludeResource.d.ts +8 -0
  313. package/lib/cjs/utils/checkIncludeResource.js +1 -0
  314. package/lib/cjs/utils/childrenTypes.d.ts +1 -1
  315. package/lib/cjs/utils/childrenTypes.js +1 -1
  316. package/lib/cjs/utils/compareObjAttribute.d.ts +7 -0
  317. package/lib/cjs/utils/compareObjAttribute.js +1 -0
  318. package/lib/cjs/utils/customMessages.d.ts +1 -7
  319. package/lib/cjs/utils/customMessages.js +1 -1
  320. package/lib/cjs/utils/getCardDetails.d.ts +15 -0
  321. package/lib/cjs/utils/getCardDetails.js +1 -0
  322. package/lib/cjs/utils/getCartLink.d.ts +7 -0
  323. package/lib/cjs/utils/getCartLink.js +1 -0
  324. package/lib/cjs/utils/getCurrentItemKey.js +1 -1
  325. package/lib/cjs/utils/getErrors.d.ts +1 -1
  326. package/lib/cjs/utils/getErrors.js +1 -1
  327. package/lib/cjs/utils/getLineItemsCount.d.ts +8 -10
  328. package/lib/cjs/utils/getLineItemsCount.js +1 -1
  329. package/lib/cjs/utils/getLoaderComponent.js +1 -1
  330. package/lib/cjs/utils/getPrices.js +1 -1
  331. package/lib/cjs/utils/getSdk.js +1 -1
  332. package/lib/cjs/utils/getSkus.js +1 -1
  333. package/lib/cjs/utils/hooks/useExternalScript.d.ts +1 -0
  334. package/lib/cjs/utils/hooks/useExternalScript.js +1 -0
  335. package/lib/cjs/utils/icons.d.ts +3 -0
  336. package/lib/cjs/utils/icons.js +1 -0
  337. package/lib/cjs/utils/isDate.d.ts +1 -0
  338. package/lib/cjs/utils/isDate.js +1 -0
  339. package/lib/cjs/utils/jwt.d.ts +1 -1
  340. package/lib/cjs/utils/jwt.js +1 -1
  341. package/lib/cjs/utils/paypalPayment.js +1 -1
  342. package/lib/cjs/utils/placeholderImages.d.ts +2 -0
  343. package/lib/cjs/utils/placeholderImages.js +1 -0
  344. package/lib/cjs/utils/promisify.js +1 -1
  345. package/lib/cjs/utils/scrollbarWidth.d.ts +1 -0
  346. package/lib/cjs/utils/scrollbarWidth.js +1 -0
  347. package/lib/cjs/utils/shipments.d.ts +2 -1
  348. package/lib/cjs/utils/shipments.js +1 -1
  349. package/lib/cjs/utils/validateFormFields.d.ts +2 -0
  350. package/lib/cjs/utils/validateFormFields.js +1 -1
  351. package/lib/esm/components/AdjustmentAmount.js +1 -1
  352. package/lib/esm/components/AdyenPayment.d.ts +3 -3
  353. package/lib/esm/components/AdyenPayment.js +1 -1
  354. package/lib/esm/components/AvailabilityContainer.d.ts +10 -3
  355. package/lib/esm/components/AvailabilityContainer.js +1 -1
  356. package/lib/esm/components/AvailabilityTemplate.d.ts +13 -4
  357. package/lib/esm/components/AvailabilityTemplate.js +1 -1
  358. package/lib/esm/components/BillingAddressContainer.d.ts +7 -2
  359. package/lib/esm/components/BillingAddressContainer.js +1 -1
  360. package/lib/esm/components/BillingAddressForm.d.ts +8 -3
  361. package/lib/esm/components/BillingAddressForm.js +1 -1
  362. package/lib/esm/components/BraintreePayment.d.ts +3 -3
  363. package/lib/esm/components/BraintreePayment.js +1 -1
  364. package/lib/esm/components/CartLink.d.ts +12 -0
  365. package/lib/esm/components/CartLink.js +1 -0
  366. package/lib/esm/components/CheckoutComPayment.d.ts +23 -0
  367. package/lib/esm/components/CheckoutComPayment.js +1 -0
  368. package/lib/esm/components/CheckoutLink.d.ts +16 -4
  369. package/lib/esm/components/CheckoutLink.js +1 -1
  370. package/lib/esm/components/DeliveryLeadTime.d.ts +11 -4
  371. package/lib/esm/components/DeliveryLeadTime.js +1 -1
  372. package/lib/esm/components/DiscountAmount.d.ts +16 -2
  373. package/lib/esm/components/DiscountAmount.js +1 -1
  374. package/lib/esm/components/Errors.d.ts +4 -4
  375. package/lib/esm/components/Errors.js +1 -1
  376. package/lib/esm/components/ExternalFunction.d.ts +9 -2
  377. package/lib/esm/components/ExternalFunction.js +1 -1
  378. package/lib/esm/components/GiftCard.d.ts +13 -3
  379. package/lib/esm/components/GiftCard.js +1 -1
  380. package/lib/esm/components/GiftCardContainer.d.ts +9 -3
  381. package/lib/esm/components/GiftCardContainer.js +1 -1
  382. package/lib/esm/components/GiftCardCurrencySelector.d.ts +18 -3
  383. package/lib/esm/components/GiftCardCurrencySelector.js +1 -1
  384. package/lib/esm/components/GiftCardInput.d.ts +12 -3
  385. package/lib/esm/components/GiftCardInput.js +1 -1
  386. package/lib/esm/components/GiftCardOrCouponCode.d.ts +17 -6
  387. package/lib/esm/components/GiftCardOrCouponCode.js +1 -1
  388. package/lib/esm/components/GiftCardOrCouponForm.d.ts +9 -4
  389. package/lib/esm/components/GiftCardOrCouponForm.js +1 -1
  390. package/lib/esm/components/GiftCardOrCouponInput.d.ts +14 -3
  391. package/lib/esm/components/GiftCardOrCouponInput.js +1 -1
  392. package/lib/esm/components/GiftCardOrCouponRemoveButton.d.ts +15 -5
  393. package/lib/esm/components/GiftCardOrCouponRemoveButton.js +1 -1
  394. package/lib/esm/components/GiftCardOrCouponSubmit.d.ts +11 -4
  395. package/lib/esm/components/GiftCardOrCouponSubmit.js +1 -1
  396. package/lib/esm/components/ItemContainer.d.ts +14 -3
  397. package/lib/esm/components/ItemContainer.js +1 -1
  398. package/lib/esm/components/KlarnaPayment.d.ts +10 -0
  399. package/lib/esm/components/KlarnaPayment.js +1 -0
  400. package/lib/esm/components/LineItem.d.ts +10 -3
  401. package/lib/esm/components/LineItem.js +1 -1
  402. package/lib/esm/components/LineItemAmount.d.ts +16 -3
  403. package/lib/esm/components/LineItemAmount.js +1 -1
  404. package/lib/esm/components/LineItemCode.d.ts +10 -4
  405. package/lib/esm/components/LineItemCode.js +1 -1
  406. package/lib/esm/components/LineItemImage.d.ts +11 -4
  407. package/lib/esm/components/LineItemImage.js +1 -1
  408. package/lib/esm/components/LineItemName.d.ts +11 -5
  409. package/lib/esm/components/LineItemName.js +1 -1
  410. package/lib/esm/components/LineItemOption.d.ts +15 -4
  411. package/lib/esm/components/LineItemOption.js +1 -1
  412. package/lib/esm/components/LineItemOptions.d.ts +8 -3
  413. package/lib/esm/components/LineItemOptions.js +1 -1
  414. package/lib/esm/components/LineItemQuantity.d.ts +16 -4
  415. package/lib/esm/components/LineItemQuantity.js +1 -1
  416. package/lib/esm/components/LineItemRemoveLink.d.ts +15 -5
  417. package/lib/esm/components/LineItemRemoveLink.js +1 -1
  418. package/lib/esm/components/LineItemsContainer.d.ts +15 -3
  419. package/lib/esm/components/LineItemsContainer.js +1 -1
  420. package/lib/esm/components/LineItemsCount.d.ts +14 -4
  421. package/lib/esm/components/LineItemsCount.js +1 -1
  422. package/lib/esm/components/LineItemsEmpty.d.ts +13 -2
  423. package/lib/esm/components/LineItemsEmpty.js +1 -1
  424. package/lib/esm/components/MetadataInput.d.ts +13 -3
  425. package/lib/esm/components/MetadataInput.js +1 -1
  426. package/lib/esm/components/PaymentGateway.d.ts +4 -4
  427. package/lib/esm/components/PaymentGateway.js +1 -1
  428. package/lib/esm/components/PaymentMethod.d.ts +9 -3
  429. package/lib/esm/components/PaymentMethod.js +1 -1
  430. package/lib/esm/components/PaymentMethodAmount.d.ts +16 -2
  431. package/lib/esm/components/PaymentMethodAmount.js +1 -1
  432. package/lib/esm/components/PaymentMethodName.d.ts +10 -4
  433. package/lib/esm/components/PaymentMethodName.js +1 -1
  434. package/lib/esm/components/PaymentMethodPrice.d.ts +15 -4
  435. package/lib/esm/components/PaymentMethodPrice.js +1 -1
  436. package/lib/esm/components/PaymentMethodRadioButton.d.ts +11 -4
  437. package/lib/esm/components/PaymentMethodRadioButton.js +1 -1
  438. package/lib/esm/components/PaymentMethodsContainer.d.ts +9 -3
  439. package/lib/esm/components/PaymentMethodsContainer.js +1 -1
  440. package/lib/esm/components/PaymentSource.d.ts +9 -2
  441. package/lib/esm/components/PaymentSource.js +1 -1
  442. package/lib/esm/components/PaymentSourceBrandIcon.d.ts +14 -4
  443. package/lib/esm/components/PaymentSourceBrandIcon.js +1 -1
  444. package/lib/esm/components/PaymentSourceBrandName.d.ts +11 -4
  445. package/lib/esm/components/PaymentSourceBrandName.js +1 -1
  446. package/lib/esm/components/PaymentSourceDetail.d.ts +8 -2
  447. package/lib/esm/components/PaymentSourceDetail.js +1 -1
  448. package/lib/esm/components/PaymentSourceEditButton.d.ts +9 -2
  449. package/lib/esm/components/PaymentSourceEditButton.js +1 -1
  450. package/lib/esm/components/PaypalPayment.d.ts +2 -2
  451. package/lib/esm/components/PaypalPayment.js +1 -1
  452. package/lib/esm/components/Price.d.ts +15 -3
  453. package/lib/esm/components/Price.js +1 -1
  454. package/lib/esm/components/PricesContainer.d.ts +19 -3
  455. package/lib/esm/components/PricesContainer.js +1 -1
  456. package/lib/esm/components/QuantitySelector.d.ts +19 -5
  457. package/lib/esm/components/QuantitySelector.js +1 -1
  458. package/lib/esm/components/SaveAddressesButton.d.ts +18 -5
  459. package/lib/esm/components/SaveAddressesButton.js +1 -1
  460. package/lib/esm/components/SaveCustomerButton.d.ts +16 -5
  461. package/lib/esm/components/SaveCustomerButton.js +1 -1
  462. package/lib/esm/components/ShippingAddressContainer.d.ts +7 -2
  463. package/lib/esm/components/ShippingAddressContainer.js +1 -1
  464. package/lib/esm/components/ShippingAddressForm.d.ts +8 -3
  465. package/lib/esm/components/ShippingAddressForm.js +1 -1
  466. package/lib/esm/components/ShippingAmount.d.ts +13 -2
  467. package/lib/esm/components/ShippingAmount.js +1 -1
  468. package/lib/esm/components/ShippingMethod.d.ts +10 -3
  469. package/lib/esm/components/ShippingMethod.js +1 -1
  470. package/lib/esm/components/ShippingMethodName.d.ts +11 -5
  471. package/lib/esm/components/ShippingMethodName.js +1 -1
  472. package/lib/esm/components/ShippingMethodPrice.d.ts +15 -3
  473. package/lib/esm/components/ShippingMethodPrice.js +1 -1
  474. package/lib/esm/components/ShippingMethodRadioButton.d.ts +11 -5
  475. package/lib/esm/components/ShippingMethodRadioButton.js +1 -1
  476. package/lib/esm/components/SkuField.d.ts +10 -0
  477. package/lib/esm/components/SkuField.js +1 -0
  478. package/lib/esm/components/Skus.d.ts +11 -0
  479. package/lib/esm/components/Skus.js +1 -0
  480. package/lib/esm/components/SkusContainer.d.ts +14 -0
  481. package/lib/esm/components/SkusContainer.js +1 -0
  482. package/lib/esm/components/StockTransfer.d.ts +9 -3
  483. package/lib/esm/components/StockTransfer.js +1 -1
  484. package/lib/esm/components/StockTransferField.d.ts +9 -8
  485. package/lib/esm/components/StockTransferField.js +1 -1
  486. package/lib/esm/components/StripePayment.d.ts +3 -3
  487. package/lib/esm/components/StripePayment.js +1 -1
  488. package/lib/esm/components/SubmitButton.d.ts +15 -5
  489. package/lib/esm/components/SubmitButton.js +1 -1
  490. package/lib/esm/components/VariantSelector.d.ts +28 -5
  491. package/lib/esm/components/VariantSelector.js +1 -1
  492. package/lib/esm/components/VariantsContainer.d.ts +15 -3
  493. package/lib/esm/components/VariantsContainer.js +1 -1
  494. package/lib/esm/components/WireTransferPayment.d.ts +2 -2
  495. package/lib/esm/components/WireTransferPayment.js +1 -1
  496. package/lib/esm/components/addresses/Address.d.ts +18 -0
  497. package/lib/esm/components/addresses/Address.js +1 -0
  498. package/lib/esm/components/addresses/AddressCountrySelector.d.ts +26 -0
  499. package/lib/esm/components/addresses/AddressCountrySelector.js +1 -0
  500. package/lib/esm/components/addresses/AddressField.d.ts +43 -0
  501. package/lib/esm/components/addresses/AddressField.js +1 -0
  502. package/lib/esm/components/addresses/AddressInput.d.ts +19 -0
  503. package/lib/esm/components/addresses/AddressInput.js +1 -0
  504. package/lib/esm/components/addresses/AddressStateSelector.d.ts +27 -0
  505. package/lib/esm/components/addresses/AddressStateSelector.js +1 -0
  506. package/lib/esm/components/addresses/AddressesContainer.d.ts +15 -0
  507. package/lib/esm/components/addresses/AddressesContainer.js +1 -0
  508. package/lib/esm/components/auth/CommerceLayer.d.ts +15 -0
  509. package/lib/esm/components/auth/CommerceLayer.js +1 -0
  510. package/lib/esm/components/customers/CustomerAddressForm.d.ts +13 -0
  511. package/lib/esm/components/customers/CustomerAddressForm.js +1 -0
  512. package/lib/esm/components/customers/CustomerContainer.d.ts +17 -0
  513. package/lib/esm/components/customers/CustomerContainer.js +1 -0
  514. package/lib/esm/components/customers/CustomerField.d.ts +10 -0
  515. package/lib/esm/components/customers/CustomerField.js +1 -0
  516. package/lib/esm/components/customers/CustomerInput.d.ts +23 -0
  517. package/lib/esm/components/customers/CustomerInput.js +1 -0
  518. package/lib/esm/components/gateways/AdyenGateway.d.ts +2 -2
  519. package/lib/esm/components/gateways/AdyenGateway.js +1 -1
  520. package/lib/esm/components/gateways/BraintreeGateway.d.ts +2 -2
  521. package/lib/esm/components/gateways/BraintreeGateway.js +1 -1
  522. package/lib/esm/components/gateways/CheckoutComGateway.d.ts +5 -0
  523. package/lib/esm/components/gateways/CheckoutComGateway.js +1 -0
  524. package/lib/esm/components/gateways/KlarnaGateway.d.ts +5 -0
  525. package/lib/esm/components/gateways/KlarnaGateway.js +1 -0
  526. package/lib/esm/components/gateways/PaypalGateway.d.ts +3 -3
  527. package/lib/esm/components/gateways/PaypalGateway.js +1 -1
  528. package/lib/esm/components/gateways/StripeGateway.d.ts +2 -2
  529. package/lib/esm/components/gateways/StripeGateway.js +1 -1
  530. package/lib/esm/components/gateways/WireTransferGateway.d.ts +2 -2
  531. package/lib/esm/components/gateways/WireTransferGateway.js +1 -1
  532. package/lib/esm/components/orders/AddToCartButton.d.ts +34 -0
  533. package/lib/esm/components/orders/AddToCartButton.js +1 -0
  534. package/lib/esm/components/orders/AdjustmentAmount.d.ts +18 -0
  535. package/lib/esm/components/orders/AdjustmentAmount.js +1 -0
  536. package/lib/esm/components/orders/CartLink.d.ts +12 -0
  537. package/lib/esm/components/orders/CartLink.js +1 -0
  538. package/lib/esm/components/orders/GiftCardAmount.d.ts +15 -0
  539. package/lib/esm/components/orders/GiftCardAmount.js +1 -0
  540. package/lib/esm/components/orders/OrderContainer.d.ts +26 -0
  541. package/lib/esm/components/orders/OrderContainer.js +1 -0
  542. package/lib/esm/components/orders/OrderList.d.ts +61 -0
  543. package/lib/esm/components/orders/OrderList.js +1 -0
  544. package/lib/esm/components/orders/OrderListRow.d.ts +30 -0
  545. package/lib/esm/components/orders/OrderListRow.js +1 -0
  546. package/lib/esm/components/orders/OrderNumber.d.ts +11 -0
  547. package/lib/esm/components/orders/OrderNumber.js +1 -0
  548. package/lib/esm/components/orders/OrderStorage.d.ts +16 -0
  549. package/lib/esm/components/orders/OrderStorage.js +1 -0
  550. package/lib/esm/components/orders/PlaceOrderButton.d.ts +24 -0
  551. package/lib/esm/components/orders/PlaceOrderButton.js +1 -0
  552. package/lib/esm/components/orders/PlaceOrderContainer.d.ts +14 -0
  553. package/lib/esm/components/orders/PlaceOrderContainer.js +1 -0
  554. package/lib/esm/components/orders/PrivacyAndTermsCheckbox.d.ts +10 -0
  555. package/lib/esm/components/orders/PrivacyAndTermsCheckbox.js +1 -0
  556. package/lib/esm/components/orders/SubTotalAmount.d.ts +18 -0
  557. package/lib/esm/components/orders/SubTotalAmount.js +1 -0
  558. package/lib/esm/components/orders/TaxesAmount.d.ts +18 -0
  559. package/lib/esm/components/orders/TaxesAmount.js +1 -0
  560. package/lib/esm/components/orders/TotalAmount.d.ts +18 -0
  561. package/lib/esm/components/orders/TotalAmount.js +1 -0
  562. package/lib/esm/components/shipments/Shipment.d.ts +15 -0
  563. package/lib/esm/components/shipments/Shipment.js +1 -0
  564. package/lib/esm/components/shipments/ShipmentField.d.ts +19 -0
  565. package/lib/esm/components/shipments/ShipmentField.js +1 -0
  566. package/lib/esm/components/shipments/ShipmentsContainer.d.ts +12 -0
  567. package/lib/esm/components/shipments/ShipmentsContainer.js +1 -0
  568. package/lib/esm/components/skus/SkuField.d.ts +14 -0
  569. package/lib/esm/components/skus/SkuField.js +1 -0
  570. package/lib/esm/components/skus/SkuList.d.ts +14 -0
  571. package/lib/esm/components/skus/SkuList.js +1 -0
  572. package/lib/esm/components/skus/SkuListsContainer.d.ts +12 -0
  573. package/lib/esm/components/skus/SkuListsContainer.js +1 -0
  574. package/lib/esm/components/skus/SkuOption.d.ts +14 -0
  575. package/lib/esm/components/skus/SkuOption.js +1 -0
  576. package/lib/esm/components/skus/SkuOptionInput.d.ts +15 -0
  577. package/lib/esm/components/skus/SkuOptionInput.js +1 -0
  578. package/lib/esm/components/skus/SkuOptionsContainer.d.ts +14 -0
  579. package/lib/esm/components/skus/SkuOptionsContainer.js +1 -0
  580. package/lib/esm/components/skus/Skus.d.ts +11 -0
  581. package/lib/esm/components/skus/Skus.js +1 -0
  582. package/lib/esm/components/skus/SkusContainer.d.ts +23 -0
  583. package/lib/esm/components/skus/SkusContainer.js +1 -0
  584. package/lib/esm/components/utils/AddressCardsTemplate.d.ts +1 -1
  585. package/lib/esm/components/utils/AddressCardsTemplate.js +1 -1
  586. package/lib/esm/components/utils/BaseField.js +1 -1
  587. package/lib/esm/components/utils/BaseInput.d.ts +1 -1
  588. package/lib/esm/components/utils/BaseInput.js +1 -1
  589. package/lib/esm/components/utils/BaseOrderPrice.js +1 -1
  590. package/lib/esm/components/utils/BaseSelect.js +1 -1
  591. package/lib/esm/components/utils/GenericFieldComponent.d.ts +42 -0
  592. package/lib/esm/components/utils/GenericFieldComponent.js +1 -0
  593. package/lib/esm/components/utils/Parent.d.ts +3 -5
  594. package/lib/esm/components/utils/Parent.js +1 -1
  595. package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +2 -2
  596. package/lib/esm/components/utils/PaymentCardsTemplate.js +1 -1
  597. package/lib/esm/components/utils/PriceTemplate.d.ts +2 -2
  598. package/lib/esm/components/utils/PriceTemplate.js +1 -1
  599. package/lib/esm/components/utils/VariantTemplate.js +1 -1
  600. package/lib/esm/components/utils/getAllErrors.js +1 -1
  601. package/lib/esm/config/components.d.ts +78 -36
  602. package/lib/esm/config/components.js +1 -1
  603. package/lib/esm/context/AddressChildrenContext.d.ts +1 -1
  604. package/lib/esm/context/AddressChildrenContext.js +1 -1
  605. package/lib/esm/context/AddressContext.d.ts +1 -1
  606. package/lib/esm/context/BillingAddressContext.d.ts +2 -4
  607. package/lib/esm/context/BillingAddressContext.js +1 -1
  608. package/lib/esm/context/BillingAddressFormContext.d.ts +18 -11
  609. package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +4 -2
  610. package/lib/esm/context/CustomerAddressFormContext.d.ts +20 -0
  611. package/lib/esm/context/CustomerAddressFormContext.js +1 -0
  612. package/lib/esm/context/CustomerContext.d.ts +17 -11
  613. package/lib/esm/context/CustomerContext.js +1 -1
  614. package/lib/esm/context/OrderContext.d.ts +8 -4
  615. package/lib/esm/context/OrderContext.js +1 -1
  616. package/lib/esm/context/OrderListChildrenContext.d.ts +60 -0
  617. package/lib/esm/context/OrderListChildrenContext.js +1 -0
  618. package/lib/esm/context/PaymentSourceContext.d.ts +4 -4
  619. package/lib/esm/context/PlaceOrderContext.d.ts +4 -2
  620. package/lib/esm/context/ShippingAddressContext.d.ts +1 -1
  621. package/lib/esm/context/SkuChildrenContext.d.ts +9 -0
  622. package/lib/esm/context/SkuChildrenContext.js +1 -0
  623. package/lib/esm/context/SkuContext.d.ts +9 -0
  624. package/lib/esm/context/SkuContext.js +1 -0
  625. package/lib/esm/index.d.ts +101 -90
  626. package/lib/esm/index.js +1 -1
  627. package/lib/esm/reducers/AddressReducer.d.ts +4 -2
  628. package/lib/esm/reducers/AddressReducer.js +1 -1
  629. package/lib/esm/reducers/AvailabilityReducer.d.ts +8 -0
  630. package/lib/esm/reducers/AvailabilityReducer.js +1 -1
  631. package/lib/esm/reducers/BillingAddressReducer.js +1 -1
  632. package/lib/esm/reducers/CustomerReducer.d.ts +98 -17
  633. package/lib/esm/reducers/CustomerReducer.js +1 -1
  634. package/lib/esm/reducers/GiftCardReducer.js +1 -1
  635. package/lib/esm/reducers/LineItemReducer.js +1 -1
  636. package/lib/esm/reducers/OrderReducer.d.ts +24 -8
  637. package/lib/esm/reducers/OrderReducer.js +1 -1
  638. package/lib/esm/reducers/PaymentMethodReducer.d.ts +51 -5
  639. package/lib/esm/reducers/PaymentMethodReducer.js +1 -1
  640. package/lib/esm/reducers/PlaceOrderReducer.d.ts +9 -2
  641. package/lib/esm/reducers/PlaceOrderReducer.js +1 -1
  642. package/lib/esm/reducers/PriceReducer.js +1 -1
  643. package/lib/esm/reducers/ShipmentReducer.js +1 -1
  644. package/lib/esm/reducers/ShippingAddressReducer.js +1 -1
  645. package/lib/esm/reducers/SkuReducer.d.ts +21 -0
  646. package/lib/esm/reducers/SkuReducer.js +1 -0
  647. package/lib/esm/reducers/VariantReducer.d.ts +1 -0
  648. package/lib/esm/reducers/VariantReducer.js +1 -1
  649. package/lib/esm/typings/errors.d.ts +13 -4
  650. package/lib/esm/typings/errors.js +1 -1
  651. package/lib/esm/typings/index.d.ts +18 -7
  652. package/lib/esm/typings/index.js +1 -1
  653. package/lib/esm/utils/addressesManager.d.ts +1 -1
  654. package/lib/esm/utils/addressesManager.js +1 -1
  655. package/lib/esm/utils/baseReducer.js +1 -1
  656. package/lib/esm/utils/checkIncludeResource.d.ts +8 -0
  657. package/lib/esm/utils/checkIncludeResource.js +1 -0
  658. package/lib/esm/utils/childrenTypes.d.ts +1 -1
  659. package/lib/esm/utils/childrenTypes.js +1 -1
  660. package/lib/esm/utils/compareObjAttribute.d.ts +7 -0
  661. package/lib/esm/utils/compareObjAttribute.js +1 -0
  662. package/lib/esm/utils/customMessages.d.ts +1 -7
  663. package/lib/esm/utils/customMessages.js +1 -1
  664. package/lib/esm/utils/getCardDetails.d.ts +15 -0
  665. package/lib/esm/utils/getCardDetails.js +1 -0
  666. package/lib/esm/utils/getCartLink.d.ts +7 -0
  667. package/lib/esm/utils/getCartLink.js +1 -0
  668. package/lib/esm/utils/getCurrentItemKey.js +1 -1
  669. package/lib/esm/utils/getErrors.d.ts +1 -1
  670. package/lib/esm/utils/getErrors.js +1 -1
  671. package/lib/esm/utils/getLineItemsCount.d.ts +8 -10
  672. package/lib/esm/utils/getLineItemsCount.js +1 -1
  673. package/lib/esm/utils/getLoaderComponent.js +1 -1
  674. package/lib/esm/utils/getPrices.js +1 -1
  675. package/lib/esm/utils/getSdk.js +1 -1
  676. package/lib/esm/utils/getSkus.js +1 -1
  677. package/lib/esm/utils/hooks/useExternalScript.d.ts +1 -0
  678. package/lib/esm/utils/hooks/useExternalScript.js +1 -0
  679. package/lib/esm/utils/icons.d.ts +3 -0
  680. package/lib/esm/utils/icons.js +1 -0
  681. package/lib/esm/utils/isDate.d.ts +1 -0
  682. package/lib/esm/utils/isDate.js +1 -0
  683. package/lib/esm/utils/jwt.d.ts +1 -1
  684. package/lib/esm/utils/placeholderImages.d.ts +2 -0
  685. package/lib/esm/utils/placeholderImages.js +1 -0
  686. package/lib/esm/utils/promisify.js +1 -1
  687. package/lib/esm/utils/scrollbarWidth.d.ts +1 -0
  688. package/lib/esm/utils/scrollbarWidth.js +1 -0
  689. package/lib/esm/utils/shipments.d.ts +2 -1
  690. package/lib/esm/utils/shipments.js +1 -1
  691. package/lib/esm/utils/validateFormFields.d.ts +2 -0
  692. package/lib/esm/utils/validateFormFields.js +1 -1
  693. package/lib/tsconfig.prod.esm.tsbuildinfo +1 -1
  694. package/lib/tsconfig.prod.tsbuildinfo +1 -1
  695. package/package.json +118 -93
  696. package/lib/cjs/components/AddToCartButton.d.ts +0 -20
  697. package/lib/cjs/components/AddToCartButton.js +0 -1
  698. package/lib/cjs/components/Address.d.ts +0 -13
  699. package/lib/cjs/components/Address.js +0 -1
  700. package/lib/cjs/components/AddressCountrySelector.d.ts +0 -9
  701. package/lib/cjs/components/AddressCountrySelector.js +0 -1
  702. package/lib/cjs/components/AddressField.d.ts +0 -15
  703. package/lib/cjs/components/AddressField.js +0 -1
  704. package/lib/cjs/components/AddressInput.d.ts +0 -7
  705. package/lib/cjs/components/AddressInput.js +0 -1
  706. package/lib/cjs/components/AddressStateSelector.d.ts +0 -11
  707. package/lib/cjs/components/AddressStateSelector.js +0 -1
  708. package/lib/cjs/components/AddressesContainer.d.ts +0 -7
  709. package/lib/cjs/components/AddressesContainer.js +0 -1
  710. package/lib/cjs/components/CommerceLayer.d.ts +0 -8
  711. package/lib/cjs/components/CommerceLayer.js +0 -1
  712. package/lib/cjs/components/CustomerContainer.d.ts +0 -7
  713. package/lib/cjs/components/CustomerContainer.js +0 -1
  714. package/lib/cjs/components/CustomerInput.d.ts +0 -11
  715. package/lib/cjs/components/CustomerInput.js +0 -1
  716. package/lib/cjs/components/GiftCardAmount.d.ts +0 -4
  717. package/lib/cjs/components/GiftCardAmount.js +0 -1
  718. package/lib/cjs/components/OrderContainer.d.ts +0 -11
  719. package/lib/cjs/components/OrderContainer.js +0 -1
  720. package/lib/cjs/components/OrderNumber.d.ts +0 -5
  721. package/lib/cjs/components/OrderNumber.js +0 -1
  722. package/lib/cjs/components/OrderStorage.d.ts +0 -8
  723. package/lib/cjs/components/OrderStorage.js +0 -1
  724. package/lib/cjs/components/PlaceOrderButton.d.ts +0 -12
  725. package/lib/cjs/components/PlaceOrderButton.js +0 -1
  726. package/lib/cjs/components/PlaceOrderContainer.d.ts +0 -8
  727. package/lib/cjs/components/PlaceOrderContainer.js +0 -1
  728. package/lib/cjs/components/PrivacyAndTermsCheckbox.d.ts +0 -4
  729. package/lib/cjs/components/PrivacyAndTermsCheckbox.js +0 -1
  730. package/lib/cjs/components/Shipment.d.ts +0 -8
  731. package/lib/cjs/components/Shipment.js +0 -1
  732. package/lib/cjs/components/ShipmentField.d.ts +0 -12
  733. package/lib/cjs/components/ShipmentField.js +0 -1
  734. package/lib/cjs/components/ShipmentsContainer.d.ts +0 -6
  735. package/lib/cjs/components/ShipmentsContainer.js +0 -1
  736. package/lib/cjs/components/SkuList.d.ts +0 -7
  737. package/lib/cjs/components/SkuList.js +0 -1
  738. package/lib/cjs/components/SkuListsContainer.d.ts +0 -6
  739. package/lib/cjs/components/SkuListsContainer.js +0 -1
  740. package/lib/cjs/components/SkuOption.d.ts +0 -7
  741. package/lib/cjs/components/SkuOption.js +0 -1
  742. package/lib/cjs/components/SkuOptionInput.d.ts +0 -5
  743. package/lib/cjs/components/SkuOptionInput.js +0 -1
  744. package/lib/cjs/components/SkuOptionsContainer.d.ts +0 -7
  745. package/lib/cjs/components/SkuOptionsContainer.js +0 -1
  746. package/lib/cjs/components/SubTotalAmount.d.ts +0 -4
  747. package/lib/cjs/components/SubTotalAmount.js +0 -1
  748. package/lib/cjs/components/TaxesAmount.d.ts +0 -4
  749. package/lib/cjs/components/TaxesAmount.js +0 -1
  750. package/lib/cjs/components/TotalAmount.d.ts +0 -4
  751. package/lib/cjs/components/TotalAmount.js +0 -1
  752. package/lib/esm/components/AddToCartButton.d.ts +0 -20
  753. package/lib/esm/components/AddToCartButton.js +0 -1
  754. package/lib/esm/components/Address.d.ts +0 -13
  755. package/lib/esm/components/Address.js +0 -1
  756. package/lib/esm/components/AddressCountrySelector.d.ts +0 -9
  757. package/lib/esm/components/AddressCountrySelector.js +0 -1
  758. package/lib/esm/components/AddressField.d.ts +0 -15
  759. package/lib/esm/components/AddressField.js +0 -1
  760. package/lib/esm/components/AddressInput.d.ts +0 -7
  761. package/lib/esm/components/AddressInput.js +0 -1
  762. package/lib/esm/components/AddressStateSelector.d.ts +0 -11
  763. package/lib/esm/components/AddressStateSelector.js +0 -1
  764. package/lib/esm/components/AddressesContainer.d.ts +0 -7
  765. package/lib/esm/components/AddressesContainer.js +0 -1
  766. package/lib/esm/components/CommerceLayer.d.ts +0 -8
  767. package/lib/esm/components/CommerceLayer.js +0 -1
  768. package/lib/esm/components/CustomerContainer.d.ts +0 -7
  769. package/lib/esm/components/CustomerContainer.js +0 -1
  770. package/lib/esm/components/CustomerInput.d.ts +0 -11
  771. package/lib/esm/components/CustomerInput.js +0 -1
  772. package/lib/esm/components/GiftCardAmount.d.ts +0 -4
  773. package/lib/esm/components/GiftCardAmount.js +0 -1
  774. package/lib/esm/components/OrderContainer.d.ts +0 -11
  775. package/lib/esm/components/OrderContainer.js +0 -1
  776. package/lib/esm/components/OrderNumber.d.ts +0 -5
  777. package/lib/esm/components/OrderNumber.js +0 -1
  778. package/lib/esm/components/OrderStorage.d.ts +0 -8
  779. package/lib/esm/components/OrderStorage.js +0 -1
  780. package/lib/esm/components/PlaceOrderButton.d.ts +0 -12
  781. package/lib/esm/components/PlaceOrderButton.js +0 -1
  782. package/lib/esm/components/PlaceOrderContainer.d.ts +0 -8
  783. package/lib/esm/components/PlaceOrderContainer.js +0 -1
  784. package/lib/esm/components/PrivacyAndTermsCheckbox.d.ts +0 -4
  785. package/lib/esm/components/PrivacyAndTermsCheckbox.js +0 -1
  786. package/lib/esm/components/Shipment.d.ts +0 -8
  787. package/lib/esm/components/Shipment.js +0 -1
  788. package/lib/esm/components/ShipmentField.d.ts +0 -12
  789. package/lib/esm/components/ShipmentField.js +0 -1
  790. package/lib/esm/components/ShipmentsContainer.d.ts +0 -6
  791. package/lib/esm/components/ShipmentsContainer.js +0 -1
  792. package/lib/esm/components/SkuList.d.ts +0 -7
  793. package/lib/esm/components/SkuList.js +0 -1
  794. package/lib/esm/components/SkuListsContainer.d.ts +0 -6
  795. package/lib/esm/components/SkuListsContainer.js +0 -1
  796. package/lib/esm/components/SkuOption.d.ts +0 -7
  797. package/lib/esm/components/SkuOption.js +0 -1
  798. package/lib/esm/components/SkuOptionInput.d.ts +0 -5
  799. package/lib/esm/components/SkuOptionInput.js +0 -1
  800. package/lib/esm/components/SkuOptionsContainer.d.ts +0 -7
  801. package/lib/esm/components/SkuOptionsContainer.js +0 -1
  802. package/lib/esm/components/SubTotalAmount.d.ts +0 -4
  803. package/lib/esm/components/SubTotalAmount.js +0 -1
  804. package/lib/esm/components/TaxesAmount.d.ts +0 -4
  805. package/lib/esm/components/TaxesAmount.js +0 -1
  806. package/lib/esm/components/TotalAmount.d.ts +0 -4
  807. package/lib/esm/components/TotalAmount.js +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),GiftCardContext_1=(0,tslib_1.__importDefault)(require("../context/GiftCardContext")),CommerceLayerContext_1=(0,tslib_1.__importDefault)(require("../context/CommerceLayerContext")),GiftCardReducer_1=(0,tslib_1.__importStar)(require("../reducers/GiftCardReducer")),OrderContext_1=(0,tslib_1.__importDefault)(require("../context/OrderContext")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),propTypes=components_1.default.GiftCardContainer.propTypes,displayName=components_1.default.GiftCardContainer.displayName,GiftCardContainer=props=>{const{children}=props,[state,dispatch]=(0,react_1.useReducer)(GiftCardReducer_1.default,GiftCardReducer_1.giftCardInitialState),config=(0,react_1.useContext)(CommerceLayerContext_1.default),{getOrder,createOrder,order}=(0,react_1.useContext)(OrderContext_1.default),giftCardValue=Object.assign(Object.assign({},state),{addGiftCardRecipient:values=>(0,GiftCardReducer_1.addGiftCardRecipient)(values,config,dispatch),addGiftCard:values=>(0,GiftCardReducer_1.addGiftCard)(Object.assign({},values),{config,dispatch,getOrder,createOrder,order}),addGiftCardError:errors=>(0,GiftCardReducer_1.addGiftCardError)(errors,dispatch),addGiftCardLoading:loading=>(0,GiftCardReducer_1.addGiftCardLoading)(loading,dispatch)});return(0,jsx_runtime_1.jsx)(GiftCardContext_1.default.Provider,Object.assign({value:giftCardValue},{children}),void 0)};GiftCardContainer.propTypes=propTypes,GiftCardContainer.displayName=displayName,exports.default=GiftCardContainer;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardContainer=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),GiftCardContext_1=tslib_1.__importDefault(require("../context/GiftCardContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../context/CommerceLayerContext")),GiftCardReducer_1=tslib_1.__importStar(require("../reducers/GiftCardReducer")),OrderContext_1=tslib_1.__importDefault(require("../context/OrderContext")),components_1=tslib_1.__importDefault(require("../config/components")),propTypes=components_1.default.GiftCardContainer.propTypes,displayName=components_1.default.GiftCardContainer.displayName;function GiftCardContainer(props){const{children}=props,[state,dispatch]=(0,react_1.useReducer)(GiftCardReducer_1.default,GiftCardReducer_1.giftCardInitialState),config=(0,react_1.useContext)(CommerceLayerContext_1.default),{getOrder,createOrder,order}=(0,react_1.useContext)(OrderContext_1.default),giftCardValue={...state,addGiftCardRecipient:values=>(0,GiftCardReducer_1.addGiftCardRecipient)(values,config,dispatch),addGiftCard:values=>(0,GiftCardReducer_1.addGiftCard)({...values},{config,dispatch,getOrder,createOrder,order}),addGiftCardError:errors=>(0,GiftCardReducer_1.addGiftCardError)(errors,dispatch),addGiftCardLoading:loading=>(0,GiftCardReducer_1.addGiftCardLoading)(loading,dispatch)};return(0,jsx_runtime_1.jsx)(GiftCardContext_1.default.Provider,{value:giftCardValue,children})}exports.GiftCardContainer=GiftCardContainer,GiftCardContainer.propTypes=propTypes,GiftCardContainer.displayName=displayName,exports.default=GiftCardContainer;
@@ -1,7 +1,22 @@
1
- import { FunctionComponent } from 'react';
1
+ /// <reference types="react" />
2
2
  import { BaseSelectComponentProps } from '../typings/index';
3
- declare type GiftCardCurrencySelectorProps = Omit<BaseSelectComponentProps, 'options' | 'name'> & {
3
+ declare type Props = Omit<BaseSelectComponentProps, 'options' | 'name'> & {
4
4
  required?: boolean;
5
5
  } & Pick<JSX.IntrinsicElements['select'], 'className' | 'id' | 'style'>;
6
- declare const GiftCardCurrencySelector: FunctionComponent<GiftCardCurrencySelectorProps>;
6
+ export declare function GiftCardCurrencySelector(props: Props): JSX.Element;
7
+ export declare namespace GiftCardCurrencySelector {
8
+ var propTypes: {
9
+ children: import("prop-types").Requireable<(...args: any[]) => any>;
10
+ placeholder: import("prop-types").Requireable<import("prop-types").InferProps<{
11
+ value: import("prop-types").Validator<string | number>;
12
+ label: import("prop-types").Validator<string>;
13
+ }>>;
14
+ value: import("prop-types").Requireable<string>;
15
+ required: import("prop-types").Requireable<boolean>;
16
+ };
17
+ var defaultProps: {
18
+ required: boolean;
19
+ };
20
+ var displayName: string;
21
+ }
7
22
  export default GiftCardCurrencySelector;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),BaseSelect_1=(0,tslib_1.__importDefault)(require("./utils/BaseSelect")),currency_1=(0,tslib_1.__importDefault)(require("../config/currency")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),propTypes=components_1.default.GiftCardCurrencySelector.propTypes,defaultProps=components_1.default.GiftCardCurrencySelector.defaultProps,displayName=components_1.default.GiftCardCurrencySelector.displayName,GiftCardCurrencySelector=props=>(0,jsx_runtime_1.jsx)(BaseSelect_1.default,Object.assign({options:currency_1.default,name:"currencyCode"},props),void 0);GiftCardCurrencySelector.propTypes=propTypes,GiftCardCurrencySelector.defaultProps=defaultProps,GiftCardCurrencySelector.displayName=displayName,exports.default=GiftCardCurrencySelector;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardCurrencySelector=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),BaseSelect_1=tslib_1.__importDefault(require("./utils/BaseSelect")),currency_1=tslib_1.__importDefault(require("../config/currency")),components_1=tslib_1.__importDefault(require("../config/components")),propTypes=components_1.default.GiftCardCurrencySelector.propTypes,defaultProps=components_1.default.GiftCardCurrencySelector.defaultProps,displayName=components_1.default.GiftCardCurrencySelector.displayName;function GiftCardCurrencySelector(props){return(0,jsx_runtime_1.jsx)(BaseSelect_1.default,{options:currency_1.default,name:"currencyCode",...props})}exports.GiftCardCurrencySelector=GiftCardCurrencySelector,GiftCardCurrencySelector.propTypes=propTypes,GiftCardCurrencySelector.defaultProps=defaultProps,GiftCardCurrencySelector.displayName=displayName,exports.default=GiftCardCurrencySelector;
@@ -1,7 +1,16 @@
1
- import { FunctionComponent } from 'react';
1
+ /// <reference types="react" />
2
2
  import { BaseInputComponentProps, GiftCardInputName } from '../typings/index';
3
- export declare type GiftCardInputProps = {
3
+ declare type Props = {
4
4
  name: GiftCardInputName;
5
5
  } & Omit<BaseInputComponentProps, 'name'> & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['textarea'];
6
- declare const GiftCardInput: FunctionComponent<GiftCardInputProps>;
6
+ export declare function GiftCardInput(props: Props): JSX.Element;
7
+ export declare namespace GiftCardInput {
8
+ var propTypes: {
9
+ type: import("prop-types").Validator<import("../typings/index").BaseInputType>;
10
+ name: import("prop-types").Validator<GiftCardInputName>;
11
+ children: import("prop-types").Requireable<(...args: any[]) => any>;
12
+ placeholder: import("prop-types").Requireable<string>;
13
+ };
14
+ var displayName: string;
15
+ }
7
16
  export default GiftCardInput;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),BaseInput_1=(0,tslib_1.__importDefault)(require("./utils/BaseInput")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),propTypes=components_1.default.GiftCardInput.propTypes,displayName=components_1.default.GiftCardInput.displayName,GiftCardInput=props=>{const{placeholder=""}=props,p=(0,tslib_1.__rest)(props,["placeholder"]);return(0,jsx_runtime_1.jsx)(BaseInput_1.default,Object.assign({placeholder},p),void 0)};GiftCardInput.propTypes=propTypes,GiftCardInput.displayName=displayName,exports.default=GiftCardInput;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardInput=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),BaseInput_1=tslib_1.__importDefault(require("./utils/BaseInput")),components_1=tslib_1.__importDefault(require("../config/components")),propTypes=components_1.default.GiftCardInput.propTypes,displayName=components_1.default.GiftCardInput.displayName;function GiftCardInput(props){const{placeholder="",...p}=props;return(0,jsx_runtime_1.jsx)(BaseInput_1.default,{placeholder,...p})}exports.GiftCardInput=GiftCardInput,GiftCardInput.propTypes=propTypes,GiftCardInput.displayName=displayName,exports.default=GiftCardInput;
@@ -1,13 +1,24 @@
1
- import { FunctionComponent } from 'react';
1
+ /// <reference types="react" />
2
2
  import { FunctionChildren } from '../typings/index';
3
- import { CodeType } from '../reducers/OrderReducer';
4
- declare type GiftCardOrCouponCodeChildrenProps = FunctionChildren<Omit<GiftCardOrCouponCodeProps, 'children'> & {
3
+ import type { CodeType } from '../reducers/OrderReducer';
4
+ declare type ChildrenProps = Omit<Props, 'children'> & {
5
5
  code?: string;
6
6
  hide?: boolean;
7
- }>;
8
- declare type GiftCardOrCouponCodeProps = {
7
+ discountAmountCents?: string;
8
+ discountAmountFloat?: string;
9
+ formattedDiscountAmount?: string;
10
+ };
11
+ declare type GiftCardOrCouponCodeChildrenProps = FunctionChildren<ChildrenProps>;
12
+ declare type Props = {
9
13
  type?: CodeType;
10
14
  children?: GiftCardOrCouponCodeChildrenProps;
11
15
  } & JSX.IntrinsicElements['span'];
12
- declare const GiftCardOrCouponCode: FunctionComponent<GiftCardOrCouponCodeProps>;
16
+ export declare function GiftCardOrCouponCode({ children, type, ...props }: Props): JSX.Element | null;
17
+ export declare namespace GiftCardOrCouponCode {
18
+ var propTypes: {
19
+ children: import("prop-types").Requireable<(...args: any[]) => any>;
20
+ type: import("prop-types").Requireable<CodeType>;
21
+ };
22
+ var displayName: string;
23
+ }
13
24
  export default GiftCardOrCouponCode;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),components_1=(0,tslib_1.__importDefault)(require("../config/components")),Parent_1=(0,tslib_1.__importDefault)(require("./utils/Parent")),OrderContext_1=(0,tslib_1.__importDefault)(require("../context/OrderContext")),lodash_1=require("lodash"),propTypes=components_1.default.GiftCardOrCouponCode.propTypes,displayName=components_1.default.GiftCardOrCouponCode.displayName,GiftCardOrCouponCode=_a=>{var{children,type}=_a,props=(0,tslib_1.__rest)(_a,["children","type"]);const{order}=(0,react_1.useContext)(OrderContext_1.default);let codeType=type&&`${type}_code`;!type&&order&&(0,lodash_1.has)(order,"coupon_code")&&!(0,lodash_1.isEmpty)(order.coupon_code)?codeType="coupon_code":type||(codeType="gift_card_code");const code=order&&codeType?order[codeType]:"",hide=!(order&&code),parentProps=Object.assign(Object.assign({},props),{code,hide});return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children}),void 0):hide?null:(0,jsx_runtime_1.jsx)("span",Object.assign({},props,{children:code}),void 0)};GiftCardOrCouponCode.propTypes=propTypes,GiftCardOrCouponCode.displayName=displayName,exports.default=GiftCardOrCouponCode;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponCode=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),components_1=tslib_1.__importDefault(require("../config/components")),Parent_1=tslib_1.__importDefault(require("./utils/Parent")),OrderContext_1=tslib_1.__importDefault(require("../context/OrderContext")),has_1=tslib_1.__importDefault(require("lodash/has")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty")),propTypes=components_1.default.GiftCardOrCouponCode.propTypes,displayName=components_1.default.GiftCardOrCouponCode.displayName;function GiftCardOrCouponCode({children,type,...props}){const{order}=(0,react_1.useContext)(OrderContext_1.default);let codeType=type&&`${type}_code`;!type&&order&&(0,has_1.default)(order,"coupon_code")&&!(0,isEmpty_1.default)(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?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):hide?null:(0,jsx_runtime_1.jsx)("span",{...props,children:code})}exports.GiftCardOrCouponCode=GiftCardOrCouponCode,GiftCardOrCouponCode.propTypes=propTypes,GiftCardOrCouponCode.displayName=displayName,exports.default=GiftCardOrCouponCode;
@@ -1,10 +1,15 @@
1
- import { FunctionComponent, ReactNode } from 'react';
2
- declare type GiftCardOrCouponFormProps = {
1
+ import { ReactNode } from 'react';
2
+ declare type Props = {
3
3
  children: ReactNode;
4
- reset?: boolean;
5
4
  onSubmit?: (response: {
6
5
  success: boolean;
6
+ value: string;
7
7
  }) => void;
8
8
  } & Omit<JSX.IntrinsicElements['form'], 'onSubmit'>;
9
- declare const GiftCardOrCouponForm: FunctionComponent<GiftCardOrCouponFormProps>;
9
+ export declare function GiftCardOrCouponForm(props: Props): JSX.Element | null;
10
+ export declare namespace GiftCardOrCouponForm {
11
+ var propTypes: {
12
+ children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
13
+ };
14
+ }
10
15
  export default GiftCardOrCouponForm;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),rapid_form_1=(0,tslib_1.__importDefault)(require("rapid-form")),react_1=require("react"),CouponAndGiftCardFormContext_1=(0,tslib_1.__importDefault)(require("../context/CouponAndGiftCardFormContext")),OrderContext_1=(0,tslib_1.__importDefault)(require("../context/OrderContext")),isEmpty_1=(0,tslib_1.__importDefault)(require("lodash/isEmpty")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),camelCase_1=(0,tslib_1.__importDefault)(require("lodash/camelCase")),dropWhile_1=(0,tslib_1.__importDefault)(require("lodash/dropWhile")),has_1=(0,tslib_1.__importDefault)(require("lodash/has")),lodash_1=require("lodash"),propTypes=components_1.default.GiftCardOrCouponForm.propTypes,GiftCardOrCouponForm=props=>{const{children,autoComplete="on",reset=!1,onSubmit}=props,p=(0,tslib_1.__rest)(props,["children","autoComplete","reset","onSubmit"]),{validation,values}=(0,rapid_form_1.default)(),{setGiftCardOrCouponCode,order,errors,setOrderErrors}=(0,react_1.useContext)(OrderContext_1.default),ref=(0,react_1.useRef)(null),inputName="gift_card_or_coupon_code";(0,react_1.useEffect)(()=>{var _a;if(((_a=values[inputName])===null||_a===void 0?void 0:_a.value)===""&&(0,lodash_1.findIndex)(errors,{field:(0,camelCase_1.default)(inputName)})!==-1){const err=(0,dropWhile_1.default)(errors,i=>i.field===(0,camelCase_1.default)(inputName));setOrderErrors({errors:err}),onSubmit&&onSubmit({success:!0})}},[values]);const handleSubmit=async e=>{e.preventDefault();const code=(0,has_1.default)(values,inputName)?values[inputName].value:void 0;if(code){const{success}=await setGiftCardOrCouponCode({code});onSubmit&&onSubmit({success}),success&&e.target.reset()}};return(order==null?void 0:order.gift_card_or_coupon_code)||(0,isEmpty_1.default)(order)?null:(0,jsx_runtime_1.jsx)(CouponAndGiftCardFormContext_1.default.Provider,Object.assign({value:{validation}},{children:(0,jsx_runtime_1.jsx)("form",Object.assign({ref,autoComplete,onSubmit:handleSubmit},p,{children}),void 0)}),void 0)};GiftCardOrCouponForm.propTypes=propTypes,exports.default=GiftCardOrCouponForm;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponForm=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),rapid_form_1=require("rapid-form"),react_1=require("react"),CouponAndGiftCardFormContext_1=tslib_1.__importDefault(require("../context/CouponAndGiftCardFormContext")),OrderContext_1=tslib_1.__importDefault(require("../context/OrderContext")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty")),components_1=tslib_1.__importDefault(require("../config/components")),camelCase_1=tslib_1.__importDefault(require("lodash/camelCase")),dropWhile_1=tslib_1.__importDefault(require("lodash/dropWhile")),has_1=tslib_1.__importDefault(require("lodash/has")),lodash_1=require("lodash"),propTypes=components_1.default.GiftCardOrCouponForm.propTypes;function GiftCardOrCouponForm(props){const{children,autoComplete="on",onSubmit,...p}=props,{validation,values,reset}=(0,rapid_form_1.useRapidForm)(),[codeType,setCodeType]=(0,react_1.useState)("gift_card_or_coupon_code"),{setGiftCardOrCouponCode,order,errors,setOrderErrors}=(0,react_1.useContext)(OrderContext_1.default),ref=(0,react_1.useRef)(null),inputName="gift_card_or_coupon_code";(0,react_1.useEffect)(()=>{if(values[inputName]?.value===""&&(0,lodash_1.findIndex)(errors,{field:(0,camelCase_1.default)(inputName)})!==-1){const err=(0,dropWhile_1.default)(errors,i=>i.field===(0,camelCase_1.default)(inputName));setOrderErrors(err),onSubmit&&onSubmit({value:values[inputName]?.value,success:!1})}values[inputName]?.value===""&&(setOrderErrors([]),onSubmit&&onSubmit({value:values[inputName]?.value,success:!1}))},[values]),(0,react_1.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=(0,has_1.default)(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||(0,isEmpty_1.default)(order)?null:(0,jsx_runtime_1.jsx)(CouponAndGiftCardFormContext_1.default.Provider,{value:{validation,codeType},children:(0,jsx_runtime_1.jsx)("form",{ref,autoComplete,onSubmit:handleSubmit,...p,children})})}exports.GiftCardOrCouponForm=GiftCardOrCouponForm,GiftCardOrCouponForm.propTypes=propTypes,exports.default=GiftCardOrCouponForm;
@@ -1,8 +1,19 @@
1
- import { FunctionComponent } from 'react';
1
+ /// <reference types="react" />
2
2
  import { BaseInputComponentProps } from '../typings/index';
3
- export declare type GiftCardOrCouponInputProps = {
3
+ import { OrderCodeType } from '../reducers/OrderReducer';
4
+ declare type Props = {
4
5
  name?: 'gift_card_or_coupon_code';
5
6
  type?: 'text';
7
+ placeholderTranslation?: (codeType: OrderCodeType) => string;
6
8
  } & Omit<BaseInputComponentProps, 'name' | 'type'> & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['textarea'];
7
- declare const GiftCardOrCouponInput: FunctionComponent<GiftCardOrCouponInputProps>;
9
+ export declare function GiftCardOrCouponInput(props: Props): JSX.Element;
10
+ export declare namespace GiftCardOrCouponInput {
11
+ var propTypes: {
12
+ children: import("prop-types").Requireable<(...args: any[]) => any>;
13
+ placeholder: import("prop-types").Requireable<string>;
14
+ disabled: import("prop-types").Requireable<boolean>;
15
+ required: import("prop-types").Requireable<boolean>;
16
+ };
17
+ var displayName: string;
18
+ }
8
19
  export default GiftCardOrCouponInput;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),components_1=(0,tslib_1.__importDefault)(require("../config/components")),BaseInput_1=(0,tslib_1.__importDefault)(require("./utils/BaseInput")),CouponAndGiftCardFormContext_1=(0,tslib_1.__importDefault)(require("../context/CouponAndGiftCardFormContext")),propTypes=components_1.default.GiftCardOrCouponInput.propTypes,displayName=components_1.default.GiftCardOrCouponInput.displayName,GiftCardOrCouponInput=props=>{const{placeholder="",required,value}=props,p=(0,tslib_1.__rest)(props,["placeholder","required","value"]),{validation}=(0,react_1.useContext)(CouponAndGiftCardFormContext_1.default);return(0,jsx_runtime_1.jsx)(BaseInput_1.default,Object.assign({type:"text",name:"gift_card_or_coupon_code",ref:validation,required:required!==void 0?required:!0,placeholder,defaultValue:value},p),void 0)};GiftCardOrCouponInput.propTypes=propTypes,GiftCardOrCouponInput.displayName=displayName,exports.default=GiftCardOrCouponInput;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponInput=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),components_1=tslib_1.__importDefault(require("../config/components")),BaseInput_1=tslib_1.__importDefault(require("./utils/BaseInput")),CouponAndGiftCardFormContext_1=tslib_1.__importDefault(require("../context/CouponAndGiftCardFormContext")),propTypes=components_1.default.GiftCardOrCouponInput.propTypes,displayName=components_1.default.GiftCardOrCouponInput.displayName;function GiftCardOrCouponInput(props){const{placeholder="",required,value,placeholderTranslation,...p}=props,{validation,codeType}=(0,react_1.useContext)(CouponAndGiftCardFormContext_1.default);let placeholderLabel=placeholder;return placeholderTranslation&&codeType&&(placeholderLabel=placeholderTranslation(codeType)),(0,jsx_runtime_1.jsx)(BaseInput_1.default,{type:"text",name:"gift_card_or_coupon_code",ref:validation,required:required!==void 0?required:!0,placeholder:placeholderLabel,defaultValue:value,...p})}exports.GiftCardOrCouponInput=GiftCardOrCouponInput,GiftCardOrCouponInput.propTypes=propTypes,GiftCardOrCouponInput.displayName=displayName,exports.default=GiftCardOrCouponInput;
@@ -1,16 +1,26 @@
1
- import { FunctionComponent, ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { FunctionChildren } from '../typings/index';
3
3
  import { CodeType, OrderCodeType } from '../reducers/OrderReducer';
4
- declare type GiftCardOrCouponRemoveButtonChildrenProps = FunctionChildren<Omit<GiftCardOrCouponRemoveButtonProps, 'children'> & {
4
+ declare type GiftCardOrCouponRemoveButtonChildrenProps = FunctionChildren<Omit<Props, 'children'> & {
5
5
  codeType?: OrderCodeType;
6
6
  hide?: boolean;
7
7
  handleClick?: () => void;
8
8
  }>;
9
- declare type GiftCardOrCouponRemoveButtonProps = {
9
+ declare type Props = {
10
10
  type?: CodeType;
11
11
  children?: GiftCardOrCouponRemoveButtonChildrenProps;
12
12
  label?: string | ReactNode;
13
- onClick?: () => void;
13
+ onClick?: (response: {
14
+ success: boolean;
15
+ }) => void;
14
16
  } & Omit<JSX.IntrinsicElements['button'], 'type'>;
15
- declare const GiftCardOrCouponRemoveButton: FunctionComponent<GiftCardOrCouponRemoveButtonProps>;
17
+ export declare function GiftCardOrCouponRemoveButton(props: Props): JSX.Element | null;
18
+ export declare namespace GiftCardOrCouponRemoveButton {
19
+ var propTypes: {
20
+ children: import("prop-types").Requireable<(...args: any[]) => any>;
21
+ type: import("prop-types").Requireable<CodeType>;
22
+ label: import("prop-types").Requireable<string | object>;
23
+ };
24
+ var displayName: string;
25
+ }
16
26
  export default GiftCardOrCouponRemoveButton;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=(0,tslib_1.__importDefault)(require("./utils/Parent")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),OrderContext_1=(0,tslib_1.__importDefault)(require("../context/OrderContext")),lodash_1=require("lodash"),propTypes=components_1.default.GiftCardOrCouponRemoveButton.propTypes,displayName=components_1.default.GiftCardOrCouponRemoveButton.displayName,GiftCardOrCouponRemoveButton=props=>{const{children,label="Remove",onClick,type}=props,p=(0,tslib_1.__rest)(props,["children","label","onClick","type"]),{order,removeGiftCardOrCouponCode}=(0,react_1.useContext)(OrderContext_1.default);let codeType=`${type}_code`;!type&&order&&(0,lodash_1.has)(order,"coupon_code")&&!(0,lodash_1.isEmpty)(order.coupon_code)?codeType="coupon_code":type||(codeType="gift_card_code");const code=order&&codeType?order[codeType]:"",hide=!(order&&code),handleClick=()=>{removeGiftCardOrCouponCode&&removeGiftCardOrCouponCode({codeType}),onClick&&onClick()},parentProps=Object.assign(Object.assign({},p),{label,handleClick,codeType});return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children}),void 0):hide?null:(0,jsx_runtime_1.jsx)("button",Object.assign({type:"button",onClick:handleClick},p,{children:label}),void 0)};GiftCardOrCouponRemoveButton.propTypes=propTypes,GiftCardOrCouponRemoveButton.displayName=displayName,exports.default=GiftCardOrCouponRemoveButton;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponRemoveButton=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("./utils/Parent")),components_1=tslib_1.__importDefault(require("../config/components")),OrderContext_1=tslib_1.__importDefault(require("../context/OrderContext")),lodash_1=require("lodash"),propTypes=components_1.default.GiftCardOrCouponRemoveButton.propTypes,displayName=components_1.default.GiftCardOrCouponRemoveButton.displayName;function GiftCardOrCouponRemoveButton(props){const{children,label="Remove",onClick,type,...p}=props,{order,removeGiftCardOrCouponCode}=(0,react_1.useContext)(OrderContext_1.default);let codeType=`${type}_code`;!type&&order&&(0,lodash_1.has)(order,"coupon_code")&&!(0,lodash_1.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?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):hide?null:(0,jsx_runtime_1.jsx)("button",{type:"button",onClick:handleClick,...p,children:label})}exports.GiftCardOrCouponRemoveButton=GiftCardOrCouponRemoveButton,GiftCardOrCouponRemoveButton.propTypes=propTypes,GiftCardOrCouponRemoveButton.displayName=displayName,exports.default=GiftCardOrCouponRemoveButton;
@@ -1,9 +1,16 @@
1
- import { FunctionComponent, ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { FunctionChildren } from '../typings/index';
3
- declare type GiftCardOrCouponSubmitChildrenProps = FunctionChildren<Omit<GiftCardOrCouponSubmitProps, 'children'>>;
4
- declare type GiftCardOrCouponSubmitProps = {
3
+ declare type GiftCardOrCouponSubmitChildrenProps = FunctionChildren<Omit<Props, 'children'>>;
4
+ declare type Props = {
5
5
  children?: GiftCardOrCouponSubmitChildrenProps;
6
6
  label?: string | ReactNode;
7
7
  } & JSX.IntrinsicElements['button'];
8
- declare const GiftCardOrCouponSubmit: FunctionComponent<GiftCardOrCouponSubmitProps>;
8
+ export declare function GiftCardOrCouponSubmit(props: Props): JSX.Element;
9
+ export declare namespace GiftCardOrCouponSubmit {
10
+ var propTypes: {
11
+ children: import("prop-types").Requireable<(...args: any[]) => any>;
12
+ label: import("prop-types").Requireable<string | object>;
13
+ };
14
+ var displayName: string;
15
+ }
9
16
  export default GiftCardOrCouponSubmit;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=(0,tslib_1.__importDefault)(require("./utils/Parent")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),propTypes=components_1.default.GiftCardOrCouponSubmit.propTypes,displayName=components_1.default.GiftCardOrCouponSubmit.displayName,GiftCardOrCouponSubmit=props=>{const{children,label="Submit"}=props,p=(0,tslib_1.__rest)(props,["children","label"]),parentProps=Object.assign(Object.assign({},p),{label});return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children}),void 0):(0,jsx_runtime_1.jsx)("button",Object.assign({type:"submit"},p,{children:label}),void 0)};GiftCardOrCouponSubmit.propTypes=propTypes,GiftCardOrCouponSubmit.displayName=displayName,exports.default=GiftCardOrCouponSubmit;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponSubmit=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=tslib_1.__importDefault(require("./utils/Parent")),components_1=tslib_1.__importDefault(require("../config/components")),propTypes=components_1.default.GiftCardOrCouponSubmit.propTypes,displayName=components_1.default.GiftCardOrCouponSubmit.displayName;function GiftCardOrCouponSubmit(props){const{children,label="Submit",...p}=props,parentProps={...p,label};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):(0,jsx_runtime_1.jsx)("button",{type:"submit",...p,children:label})}exports.GiftCardOrCouponSubmit=GiftCardOrCouponSubmit,GiftCardOrCouponSubmit.propTypes=propTypes,GiftCardOrCouponSubmit.displayName=displayName,exports.default=GiftCardOrCouponSubmit;
@@ -1,5 +1,5 @@
1
- import { FunctionComponent, ReactNode } from 'react';
2
- declare type ItemContainerProps = {
1
+ import { ReactNode } from 'react';
2
+ declare type Props = {
3
3
  children: ReactNode;
4
4
  skuCode?: string | null;
5
5
  lineItem?: {
@@ -7,5 +7,16 @@ declare type ItemContainerProps = {
7
7
  imageUrl?: string | null;
8
8
  } | null;
9
9
  };
10
- declare const ItemContainer: FunctionComponent<ItemContainerProps>;
10
+ export declare function ItemContainer(props: Props): JSX.Element;
11
+ export declare namespace ItemContainer {
12
+ var propTypes: {
13
+ children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
14
+ skuCode: import("prop-types").Requireable<string>;
15
+ lineItem: import("prop-types").Requireable<import("prop-types").InferProps<{
16
+ name: import("prop-types").Validator<string>;
17
+ imageUrl: import("prop-types").Requireable<string>;
18
+ }>>;
19
+ };
20
+ var displayName: string;
21
+ }
11
22
  export default ItemContainer;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ItemContext_1=(0,tslib_1.__importStar)(require("../context/ItemContext")),ItemReducer_1=(0,tslib_1.__importStar)(require("../reducers/ItemReducer")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),propTypes=components_1.default.ItemContainer.propTypes,displayName=components_1.default.ItemContainer.displayName,ItemContainer=props=>{const{children,skuCode,lineItem}=props,[state,dispatch]=(0,react_1.useReducer)(ItemReducer_1.default,ItemReducer_1.itemInitialState);(0,react_1.useEffect)(()=>{skuCode&&(0,ItemReducer_1.setItemState)(skuCode,{type:"setSkuCode",key:"skuCode"},dispatch),lineItem&&(0,ItemReducer_1.setItemState)(lineItem,{type:"setCustomLineItem",key:"lineItem"},dispatch)},[]);const setItems=items=>(0,ItemReducer_1.setItemState)(items,{type:"setItems",key:"items"},dispatch),setItem=item=>(0,ItemReducer_1.setItemState)(item,{type:"setItem",key:"item"},dispatch),setQuantity=item=>(0,ItemReducer_1.setItemState)(item,{type:"setQuantity",key:"quantity"},dispatch),setOption=item=>(0,ItemReducer_1.setItemState)(item,{type:"setOption",key:"option"},dispatch),setPrices=item=>(0,ItemReducer_1.setItemState)(item,{type:"setPrices",key:"prices"},dispatch),setCustomLineItems=item=>(0,ItemReducer_1.setItemState)(item,{type:"setCustomLineItems",key:"lineItems"},dispatch),itemValue=Object.assign(Object.assign(Object.assign({},ItemContext_1.initialItemContext),state),{setItems,setItem,setQuantity,setOption,setPrices,setCustomLineItems});return(0,jsx_runtime_1.jsx)(ItemContext_1.default.Provider,Object.assign({value:itemValue},{children}),void 0)};ItemContainer.propTypes=propTypes,ItemContainer.displayName=displayName,exports.default=ItemContainer;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ItemContainer=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ItemContext_1=tslib_1.__importStar(require("../context/ItemContext")),ItemReducer_1=tslib_1.__importStar(require("../reducers/ItemReducer")),components_1=tslib_1.__importDefault(require("../config/components")),propTypes=components_1.default.ItemContainer.propTypes,displayName=components_1.default.ItemContainer.displayName;function ItemContainer(props){const{children,skuCode,lineItem}=props,[state,dispatch]=(0,react_1.useReducer)(ItemReducer_1.default,ItemReducer_1.itemInitialState);(0,react_1.useEffect)(()=>{const code=skuCode;code&&(0,ItemReducer_1.setItemState)(code,{type:"setSkuCode",key:"skuCode"},dispatch),lineItem&&(0,ItemReducer_1.setItemState)(lineItem,{type:"setCustomLineItem",key:"lineItem"},dispatch)},[]);const setItems=items=>(0,ItemReducer_1.setItemState)(items,{type:"setItems",key:"items"},dispatch),setItem=item=>(0,ItemReducer_1.setItemState)(item,{type:"setItem",key:"item"},dispatch),setQuantity=item=>(0,ItemReducer_1.setItemState)(item,{type:"setQuantity",key:"quantity"},dispatch),setOption=item=>(0,ItemReducer_1.setItemState)(item,{type:"setOption",key:"option"},dispatch),setPrices=item=>(0,ItemReducer_1.setItemState)(item,{type:"setPrices",key:"prices"},dispatch),setCustomLineItems=item=>(0,ItemReducer_1.setItemState)(item,{type:"setCustomLineItems",key:"lineItems"},dispatch),setSkuCode=code=>(0,ItemReducer_1.setItemState)(code,{type:"setSkuCode",key:"skuCode"},dispatch),itemValue={...ItemContext_1.initialItemContext,...state,setItems,setItem,setQuantity,setOption,setPrices,setCustomLineItems,setSkuCode};return(0,jsx_runtime_1.jsx)(ItemContext_1.default.Provider,{value:itemValue,children})}exports.ItemContainer=ItemContainer,ItemContainer.propTypes=propTypes,ItemContainer.displayName=displayName,exports.default=ItemContainer;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { PaymentMethodConfig } from '../reducers/PaymentMethodReducer';
3
+ import { PaymentSourceProps } from './PaymentSource';
4
+ declare type KlarnaPaymentProps = PaymentMethodConfig['klarnaPayment'] & JSX.IntrinsicElements['div'] & Partial<PaymentSourceProps['templateCustomerSaveToWallet']> & {
5
+ show?: boolean;
6
+ clientToken: string;
7
+ locale?: string;
8
+ };
9
+ export default function KlarnaPayment({ clientToken, placeOrderCallback, locale, ...p }: KlarnaPaymentProps): JSX.Element;
10
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),PaymentMethodContext_1=tslib_1.__importDefault(require("../context/PaymentMethodContext")),OrderContext_1=tslib_1.__importDefault(require("../context/OrderContext")),useExternalScript_1=tslib_1.__importDefault(require("../utils/hooks/useExternalScript")),PlaceOrderContext_1=tslib_1.__importDefault(require("../context/PlaceOrderContext"));function typeOfLine(lineItemType){switch(lineItemType){case"payment_methods":default:return null;case"percentage_discount_promotions":return"discount";case"shipments":return"shipping_fee";case"skus":return"physical"}}function klarnaOrderLines(lineItems){return lineItems?lineItems.map(item=>{const type=item.item_type?typeOfLine(item.item_type):null;return{name:item.name,quantity:item.quantity,total_amount:item.total_amount_cents,unit_price:item.unit_amount_cents,type}}):[]}function KlarnaPayment({clientToken,placeOrderCallback,locale="EN",...p}){const ref=(0,react_1.useRef)(null),{paymentSource,currentPaymentMethodType,setPaymentRef,setPaymentSource,setPaymentMethodErrors}=(0,react_1.useContext)(PaymentMethodContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),{setPlaceOrder}=(0,react_1.useContext)(PlaceOrderContext_1.default),loaded=(0,useExternalScript_1.default)("https://x.klarnacdn.net/kp/lib/v1/api.js"),[klarna,setKlarna]=(0,react_1.useState)(),{containerClassName,...divProps}=p;(0,react_1.useEffect)(()=>{loaded&&window?.Klarna!==void 0&&setKlarna(window.Klarna)},[loaded,window.Klarna]),(0,react_1.useEffect)(()=>(ref.current&&paymentSource&&currentPaymentMethodType&&loaded&&klarna&&(ref.current.onsubmit=()=>handleClick(klarna),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,paymentSource,currentPaymentMethodType,loaded,klarna]);const handleClick=async kl=>{const[first]=paymentSource?.payment_methods||void 0,payment_method_category=first?.identifier,billing_address={given_name:order?.billing_address?.first_name,family_name:order?.billing_address?.last_name,email:order?.customer_email,street_address:order?.billing_address?.line_1,street_address2:null,organization_name:null,postal_code:order?.billing_address?.zip_code,city:order?.billing_address?.city,region:order?.billing_address?.state_code,phone:order?.billing_address?.phone,country:order?.billing_address?.country_code},shipping_address={given_name:order?.shipping_address?.first_name,family_name:order?.shipping_address?.last_name,email:order?.customer_email,street_address:order?.shipping_address?.line_1,street_address2:null,postal_code:order?.shipping_address?.zip_code,organization_name:null,city:order?.shipping_address?.city,region:order?.shipping_address?.state_code,phone:order?.shipping_address?.phone,country:order?.shipping_address?.country_code},klarnaData={merchant_data:order?.id,purchase_country:order?.country_code,purchase_currency:order?.currency_code,locale,shipping_address,billing_address,order_amount:order?.total_amount_cents,order_lines:klarnaOrderLines(order?.line_items)};try{kl.Payments.load({container:"#klarna-payments-container",payment_method_category},{billing_address,shipping_address},async function({show_form}){if(show_form)try{await kl.Payments.authorize({payment_method_category},klarnaData,async function(res){if(res.approved&&paymentSource&&currentPaymentMethodType){const ps=await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{auth_token:res.authorization_token}}),{placed}=setPlaceOrder&&ps&&await setPlaceOrder({paymentSource:ps})||{placed:!1};placed&&placeOrderCallback&&placeOrderCallback({placed})}})}catch(e){console.error("e",e),setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:"Authorization error"}])}})}catch(e){console.error("Load Klarna libray",e)}};if(klarna&&clientToken){const[first]=paymentSource?.payment_methods||void 0;klarna.Payments.init({client_token:clientToken}),klarna.Payments.load({container:"#klarna-payments-container",payment_method_category:first?.identifier},{billing_address:{given_name:order?.billing_address?.first_name,family_name:order?.billing_address?.last_name,email:order?.customer_email,street_address:order?.billing_address?.line_1,street_address2:order?.billing_address?.line_2,postal_code:order?.billing_address?.zip_code,city:order?.billing_address?.city,region:order?.billing_address?.state_code,phone:order?.billing_address?.phone,country:order?.billing_address?.country_code},shipping_address:{given_name:order?.shipping_address?.first_name,family_name:order?.shipping_address?.last_name,street_address:order?.shipping_address?.line_1,street_address2:order?.shipping_address?.line_2,postal_code:order?.shipping_address?.zip_code,city:order?.shipping_address?.city,region:order?.shipping_address?.state_code,phone:order?.shipping_address?.phone,country:order?.shipping_address?.country_code}})}return(0,jsx_runtime_1.jsx)("form",{ref,children:(0,jsx_runtime_1.jsx)("div",{className:containerClassName,...divProps,children:(0,jsx_runtime_1.jsx)("div",{id:"klarna-payments-container"})})})}exports.default=KlarnaPayment;
@@ -1,8 +1,15 @@
1
- import { FunctionComponent, ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { LineItemType } from '../typings/index';
3
- declare type LineItemProps = {
3
+ declare type Props = {
4
4
  children: ReactNode;
5
5
  type?: LineItemType;
6
6
  };
7
- declare const LineItem: FunctionComponent<LineItemProps>;
7
+ export declare function LineItem(props: Props): JSX.Element;
8
+ export declare namespace LineItem {
9
+ var propTypes: {
10
+ children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
11
+ type: import("prop-types").Requireable<LineItemType>;
12
+ };
13
+ var displayName: string;
14
+ }
8
15
  export default LineItem;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemContext_1=(0,tslib_1.__importDefault)(require("../context/LineItemContext")),LineItemChildrenContext_1=(0,tslib_1.__importDefault)(require("../context/LineItemChildrenContext")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),ShipmentChildrenContext_1=(0,tslib_1.__importDefault)(require("../context/ShipmentChildrenContext")),lodash_1=require("lodash"),propTypes=components_1.default.LineItem.propTypes,displayName=components_1.default.LineItem.displayName,LineItem=props=>{const{type="skus",children}=props,{lineItems}=(0,react_1.useContext)(LineItemContext_1.default),{lineItems:shipmentLineItems}=(0,react_1.useContext)(ShipmentChildrenContext_1.default),items=(0,lodash_1.isEmpty)(shipmentLineItems)?lineItems:shipmentLineItems,components=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)return null;const lineProps={lineItem};return(0,jsx_runtime_1.jsx)(LineItemChildrenContext_1.default.Provider,Object.assign({value:lineProps},{children}),k)});return(0,jsx_runtime_1.jsx)(react_1.Fragment,{children:components},void 0)};LineItem.propTypes=propTypes,LineItem.displayName=displayName,exports.default=LineItem;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItem=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemContext_1=tslib_1.__importDefault(require("../context/LineItemContext")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../context/LineItemChildrenContext")),components_1=tslib_1.__importDefault(require("../config/components")),ShipmentChildrenContext_1=tslib_1.__importDefault(require("../context/ShipmentChildrenContext")),propTypes=components_1.default.LineItem.propTypes,displayName=components_1.default.LineItem.displayName;function LineItem(props){const{type="skus",children}=props,{lineItems}=(0,react_1.useContext)(LineItemContext_1.default),{lineItems:shipmentLineItems}=(0,react_1.useContext)(ShipmentChildrenContext_1.default),items=shipmentLineItems&&shipmentLineItems?.length>0?shipmentLineItems:lineItems,components=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(0,jsx_runtime_1.jsx)(LineItemChildrenContext_1.default.Provider,{value:lineProps,children},k)});return(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:components})}exports.LineItem=LineItem,LineItem.propTypes=propTypes,LineItem.displayName=displayName,exports.default=LineItem;
@@ -1,7 +1,20 @@
1
- import { FunctionComponent } from 'react';
1
+ /// <reference types="react" />
2
2
  import { BaseAmountComponent, BasePriceType } from '../typings/index';
3
- export declare type LineItemAmountProps = BaseAmountComponent & {
3
+ declare type Props = BaseAmountComponent & {
4
4
  type?: BasePriceType;
5
5
  };
6
- declare const LineItemAmount: FunctionComponent<LineItemAmountProps>;
6
+ export declare function LineItemAmount(props: Props): JSX.Element;
7
+ export declare namespace LineItemAmount {
8
+ var propTypes: {
9
+ type: import("prop-types").Requireable<BasePriceType>;
10
+ id: import("prop-types").Requireable<string>;
11
+ className: import("prop-types").Requireable<string>;
12
+ style: import("prop-types").Requireable<object>;
13
+ name: import("prop-types").Requireable<string>;
14
+ children: import("prop-types").Requireable<(...args: any[]) => any>;
15
+ format: import("prop-types").Requireable<import("../typings/index").BaseFormatPrice>;
16
+ };
17
+ var defaultProps: Props;
18
+ var displayName: string;
19
+ }
7
20
  export default LineItemAmount;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),getAmount_1=(0,tslib_1.__importDefault)(require("../utils/getAmount")),LineItemChildrenContext_1=(0,tslib_1.__importDefault)(require("../context/LineItemChildrenContext")),Parent_1=(0,tslib_1.__importDefault)(require("./utils/Parent")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),propTypes=components_1.default.LineItemAmount.propTypes,defaultProps=components_1.default.LineItemAmount.defaultProps,displayName=components_1.default.LineItemAmount.displayName,LineItemAmount=props=>{const{format="formatted",type="total"}=props,p=(0,tslib_1.__rest)(props,["format","type"]),{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),[price,setPrice]=(0,react_1.useState)("");(0,react_1.useEffect)(()=>{if(lineItem){const p2=(0,getAmount_1.default)({base:"amount",type,format,obj:lineItem});setPrice(p2)}return()=>{setPrice("")}},[lineItem]);const parentProps=Object.assign({price},p);return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children}),void 0):(0,jsx_runtime_1.jsx)("span",Object.assign({},p,{children:price}),void 0)};LineItemAmount.propTypes=propTypes,LineItemAmount.defaultProps=defaultProps,LineItemAmount.displayName=displayName,exports.default=LineItemAmount;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemAmount=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),getAmount_1=tslib_1.__importDefault(require("../utils/getAmount")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../context/LineItemChildrenContext")),Parent_1=tslib_1.__importDefault(require("./utils/Parent")),components_1=tslib_1.__importDefault(require("../config/components")),propTypes=components_1.default.LineItemAmount.propTypes,defaultProps=components_1.default.LineItemAmount.defaultProps,displayName=components_1.default.LineItemAmount.displayName;function LineItemAmount(props){const{format="formatted",type="total",...p}=props,{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),[price,setPrice]=(0,react_1.useState)("");(0,react_1.useEffect)(()=>{if(lineItem){const p2=(0,getAmount_1.default)({base:"amount",type,format,obj:lineItem});setPrice(p2)}return()=>{setPrice("")}},[lineItem]);const parentProps={price,...p};return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):(0,jsx_runtime_1.jsx)("span",{...p,children:price})}exports.LineItemAmount=LineItemAmount,LineItemAmount.propTypes=propTypes,LineItemAmount.defaultProps=defaultProps,LineItemAmount.displayName=displayName,exports.default=LineItemAmount;
@@ -1,12 +1,18 @@
1
- import { FunctionComponent, ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { LineItem } from '@commercelayer/sdk';
3
- export declare type LineItemCodeType = Omit<LineItemNameProps, 'children'> & {
3
+ export declare type LineItemCodeType = Omit<Props, 'children'> & {
4
4
  lineItem: LineItem;
5
5
  skuCode: string;
6
6
  };
7
- declare type LineItemNameProps = {
7
+ declare type Props = {
8
8
  children?: (props: LineItemCodeType) => ReactNode;
9
9
  type?: 'sku_code' | 'bundle_code';
10
10
  } & JSX.IntrinsicElements['p'];
11
- declare const LineItemCode: FunctionComponent<LineItemNameProps>;
11
+ export declare function LineItemCode({ type, children, ...p }: Props): JSX.Element;
12
+ export declare namespace LineItemCode {
13
+ var propTypes: {
14
+ children: import("prop-types").Requireable<(...args: any[]) => any>;
15
+ };
16
+ var displayName: string;
17
+ }
12
18
  export default LineItemCode;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemChildrenContext_1=(0,tslib_1.__importDefault)(require("../context/LineItemChildrenContext")),Parent_1=(0,tslib_1.__importDefault)(require("./utils/Parent")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),propTypes=components_1.default.LineItemCode.propTypes,displayName=components_1.default.LineItemCode.displayName,LineItemCode=_a=>{var{type="sku_code",children}=_a,p=(0,tslib_1.__rest)(_a,["type","children"]);const{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),labelName=lineItem==null?void 0:lineItem[type],parentProps=Object.assign({lineItem,skuCode:labelName},p);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children}),void 0):(0,jsx_runtime_1.jsx)("p",Object.assign({},p,{children:labelName}),void 0)};LineItemCode.propTypes=propTypes,LineItemCode.displayName=displayName,exports.default=LineItemCode;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemCode=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemChildrenContext_1=tslib_1.__importDefault(require("../context/LineItemChildrenContext")),Parent_1=tslib_1.__importDefault(require("./utils/Parent")),components_1=tslib_1.__importDefault(require("../config/components")),propTypes=components_1.default.LineItemCode.propTypes,displayName=components_1.default.LineItemCode.displayName;function LineItemCode({type="sku_code",children,...p}){const{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),labelName=lineItem?.[type],parentProps={lineItem,skuCode:labelName,...p};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):(0,jsx_runtime_1.jsx)("p",{...p,children:labelName})}exports.LineItemCode=LineItemCode,LineItemCode.propTypes=propTypes,LineItemCode.displayName=displayName,exports.default=LineItemCode;
@@ -1,16 +1,23 @@
1
- import { FunctionComponent, ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { LineItem } from '@commercelayer/sdk';
3
3
  import { LineItemType } from '../typings/index';
4
- export declare type LineItemImageType = Omit<LineItemImageProps, 'children'> & {
4
+ export declare type LineItemImageType = Omit<Props, 'children'> & {
5
5
  src: string;
6
6
  lineItem: LineItem;
7
7
  };
8
- declare type LineItemImageProps = {
8
+ declare type Props = {
9
9
  children?: (props: LineItemImageType) => ReactNode;
10
10
  width?: number;
11
11
  placeholder?: {
12
12
  [K in LineItemType]?: string;
13
13
  };
14
14
  } & Omit<JSX.IntrinsicElements['img'], 'src' | 'srcSet' | 'placeholder'>;
15
- declare const LineItemImage: FunctionComponent<LineItemImageProps>;
15
+ export declare function LineItemImage(props: Props): JSX.Element | null;
16
+ export declare namespace LineItemImage {
17
+ var propTypes: {
18
+ width: import("prop-types").Requireable<number>;
19
+ children: import("prop-types").Requireable<(...args: any[]) => any>;
20
+ };
21
+ var displayName: string;
22
+ }
16
23
  export default LineItemImage;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=(0,tslib_1.__importDefault)(require("./utils/Parent")),LineItemChildrenContext_1=(0,tslib_1.__importDefault)(require("../context/LineItemChildrenContext")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),defaultImgUrl="https://data.commercelayer.app/assets/images/placeholders/img_placeholder.svg",defaultGiftCardImgUrl="https://data.commercelayer.app/assets/images/placeholders/gift_placeholder.svg",propTypes=components_1.default.LineItemImage.propTypes,displayName=components_1.default.LineItemImage.displayName,LineItemImage=props=>{const{placeholder,children}=props,p=(0,tslib_1.__rest)(props,["placeholder","children"]),{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),itemType=lineItem==null?void 0:lineItem.item_type;let src=lineItem==null?void 0:lineItem.image_url;src||((placeholder==null?void 0:placeholder[itemType])?src=placeholder==null?void 0:placeholder[itemType]:src=itemType==="gift_cards"?defaultGiftCardImgUrl:defaultImgUrl);const parenProps=Object.assign({lineItem,src,placeholder},p);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parenProps,{children}),void 0):src?(0,jsx_runtime_1.jsx)("img",Object.assign({alt:"",src},p),void 0):null};LineItemImage.propTypes=propTypes,LineItemImage.displayName=displayName,exports.default=LineItemImage;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemImage=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("./utils/Parent")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../context/LineItemChildrenContext")),components_1=tslib_1.__importDefault(require("../config/components")),placeholderImages_1=require("../utils/placeholderImages"),propTypes=components_1.default.LineItemImage.propTypes,displayName=components_1.default.LineItemImage.displayName;function LineItemImage(props){const{placeholder,children,...p}=props,{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),itemType=lineItem?.item_type;let src=lineItem?.image_url;src||(placeholder?.[itemType]?src=placeholder?.[itemType]:src=itemType==="gift_cards"?placeholderImages_1.defaultGiftCardImgUrl:placeholderImages_1.defaultImgUrl);const parenProps={lineItem,src,placeholder,...p};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parenProps,children}):src?(0,jsx_runtime_1.jsx)("img",{alt:"",src,...p}):null}exports.LineItemImage=LineItemImage,LineItemImage.propTypes=propTypes,LineItemImage.displayName=displayName,exports.default=LineItemImage;
@@ -1,11 +1,17 @@
1
- import { FunctionComponent, ReactNode } from 'react';
2
- import { LineItem } from '@commercelayer/sdk';
3
- export declare type LineItemNameType = Omit<LineItemNameProps, 'children'> & {
1
+ import { ReactNode } from 'react';
2
+ import type { LineItem } from '@commercelayer/sdk';
3
+ export declare type LineItemNameType = Omit<Props, 'children'> & {
4
4
  label: string;
5
5
  lineItem: LineItem;
6
6
  };
7
- declare type LineItemNameProps = {
7
+ declare type Props = {
8
8
  children?: (props: LineItemNameType) => ReactNode;
9
9
  } & JSX.IntrinsicElements['p'];
10
- declare const LineItemName: FunctionComponent<LineItemNameProps>;
10
+ export declare function LineItemName(props: Props): JSX.Element;
11
+ export declare namespace LineItemName {
12
+ var propTypes: {
13
+ children: import("prop-types").Requireable<(...args: any[]) => any>;
14
+ };
15
+ var displayName: string;
16
+ }
11
17
  export default LineItemName;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemChildrenContext_1=(0,tslib_1.__importDefault)(require("../context/LineItemChildrenContext")),Parent_1=(0,tslib_1.__importDefault)(require("./utils/Parent")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),propTypes=components_1.default.LineItemName.propTypes,displayName=components_1.default.LineItemName.displayName,LineItemName=props=>{const{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),label=lineItem==null?void 0:lineItem.name,parentProps=Object.assign({label,lineItem},props);return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children}),void 0):(0,jsx_runtime_1.jsx)("p",Object.assign({},props,{children:label}),void 0)};LineItemName.propTypes=propTypes,LineItemName.displayName=displayName,exports.default=LineItemName;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemName=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemChildrenContext_1=tslib_1.__importDefault(require("../context/LineItemChildrenContext")),Parent_1=tslib_1.__importDefault(require("./utils/Parent")),components_1=tslib_1.__importDefault(require("../config/components")),propTypes=components_1.default.LineItemName.propTypes,displayName=components_1.default.LineItemName.displayName;function LineItemName(props){const{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),label=lineItem?.name,parentProps={label,lineItem,...props};return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):(0,jsx_runtime_1.jsx)("p",{...props,children:label})}exports.LineItemName=LineItemName,LineItemName.propTypes=propTypes,LineItemName.displayName=displayName,exports.default=LineItemName;
@@ -1,10 +1,10 @@
1
- import { FunctionComponent, CSSProperties } from 'react';
1
+ import { CSSProperties } from 'react';
2
2
  import { LineItemOption as LineItemOptionType } from '@commercelayer/sdk';
3
3
  import { FunctionChildren } from '../typings/index';
4
- declare type LineItemOptionChildrenProps = FunctionChildren<Omit<LineItemOptionProps, 'children'> & {
4
+ declare type LineItemOptionChildrenProps = FunctionChildren<Omit<Props, 'children'> & {
5
5
  lineItemOption: LineItemOptionType;
6
6
  }>;
7
- declare type LineItemOptionProps = {
7
+ declare type Props = {
8
8
  id?: string;
9
9
  className?: string;
10
10
  key?: string;
@@ -15,5 +15,16 @@ declare type LineItemOptionProps = {
15
15
  tagElement?: keyof JSX.IntrinsicElements;
16
16
  tagContainer?: keyof JSX.IntrinsicElements;
17
17
  };
18
- declare const LineItemOption: FunctionComponent<LineItemOptionProps>;
18
+ export declare function LineItemOption(props: Props): JSX.Element;
19
+ export declare namespace LineItemOption {
20
+ var propTypes: {
21
+ name: import("prop-types").Requireable<string>;
22
+ children: import("prop-types").Requireable<(...args: any[]) => any>;
23
+ valueClassName: import("prop-types").Requireable<string>;
24
+ className: import("prop-types").Requireable<string>;
25
+ id: import("prop-types").Requireable<string>;
26
+ style: import("prop-types").Requireable<object>;
27
+ };
28
+ var displayName: string;
29
+ }
19
30
  export default LineItemOption;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemOptionChildrenContext_1=(0,tslib_1.__importDefault)(require("../context/LineItemOptionChildrenContext")),get_1=(0,tslib_1.__importDefault)(require("lodash/get")),has_1=(0,tslib_1.__importDefault)(require("lodash/has")),map_1=(0,tslib_1.__importDefault)(require("lodash/map")),Parent_1=(0,tslib_1.__importDefault)(require("./utils/Parent")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),isJSON_1=(0,tslib_1.__importDefault)(require("../utils/isJSON")),propTypes=components_1.default.LineItemOption.propTypes,displayName=components_1.default.LineItemOption.displayName,LineItemOption=props=>{const{name,children,valueClassName,id,key,tagElement="li",tagContainer="ul"}=props,p=(0,tslib_1.__rest)(props,["name","children","valueClassName","id","key","tagElement","tagContainer"]),{lineItemOption,showAll}=(0,react_1.useContext)(LineItemOptionChildrenContext_1.default),parentProps=Object.assign(Object.assign({},props),{lineItemOption}),TagElement=tagElement,TagContainer=tagContainer,components=showAll&&(0,isJSON_1.default)(JSON.stringify(lineItemOption==null?void 0:lineItemOption.options))?(0,map_1.default)(lineItemOption==null?void 0:lineItemOption.options,(value,key2)=>(0,jsx_runtime_1.jsxs)(TagElement,Object.assign({},p,{children:[`${key2}:`,(0,jsx_runtime_1.jsx)("span",Object.assign({className:valueClassName},{children:`${value}`}),void 0)]}),key2)):(0,has_1.default)(lineItemOption,`options.${name}`)?(0,jsx_runtime_1.jsxs)(TagElement,Object.assign({},p,{children:[`${name}:`,(0,jsx_runtime_1.jsx)("span",Object.assign({className:valueClassName},p,{children:`${(0,get_1.default)(lineItemOption,`options.${name}`)}`}),void 0)]}),key):null;return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children}),void 0):(0,jsx_runtime_1.jsx)(TagContainer,{children:components},void 0)};LineItemOption.propTypes=propTypes,LineItemOption.displayName=displayName,exports.default=LineItemOption;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemOption=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemOptionChildrenContext_1=tslib_1.__importDefault(require("../context/LineItemOptionChildrenContext")),get_1=tslib_1.__importDefault(require("lodash/get")),has_1=tslib_1.__importDefault(require("lodash/has")),map_1=tslib_1.__importDefault(require("lodash/map")),Parent_1=tslib_1.__importDefault(require("./utils/Parent")),components_1=tslib_1.__importDefault(require("../config/components")),isJSON_1=tslib_1.__importDefault(require("../utils/isJSON")),propTypes=components_1.default.LineItemOption.propTypes,displayName=components_1.default.LineItemOption.displayName;function LineItemOption(props){const{name,children,valueClassName,key,tagElement="li",tagContainer="ul",...p}=props,{lineItemOption,showAll}=(0,react_1.useContext)(LineItemOptionChildrenContext_1.default),parentProps={...props,lineItemOption},TagElement=tagElement,TagContainer=tagContainer,components=showAll&&(0,isJSON_1.default)(JSON.stringify(lineItemOption?.options))?(0,map_1.default)(lineItemOption?.options,(value,key2)=>(0,jsx_runtime_1.jsxs)(TagElement,{...p,children:[`${key2}:`,(0,jsx_runtime_1.jsx)("span",{className:valueClassName,children:`${value}`})]},key2)):(0,has_1.default)(lineItemOption,`options.${name}`)?(0,jsx_runtime_1.jsxs)(TagElement,{...p,children:[`${name}:`,(0,jsx_runtime_1.jsx)("span",{className:valueClassName,...p,children:`${(0,get_1.default)(lineItemOption,`options.${name}`)}`})]},key):null;return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):(0,jsx_runtime_1.jsx)(TagContainer,{children:components})}exports.LineItemOption=LineItemOption,LineItemOption.propTypes=propTypes,LineItemOption.displayName=displayName,exports.default=LineItemOption;
@@ -1,8 +1,10 @@
1
- import { FunctionComponent, ReactNode } from 'react';
2
- export declare type LineItemOptionsProps = JSX.IntrinsicElements['span'] & {
1
+ import { ReactNode } from 'react';
2
+ declare type Props = JSX.IntrinsicElements['div'] & {
3
3
  children: ReactNode;
4
4
  title?: string;
5
5
  showName?: boolean;
6
+ titleTagElement?: keyof JSX.IntrinsicElements;
7
+ titleClassName?: string;
6
8
  } & ({
7
9
  skuOptionId: string;
8
10
  showAll?: never;
@@ -10,5 +12,8 @@ export declare type LineItemOptionsProps = JSX.IntrinsicElements['span'] & {
10
12
  skuOptionId?: never;
11
13
  showAll: true;
12
14
  });
13
- declare const LineItemOptions: FunctionComponent<LineItemOptionsProps>;
15
+ export declare function LineItemOptions(props: Props): JSX.Element;
16
+ export declare namespace LineItemOptions {
17
+ var displayName: string;
18
+ }
14
19
  export default LineItemOptions;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemChildrenContext_1=(0,tslib_1.__importDefault)(require("../context/LineItemChildrenContext")),LineItemOptionChildrenContext_1=(0,tslib_1.__importDefault)(require("../context/LineItemOptionChildrenContext")),lodash_1=require("lodash"),components_1=(0,tslib_1.__importDefault)(require("../config/components")),displayName=components_1.default.LineItemOptions.displayName,LineItemOptions=props=>{const{skuOptionId,title,children,showName=!0,showAll}=props,p=(0,tslib_1.__rest)(props,["skuOptionId","title","children","showName","showAll"]),{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),options=((0,lodash_1.isEmpty)(lineItem)?[]:(lineItem==null?void 0:lineItem.line_item_options)||[]).filter(o=>showAll?!0:o.skuOption().id===skuOptionId).map((o,k)=>{const showTitle=showName?(0,jsx_runtime_1.jsx)("span",Object.assign({},p,{children:title||o.name}),void 0):null,valueProps={lineItemOption:o,showAll};return(0,jsx_runtime_1.jsxs)(react_1.Fragment,{children:[showTitle,(0,jsx_runtime_1.jsx)(LineItemOptionChildrenContext_1.default.Provider,Object.assign({value:valueProps},{children}),void 0)]},k)});return(0,jsx_runtime_1.jsx)(react_1.Fragment,{children:options},void 0)};LineItemOptions.displayName=displayName,exports.default=LineItemOptions;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemOptions=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemChildrenContext_1=tslib_1.__importDefault(require("../context/LineItemChildrenContext")),LineItemOptionChildrenContext_1=tslib_1.__importDefault(require("../context/LineItemOptionChildrenContext")),lodash_1=require("lodash"),components_1=tslib_1.__importDefault(require("../config/components")),displayName=components_1.default.LineItemOptions.displayName;function LineItemOptions(props){const{skuOptionId,title,children,showName=!0,showAll,className,titleTagElement="h6",titleClassName,...p}=props,{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),lineItemOptions=(0,lodash_1.isEmpty)(lineItem)?[]:lineItem?.line_item_options||[],TitleTagElement=titleTagElement,options=lineItemOptions.filter(o=>showAll?!0:o.skuOption().id===skuOptionId).map((o,k)=>{const showTitle=showName?(0,jsx_runtime_1.jsx)(TitleTagElement,{className:titleClassName,children:title||o.name}):null,valueProps={lineItemOption:o,showAll};return(0,jsx_runtime_1.jsxs)("div",{className,...p,children:[showTitle,(0,jsx_runtime_1.jsx)(LineItemOptionChildrenContext_1.default.Provider,{value:valueProps,children})]},k)});return(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:options})}exports.LineItemOptions=LineItemOptions,LineItemOptions.displayName=displayName,exports.default=LineItemOptions;