@lookiero/checkout 9.13.0 → 10.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/dist/fake-dependencies/@lookiero/payments-front/index.d.ts +8 -6
  2. package/dist/fake-dependencies/@lookiero/payments-front/index.js +7 -4
  3. package/dist/index.d.ts +3 -3
  4. package/dist/index.js +1 -2
  5. package/dist/pact.config.d.ts +21 -0
  6. package/dist/pact.config.js +16 -0
  7. package/dist/public/public/assets/adaptive-icon.png +0 -0
  8. package/dist/public/public/assets/favicon.png +0 -0
  9. package/dist/public/public/assets/icon.png +0 -0
  10. package/dist/public/public/assets/splash.png +0 -0
  11. package/dist/public/public/images/not-found.png +0 -0
  12. package/dist/src/ExpoRoot.js +19 -15
  13. package/dist/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.d.ts +1 -1
  14. package/dist/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.js +2 -0
  15. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +1 -0
  16. package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +55 -0
  17. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +1 -0
  18. package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +116 -0
  19. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +1 -0
  20. package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +56 -0
  21. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +1 -0
  22. package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +51 -0
  23. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +1 -0
  24. package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +51 -0
  25. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +1 -0
  26. package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +51 -0
  27. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +13 -0
  28. package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +19 -0
  29. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +1 -0
  30. package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +56 -0
  31. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +1 -0
  32. package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +57 -0
  33. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +1 -0
  34. package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +55 -0
  35. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +1 -0
  36. package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +120 -0
  37. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +1 -0
  38. package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +55 -0
  39. package/dist/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.d.ts +1 -1
  40. package/dist/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.js +2 -1
  41. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +1 -0
  42. package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +55 -0
  43. package/dist/src/infrastructure/tracking/tracking.d.ts +2 -2
  44. package/dist/src/infrastructure/tracking/useTrackCheckout.d.ts +10 -17
  45. package/dist/src/infrastructure/tracking/useTrackCheckout.js +27 -12
  46. package/dist/src/infrastructure/ui/Root.d.ts +6 -6
  47. package/dist/src/infrastructure/ui/Root.js +2 -3
  48. package/dist/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.js +1 -2
  49. package/dist/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.style.js +2 -3
  50. package/dist/src/infrastructure/ui/components/atoms/price/Price.js +0 -3
  51. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +22 -0
  52. package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +1 -0
  53. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +7 -0
  54. package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +5 -0
  55. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +7 -0
  56. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +6 -0
  57. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +4 -0
  58. package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +20 -0
  59. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +4 -0
  60. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +43 -0
  61. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +12 -0
  62. package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +14 -0
  63. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.js +3 -7
  64. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.d.ts +2 -18
  65. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.js +2 -14
  66. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.js +1 -2
  67. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.js +1 -2
  68. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.js +3 -4
  69. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.d.ts +1 -0
  70. package/dist/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.js +1 -0
  71. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +3 -3
  72. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +2 -3
  73. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +4 -4
  74. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +2 -3
  75. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +2 -3
  76. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +1 -2
  77. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +4 -5
  78. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +6 -6
  79. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +3 -4
  80. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.d.ts +1 -0
  81. package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.js +1 -0
  82. package/dist/src/infrastructure/ui/components/templates/footer/Footer.d.ts +3 -0
  83. package/dist/src/infrastructure/ui/components/templates/footer/Footer.js +13 -0
  84. package/dist/src/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.js +2 -2
  85. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +7 -0
  86. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +21 -0
  87. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +8 -0
  88. package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +12 -0
  89. package/dist/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.js +2 -2
  90. package/dist/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.js +4 -4
  91. package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.d.ts +26 -0
  92. package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.js +135 -0
  93. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +12 -0
  94. package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +64 -0
  95. package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.d.ts +3 -2
  96. package/dist/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.js +17 -26
  97. package/dist/src/infrastructure/ui/hooks/useStaticInfo.d.ts +2 -0
  98. package/dist/src/infrastructure/ui/hooks/useStaticInfo.js +2 -2
  99. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.d.ts +1 -1
  100. package/dist/src/infrastructure/ui/hooks/useSubmitCheckout.js +22 -55
  101. package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +10 -0
  102. package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +17 -0
  103. package/dist/src/infrastructure/ui/i18n/i18n.d.ts +2 -2
  104. package/dist/src/infrastructure/ui/i18n/i18n.js +2 -2
  105. package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +20 -0
  106. package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +27 -0
  107. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +10 -0
  108. package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +27 -0
  109. package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.js +3 -14
  110. package/dist/src/infrastructure/ui/routing/Routing.d.ts +5 -5
  111. package/dist/src/infrastructure/ui/routing/Routing.js +8 -18
  112. package/dist/src/infrastructure/ui/routing/routes.d.ts +0 -1
  113. package/dist/src/infrastructure/ui/routing/routes.js +0 -1
  114. package/dist/src/infrastructure/ui/test/render.js +3 -7
  115. package/dist/src/infrastructure/ui/views/App.js +5 -7
  116. package/dist/src/infrastructure/ui/views/App.style.d.ts +6 -0
  117. package/dist/src/infrastructure/ui/views/App.style.js +8 -0
  118. package/dist/src/infrastructure/ui/views/checkout/Checkout.d.ts +7 -2
  119. package/dist/src/infrastructure/ui/views/checkout/Checkout.js +24 -15
  120. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.d.ts +3 -0
  121. package/dist/src/infrastructure/ui/views/checkout/Checkout.style.js +3 -0
  122. package/dist/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.js +16 -16
  123. package/dist/src/infrastructure/ui/views/checkout/components/deliveryBanner/DeliveryBanner.js +2 -2
  124. package/dist/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.js +7 -7
  125. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.js +2 -2
  126. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +7 -0
  127. package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +11 -0
  128. package/dist/src/infrastructure/ui/views/item/Item.js +1 -3
  129. package/dist/src/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +3 -3
  130. package/dist/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +5 -11
  131. package/dist/src/infrastructure/ui/views/item/components/itemActions/ItemActions.js +4 -4
  132. package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +3 -3
  133. package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.d.ts +0 -1
  134. package/dist/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.js +1 -2
  135. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +2 -2
  136. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +12 -0
  137. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +64 -0
  138. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +12 -0
  139. package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +16 -0
  140. package/dist/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +4 -4
  141. package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +40 -0
  142. package/dist/src/infrastructure/ui/views/return/Return.style.js +44 -0
  143. package/dist/src/infrastructure/ui/views/return/components/price/Price.js +0 -3
  144. package/dist/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.js +3 -3
  145. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +6 -6
  146. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +0 -1
  147. package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.js +1 -2
  148. package/dist/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.js +4 -4
  149. package/dist/src/infrastructure/ui/views/summary/Summary.js +5 -6
  150. package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +2 -3
  151. package/dist/src/infrastructure/ui/views/summary/components/pricing/Pricing.js +6 -8
  152. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +14 -0
  153. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +28 -0
  154. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +7 -0
  155. package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +11 -0
  156. package/dist/src/infrastructure/ui/views/summaryTabs/SummaryTabs.js +1 -3
  157. package/dist/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.js +5 -5
  158. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +26 -0
  159. package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +21 -0
  160. package/dist/src/projection/customer/customer.d.ts +2 -0
  161. package/dist/src/projection/order/order.d.ts +1 -1
  162. package/dist/src/projection/shared/country.d.ts +14 -0
  163. package/dist/src/projection/shared/country.js +15 -0
  164. package/dist/src/projection/shared/customer.d.ts +9 -0
  165. package/dist/src/projection/shared/customer.js +1 -0
  166. package/dist/src/projection/shared/locale.d.ts +12 -0
  167. package/dist/src/projection/shared/locale.js +13 -0
  168. package/dist/src/projection/shared/order.d.ts +6 -0
  169. package/dist/src/projection/shared/order.js +1 -0
  170. package/dist/src/projection/shared/price.d.ts +11 -0
  171. package/dist/src/projection/shared/price.js +1 -0
  172. package/dist/src/projection/shared/size.d.ts +21 -0
  173. package/dist/src/projection/shared/size.js +4 -0
  174. package/dist/src/projection/shared/subscription.d.ts +2 -0
  175. package/dist/src/projection/shared/subscription.js +1 -0
  176. package/dist/src/projection/subscription/subscription.d.ts +1 -1
  177. package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.d.ts +15 -0
  178. package/dist/src/shared/ui/components/atoms/aspectRatioView/AspectRatioView.js +16 -0
  179. package/dist/src/shared/ui/components/atoms/error/Error.d.ts +11 -0
  180. package/dist/src/shared/ui/components/atoms/error/Error.js +6 -0
  181. package/dist/src/shared/ui/components/atoms/field/Field.d.ts +14 -0
  182. package/dist/src/shared/ui/components/atoms/field/Field.js +29 -0
  183. package/dist/src/shared/ui/components/atoms/field/Field.style.d.ts +16 -0
  184. package/dist/src/shared/ui/components/atoms/field/Field.style.js +19 -0
  185. package/dist/src/shared/ui/components/molecules/inputField/InputField.d.ts +24 -0
  186. package/dist/src/shared/ui/components/molecules/inputField/InputField.js +28 -0
  187. package/dist/src/shared/ui/components/molecules/inputField/InputField.style.d.ts +29 -0
  188. package/dist/src/shared/ui/components/molecules/inputField/InputField.style.js +37 -0
  189. package/dist/src/version.d.ts +1 -1
  190. package/dist/src/version.js +1 -1
  191. package/fake-dependencies/@lookiero/payments-front/index.tsx +32 -9
  192. package/index.ts +11 -5
  193. package/jest.config.js +2 -2
  194. package/package.json +8 -7
  195. package/src/ExpoRoot.tsx +44 -38
  196. package/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.ts +4 -1
  197. package/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.ts +3 -2
  198. package/src/infrastructure/tracking/tracking.ts +2 -2
  199. package/src/infrastructure/tracking/useTrackCheckout.ts +66 -56
  200. package/src/infrastructure/ui/Root.tsx +9 -9
  201. package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.style.ts +2 -3
  202. package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/FiveItemsDiscountBanner.tsx +2 -3
  203. package/src/infrastructure/ui/components/atoms/fiveItemsDiscountBanner/__snapshots__/FiveItemsDiscountBanner.test.tsx.snap +1 -1
  204. package/src/infrastructure/ui/components/atoms/price/Price.tsx +0 -3
  205. package/src/infrastructure/ui/components/atoms/price/__snapshots__/Price.test.tsx.snap +3 -3
  206. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.style.ts +4 -25
  207. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/buttonCheckoutQuestionItem/ButtonCheckoutQuestionItem.tsx +7 -13
  208. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostDefaultCheckoutQuestionItem/HostDefaultCheckoutQuestionItem.tsx +1 -2
  209. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/hostSelectCheckoutQuestionItem/HostSelectCheckoutQuestionItem.tsx +1 -2
  210. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.style.ts +1 -0
  211. package/src/infrastructure/ui/components/organisms/checkoutQuestions/components/textareaCheckoutQuestionItem/TextareaCheckoutQuestionItem.tsx +2 -4
  212. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +3 -3
  213. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +2 -3
  214. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +5 -5
  215. package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +2 -3
  216. package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +2 -3
  217. package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +1 -2
  218. package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +5 -6
  219. package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +7 -7
  220. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.style.ts +1 -0
  221. package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +2 -4
  222. package/src/infrastructure/ui/components/templates/footer/Footer.test.tsx +15 -0
  223. package/src/infrastructure/ui/components/templates/footer/Footer.tsx +19 -0
  224. package/src/infrastructure/ui/components/templates/footer/__snapshots__/Footer.test.tsx.snap +1127 -0
  225. package/src/infrastructure/ui/components/templates/header/checkoutHeader/CheckoutHeader.tsx +2 -2
  226. package/src/infrastructure/ui/components/templates/header/checkoutHeader/__snapshots__/CheckoutHeader.test.tsx.snap +1 -1
  227. package/src/infrastructure/ui/components/templates/header/itemDetailHeader/ItemDetailHeader.tsx +2 -2
  228. package/src/infrastructure/ui/components/templates/header/itemDetailHeader/__snapshots__/ItemDetailHeader.test.tsx.snap +1 -1
  229. package/src/infrastructure/ui/components/templates/header/itemHeader/ItemHeader.tsx +5 -4
  230. package/src/infrastructure/ui/components/templates/header/itemHeader/__snapshots__/ItemHeader.test.tsx.snap +1 -1
  231. package/src/infrastructure/ui/hooks/{useSubmitCheckout.test.ts → useCheckoutFlow.test.ts} +1 -1
  232. package/src/infrastructure/ui/hooks/useCheckoutFlow.tsx +212 -0
  233. package/src/infrastructure/ui/hooks/usePaymentInstrumentEvents.ts +18 -60
  234. package/src/infrastructure/ui/hooks/useStaticInfo.tsx +4 -2
  235. package/src/infrastructure/ui/i18n/i18n.ts +2 -3
  236. package/src/infrastructure/ui/routing/CheckoutMiddleware.test.tsx +3 -3
  237. package/src/infrastructure/ui/routing/CheckoutMiddleware.tsx +3 -17
  238. package/src/infrastructure/ui/routing/Routing.tsx +25 -39
  239. package/src/infrastructure/ui/routing/routes.ts +0 -1
  240. package/src/infrastructure/ui/test/render.tsx +4 -10
  241. package/src/infrastructure/ui/views/App.tsx +5 -14
  242. package/src/infrastructure/ui/views/checkout/Checkout.style.ts +3 -0
  243. package/src/infrastructure/ui/views/checkout/Checkout.tsx +55 -18
  244. package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.test.tsx +116 -121
  245. package/src/infrastructure/ui/views/checkout/components/deliveryBanner/DeliveryBanner.tsx +2 -2
  246. package/src/infrastructure/ui/views/checkout/components/deliveryBanner/__snapshots__/DeliveryBanner.test.tsx.snap +1 -1
  247. package/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.tsx +8 -8
  248. package/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.tsx +2 -2
  249. package/src/infrastructure/ui/views/item/Item.tsx +1 -2
  250. package/src/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.tsx +3 -3
  251. package/src/infrastructure/ui/views/item/components/banner/__snapshots__/CustomerDecissionBanner.test.tsx.snap +3 -3
  252. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.tsx +5 -11
  253. package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +88 -160
  254. package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.tsx +4 -4
  255. package/src/infrastructure/ui/views/item/components/itemActions/__snapshots__/ItemActions.test.tsx.snap +128 -244
  256. package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.ts +1 -2
  257. package/src/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.tsx +3 -3
  258. package/src/infrastructure/ui/views/item/components/productVariantDescription/__snapshots__/ProductVariantDescription.test.tsx.snap +8 -10
  259. package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +30 -30
  260. package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +2 -2
  261. package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +1 -1
  262. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.tsx +4 -4
  263. package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +41 -75
  264. package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +102 -105
  265. package/src/infrastructure/ui/views/return/components/price/Price.tsx +0 -3
  266. package/src/infrastructure/ui/views/return/components/price/__snapshots__/Price.test.tsx.snap +3 -3
  267. package/src/infrastructure/ui/views/return/components/productVariantPreview/ProductVariantPreview.tsx +3 -3
  268. package/src/infrastructure/ui/views/return/components/productVariantPreview/__snapshots__/ProductVariantPreview.test.tsx.snap +1 -1
  269. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.style.ts +1 -2
  270. package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +6 -6
  271. package/src/infrastructure/ui/views/shared/components/productVariant/ProductVariant.tsx +4 -4
  272. package/src/infrastructure/ui/views/shared/components/productVariant/__snapshots__/ProductVariant.test.tsx.snap +30 -30
  273. package/src/infrastructure/ui/views/summary/Summary.tsx +5 -6
  274. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +2 -3
  275. package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +82 -154
  276. package/src/infrastructure/ui/views/summary/components/pricing/Pricing.tsx +6 -8
  277. package/src/infrastructure/ui/views/summaryTabs/SummaryTabs.tsx +1 -2
  278. package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.tsx +5 -5
  279. package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +62 -62
  280. package/src/projection/customer/customer.ts +2 -0
  281. package/src/projection/order/order.ts +1 -1
  282. package/src/projection/subscription/subscription.ts +1 -1
  283. package/src/infrastructure/ui/hooks/useSubmitCheckout.ts +0 -169
  284. package/src/infrastructure/ui/routing/useBasePath.test.tsx +0 -19
  285. package/src/infrastructure/ui/routing/useBasePath.tsx +0 -24
  286. package/src/infrastructure/ui/views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal.tsx +0 -125
@@ -4,17 +4,17 @@ import { Text, useDevice } from "@lookiero/aurora";
4
4
  import { useI18nMessage } from "@lookiero/i18n-react";
5
5
  import { Tabs } from "@lookiero/sty-psp-ui";
6
6
  import { CheckoutItemStatus } from "../../../../../../domain/checkoutItem/model/checkoutItem";
7
- import { DOMAIN, I18nMessages } from "../../../../i18n/i18n";
7
+ import { I18nMessages } from "../../../../i18n/i18n";
8
8
  import { ProductVariant } from "../../../shared/components/productVariant/ProductVariant";
9
9
  import { style } from "./CheckoutItemsTabs.style";
10
10
  const CheckoutItem = ({ checkoutItemStatus, checkoutItemProductVariant, checkoutItemPrice, country, testID, style: customStyle, onPress, }) => (React.createElement(View, { testID: testID },
11
11
  React.createElement(ProductVariant, { brand: checkoutItemProductVariant.brand, color: checkoutItemProductVariant.color, country: country, media: checkoutItemProductVariant.media, name: checkoutItemProductVariant.name, price: checkoutItemPrice, size: checkoutItemProductVariant.size, status: checkoutItemStatus, style: customStyle, onPress: onPress })));
12
12
  const CheckoutItemsTabs = ({ tabIndex, checkoutItemsKept, checkoutItemsReturned, country, onPressItem, onChanged, }) => {
13
13
  const { screen } = useDevice();
14
- const keepTabText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_KEEP_TAB });
15
- const returnTabText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_RETURN_TAB });
16
- const keepEmptyText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_KEEP_EMPTY });
17
- const returnEmptyText = useI18nMessage({ domain: DOMAIN, id: I18nMessages.SUMMARY_RETURN_EMPTY });
14
+ const keepTabText = useI18nMessage({ id: I18nMessages.SUMMARY_KEEP_TAB });
15
+ const returnTabText = useI18nMessage({ id: I18nMessages.SUMMARY_RETURN_TAB });
16
+ const keepEmptyText = useI18nMessage({ id: I18nMessages.SUMMARY_KEEP_EMPTY });
17
+ const returnEmptyText = useI18nMessage({ id: I18nMessages.SUMMARY_RETURN_EMPTY });
18
18
  const handleOnPressItem = useCallback((checkoutItemId) => onPressItem(checkoutItemId), [onPressItem]);
19
19
  const data = useMemo(() => [{ id: "0" }, { id: "1" }], []);
20
20
  const renderItem = useCallback(({ index }) => index === 0 ? (checkoutItemsKept.length === 0 ? (React.createElement(Text, { style: style.emptyText }, keepEmptyText)) : (React.createElement(React.Fragment, null, checkoutItemsKept.map((checkoutItem) => (React.createElement(CheckoutItem, { key: checkoutItem.id, checkoutItemPrice: checkoutItem.price, checkoutItemStatus: checkoutItem.status, country: country, testID: "keep-checkout-item", checkoutItemProductVariant: checkoutItem.status === CheckoutItemStatus.REPLACED && checkoutItem.replacedFor
@@ -0,0 +1,26 @@
1
+ import { Query, QueryHandlerFunction, QueryHandlerFunctionArgs } from "@lookiero/messaging";
2
+
3
+ type IsCheckoutAccessibleByCustomerIdProjection = boolean;
4
+ declare const VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID = "view_is_checkout_accessible_by_customer_id";
5
+ interface ViewIsCheckoutAccessibleByCustomerIdPayload {
6
+ readonly customerId: string | undefined;
7
+ }
8
+ interface ViewIsCheckoutAccessibleByCustomerId
9
+ extends Query<typeof VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID>,
10
+ ViewIsCheckoutAccessibleByCustomerIdPayload {}
11
+ interface ViewIsCheckoutAccessibleByCustomerIdFunction {
12
+ (payload: ViewIsCheckoutAccessibleByCustomerIdPayload): ViewIsCheckoutAccessibleByCustomerId;
13
+ }
14
+ declare const viewIsCheckoutAccessibleByCustomerId: ViewIsCheckoutAccessibleByCustomerIdFunction;
15
+ interface ViewIsCheckoutAccessibleByCustomerIdHandlerFunctionArgs extends QueryHandlerFunctionArgs {}
16
+ declare const viewIsCheckoutAccessibleByCustomerIdHandler: QueryHandlerFunction<
17
+ ViewIsCheckoutAccessibleByCustomerId,
18
+ IsCheckoutAccessibleByCustomerIdProjection,
19
+ ViewIsCheckoutAccessibleByCustomerIdHandlerFunctionArgs
20
+ >;
21
+ export type { IsCheckoutAccessibleByCustomerIdProjection };
22
+ export {
23
+ VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID,
24
+ viewIsCheckoutAccessibleByCustomerId,
25
+ viewIsCheckoutAccessibleByCustomerIdHandler,
26
+ };
@@ -0,0 +1,21 @@
1
+ import { query } from "@lookiero/messaging";
2
+ import { viewFirstAvailableCheckoutByCustomerId } from "./viewFirstAvailableCheckoutByCustomerId";
3
+ import { viewIsCheckoutEnabledByCustomerId } from "./viewIsCheckoutEnabledByCustomerId";
4
+
5
+ const VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID = "view_is_checkout_accessible_by_customer_id";
6
+ const viewIsCheckoutAccessibleByCustomerId = (payload) => ({
7
+ ...query({ name: VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID }),
8
+ ...payload,
9
+ });
10
+ const isNonEmptyCustomerId = (customerId) => Boolean(customerId);
11
+ const viewIsCheckoutAccessibleByCustomerIdHandler =
12
+ ({ queryBus }) =>
13
+ async ({ customerId }) =>
14
+ isNonEmptyCustomerId(customerId) &&
15
+ Boolean(await queryBus(viewFirstAvailableCheckoutByCustomerId({ customerId }))) &&
16
+ Boolean(await queryBus(viewIsCheckoutEnabledByCustomerId({ customerId })));
17
+ export {
18
+ VIEW_IS_CHECKOUT_ACCESSIBLE_BY_CUSTOMER_ID,
19
+ viewIsCheckoutAccessibleByCustomerId,
20
+ viewIsCheckoutAccessibleByCustomerIdHandler,
21
+ };
@@ -4,5 +4,7 @@ interface Customer {
4
4
  readonly customerId: string;
5
5
  readonly country: Country;
6
6
  readonly segment: Segment;
7
+ readonly name: string;
8
+ readonly email: string;
7
9
  }
8
10
  export type { Customer };
@@ -3,4 +3,4 @@ interface Order {
3
3
  readonly isFirstOrder: boolean;
4
4
  readonly coupon: string | null;
5
5
  }
6
- export type { Order };
6
+ export type { Order as OrderProjection };
@@ -0,0 +1,14 @@
1
+ declare enum Country {
2
+ ES = "ES",
3
+ FR = "FR",
4
+ GB = "GB",
5
+ BE = "BE",
6
+ LU = "LU",
7
+ IT = "IT",
8
+ PT = "PT",
9
+ DE = "DE",
10
+ AT = "AT",
11
+ NL = "NL",
12
+ SE = "SE",
13
+ }
14
+ export { Country };
@@ -0,0 +1,15 @@
1
+ var Country;
2
+ (function (Country) {
3
+ Country["ES"] = "ES";
4
+ Country["FR"] = "FR";
5
+ Country["GB"] = "GB";
6
+ Country["BE"] = "BE";
7
+ Country["LU"] = "LU";
8
+ Country["IT"] = "IT";
9
+ Country["PT"] = "PT";
10
+ Country["DE"] = "DE";
11
+ Country["AT"] = "AT";
12
+ Country["NL"] = "NL";
13
+ Country["SE"] = "SE";
14
+ })(Country || (Country = {}));
15
+ export { Country };
@@ -0,0 +1,9 @@
1
+ import { Country } from "@lookiero/sty-psp-locale";
2
+ import { Segment } from "@lookiero/sty-psp-segment";
3
+
4
+ interface Customer {
5
+ readonly customerId: string;
6
+ readonly country: Country;
7
+ readonly segment: Segment;
8
+ }
9
+ export type { Customer };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ declare enum Locale {
2
+ ES = "es",
3
+ FR = "fr",
4
+ EN = "en",
5
+ IT = "it",
6
+ PT = "pt",
7
+ DE = "de",
8
+ AT = "at",
9
+ NL = "nl",
10
+ SE = "sv",
11
+ }
12
+ export { Locale };
@@ -0,0 +1,13 @@
1
+ var Locale;
2
+ (function (Locale) {
3
+ Locale["ES"] = "es";
4
+ Locale["FR"] = "fr";
5
+ Locale["EN"] = "en";
6
+ Locale["IT"] = "it";
7
+ Locale["PT"] = "pt";
8
+ Locale["DE"] = "de";
9
+ Locale["AT"] = "at";
10
+ Locale["NL"] = "nl";
11
+ Locale["SE"] = "sv";
12
+ })(Locale || (Locale = {}));
13
+ export { Locale };
@@ -0,0 +1,6 @@
1
+ interface Order {
2
+ readonly orderNumber: number;
3
+ readonly isFirstOrder: boolean;
4
+ readonly coupon: string | null;
5
+ }
6
+ export type { Order };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { Currency } from "../../domain/checkoutItem/model/currency";
2
+
3
+ interface PriceProjection {
4
+ readonly amount: number;
5
+ readonly currency: Currency;
6
+ readonly discountedPrice?: {
7
+ readonly amount: number;
8
+ readonly percentage: number;
9
+ };
10
+ }
11
+ export type { PriceProjection };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import { Country } from "./country";
2
+
3
+ interface SizeProjection {
4
+ readonly id: string;
5
+ readonly lookiero: string;
6
+ readonly uk: string;
7
+ readonly it: string;
8
+ readonly europe: string;
9
+ readonly unique: boolean;
10
+ readonly visualOrder?: number;
11
+ }
12
+ interface SizeFunctionArgs {
13
+ readonly size: SizeProjection;
14
+ readonly country: Country;
15
+ }
16
+ interface SizeFunction {
17
+ (args: SizeFunctionArgs): string;
18
+ }
19
+ declare const size: SizeFunction;
20
+ export type { SizeProjection };
21
+ export { size };
@@ -0,0 +1,4 @@
1
+ import { Country } from "./country";
2
+
3
+ const size = ({ size, country }) => (country === Country.GB ? size.uk : size.lookiero);
4
+ export { size };
@@ -0,0 +1,2 @@
1
+ type Subscription = "o" | "m" | "b" | "q";
2
+ export type { Subscription };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,2 @@
1
1
  type Subscription = "o" | "m" | "b" | "q";
2
- export type { Subscription };
2
+ export type { Subscription as SubscriptionProjection };
@@ -0,0 +1,15 @@
1
+ import { FC, ReactNode } from "react";
2
+ import { StyleProp, ViewStyle } from "react-native";
3
+ declare enum AspectRatioViewResizeDirection {
4
+ VERTICAL = "VERTICAL",
5
+ HORIZONTAL = "HORIZONTAL"
6
+ }
7
+ interface AspectRatioViewProps {
8
+ readonly aspectRatio?: number;
9
+ readonly resizeDirection?: AspectRatioViewResizeDirection;
10
+ readonly multiplier?: number;
11
+ readonly children: ReactNode;
12
+ readonly style?: StyleProp<ViewStyle>;
13
+ }
14
+ declare const AspectRatioView: FC<AspectRatioViewProps>;
15
+ export { AspectRatioView, AspectRatioViewResizeDirection };
@@ -0,0 +1,16 @@
1
+ import React, { useCallback, useState } from "react";
2
+ import { View } from "react-native";
3
+ var AspectRatioViewResizeDirection;
4
+ (function (AspectRatioViewResizeDirection) {
5
+ AspectRatioViewResizeDirection["VERTICAL"] = "VERTICAL";
6
+ AspectRatioViewResizeDirection["HORIZONTAL"] = "HORIZONTAL";
7
+ })(AspectRatioViewResizeDirection || (AspectRatioViewResizeDirection = {}));
8
+ const AspectRatioView = ({ aspectRatio = 1, resizeDirection = AspectRatioViewResizeDirection.HORIZONTAL, multiplier = 1, style: customStyle = {}, children, }) => {
9
+ const [{ width, height }, setDimension] = useState({});
10
+ const handleOnLayout = useCallback(({ nativeEvent: { layout } }) => setDimension(resizeDirection === AspectRatioViewResizeDirection.HORIZONTAL
11
+ ? { width: layout.width * multiplier, height: layout.width * aspectRatio }
12
+ : { width: layout.height * aspectRatio, height: layout.height }), [aspectRatio, multiplier, resizeDirection]);
13
+ return (React.createElement(View, { onLayout: handleOnLayout },
14
+ React.createElement(View, { style: [{ width, height }, customStyle] }, children)));
15
+ };
16
+ export { AspectRatioView, AspectRatioViewResizeDirection };
@@ -0,0 +1,11 @@
1
+ import { FC } from "react";
2
+ import { StyleProp, TextStyle } from "react-native";
3
+
4
+ type ErrorStyle = StyleProp<TextStyle>;
5
+ interface ErrorProps {
6
+ readonly error?: string | null;
7
+ readonly style?: ErrorStyle;
8
+ }
9
+ declare const Error: FC<ErrorProps>;
10
+ export type { ErrorStyle };
11
+ export { Error };
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { COLOR, Text } from "@lookiero/aurora";
3
+
4
+ const Error = ({ error, style: customStyle }) =>
5
+ React.createElement(Text, { color: COLOR.TEXT_ERROR, level: 2, style: customStyle, detail: true }, error);
6
+ export { Error };
@@ -0,0 +1,14 @@
1
+ import { FC } from "react";
2
+ import { StyleProp, TextStyle, ViewStyle } from "react-native";
3
+ type FieldStyle = {
4
+ readonly field: StyleProp<ViewStyle>;
5
+ readonly fieldText: StyleProp<TextStyle>;
6
+ };
7
+ interface FieldProps {
8
+ readonly label: string;
9
+ readonly isFocused?: boolean;
10
+ readonly style?: FieldStyle;
11
+ }
12
+ declare const Field: FC<FieldProps>;
13
+ export type { FieldStyle };
14
+ export { Field };
@@ -0,0 +1,29 @@
1
+ import React, { useCallback, useState } from "react";
2
+ import { View } from "react-native";
3
+ import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
4
+ import { Text } from "@lookiero/aurora";
5
+ import { theme } from "@lookiero/sty-psp-ui";
6
+ import { style } from "./Field.style";
7
+ const SCALE = 0.75;
8
+ const { space1, space4 } = theme();
9
+ const Field = ({ label, isFocused = false, style: customStyle }) => {
10
+ const [width, setWidth] = useState(0);
11
+ const handleOnLayout = useCallback(({ nativeEvent: { layout } }) => setWidth(layout.width), []);
12
+ const scale = useSharedValue(isFocused ? SCALE : 1);
13
+ scale.value = isFocused ? SCALE : 1;
14
+ const translateY = useSharedValue(isFocused ? -14 : space4);
15
+ translateY.value = isFocused ? -14 : space4;
16
+ const translateX = useSharedValue(isFocused ? -(((1 - SCALE) * width) / 2 + space1) : 0);
17
+ translateX.value = isFocused ? -(((1 - SCALE) * width) / 2 + space1) : 0;
18
+ const animatedStyle = useAnimatedStyle(() => ({
19
+ transform: [
20
+ { scale: withTiming(scale.value) },
21
+ { translateY: withTiming(translateY.value) },
22
+ { translateX: withTiming(translateX.value) },
23
+ ],
24
+ }), [scale.value, translateX.value, translateY.value]);
25
+ return (React.createElement(Animated.View, { pointerEvents: "none", style: [customStyle?.field, animatedStyle], onLayout: handleOnLayout },
26
+ React.createElement(Text, { level: 1, numberOfLines: 1, style: [style.fieldText, customStyle?.fieldText], detail: true }, label),
27
+ React.createElement(View, { style: [style.fieldBackground, { opacity: isFocused ? 1 : 0 }] })));
28
+ };
29
+ export { Field };
@@ -0,0 +1,16 @@
1
+ declare const style: {
2
+ fieldBackground: {
3
+ backgroundColor: string;
4
+ height: "100%";
5
+ position: "absolute";
6
+ width: "100%";
7
+ zIndex: number;
8
+ };
9
+ fieldText: {
10
+ flexWrap: "nowrap";
11
+ overflow: "hidden";
12
+ paddingHorizontal: number;
13
+ zIndex: number;
14
+ };
15
+ };
16
+ export { style };
@@ -0,0 +1,19 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { theme } from "@lookiero/sty-psp-ui";
3
+ const { colorBgBase, space1 } = theme();
4
+ const style = StyleSheet.create({
5
+ fieldBackground: {
6
+ backgroundColor: colorBgBase,
7
+ height: "100%",
8
+ position: "absolute",
9
+ width: "100%",
10
+ zIndex: 0,
11
+ },
12
+ fieldText: {
13
+ flexWrap: "nowrap",
14
+ overflow: "hidden",
15
+ paddingHorizontal: space1,
16
+ zIndex: 1,
17
+ },
18
+ });
19
+ export { style };
@@ -0,0 +1,24 @@
1
+ import { FC } from "react";
2
+ import { StyleProp, TextStyle, ViewStyle } from "react-native";
3
+ import { IconName, InputProperties } from "@lookiero/aurora";
4
+ import { ErrorStyle } from "@lookiero/sty-psp-ui";
5
+ import { FieldStyle } from "../../atoms/field/Field";
6
+ type IconStyle = StyleProp<TextStyle>;
7
+ type InputFieldStyle = FieldStyle & {
8
+ readonly inputField: StyleProp<ViewStyle>;
9
+ readonly error: ErrorStyle;
10
+ readonly icon: IconStyle;
11
+ };
12
+ interface InputFieldBaseProps {
13
+ readonly label: string;
14
+ readonly multiline?: boolean;
15
+ readonly error?: string | null;
16
+ readonly style?: Partial<InputFieldStyle>;
17
+ readonly onChange?: (value: string) => void;
18
+ readonly icon?: IconName;
19
+ }
20
+ interface InputFieldProps extends Omit<InputProperties, keyof InputFieldBaseProps>, InputFieldBaseProps {
21
+ }
22
+ declare const InputField: FC<InputFieldProps>;
23
+ export type { InputFieldStyle };
24
+ export { InputField };
@@ -0,0 +1,28 @@
1
+ import React, { useCallback, useState } from "react";
2
+ import { View } from "react-native";
3
+ import { COLOR, Icon, Input } from "@lookiero/aurora";
4
+ import { Error, theme } from "@lookiero/sty-psp-ui";
5
+ import { Field } from "../../atoms/field/Field";
6
+ import { style } from "./InputField.style";
7
+ const { colorBgBase, colorBorderInput, colorBorderInputError, colorBorderInputFocus, colorText, colorTextError, colorTextMedium, iconSize, space6, } = theme();
8
+ const inputPaddingRightWithIcon = iconSize + space6;
9
+ const InputField = ({ label, placeholder, value, multiline = false, error, style: customStyle, onChange = () => void 0, icon, testID = "input", ...inputRestProps }) => {
10
+ const [isFocused, setIsFocused] = useState(false);
11
+ const handleOnChange = useCallback((text) => onChange(text), [onChange]);
12
+ const handleOnBlur = useCallback(() => setIsFocused(false), []);
13
+ const handleOnFocus = useCallback(() => setIsFocused(true), []);
14
+ const borderColor = error ? colorBorderInputError : isFocused ? colorBorderInputFocus : colorBorderInput;
15
+ const color = error ? colorTextError : isFocused ? colorText : colorTextMedium;
16
+ return (React.createElement(View, { style: [style.inputField, { borderColor }, customStyle?.inputField], testID: "input-field" },
17
+ React.createElement(Field, { isFocused: isFocused || !!value, label: label, style: {
18
+ field: [style.field, customStyle?.field],
19
+ fieldText: [{ color }, customStyle?.fieldText],
20
+ } }),
21
+ React.createElement(Input, { autoCapitalize: "sentences", multiline: multiline, multilineMaxHeight: 242, placeholder: placeholder, placeholderTextColor: isFocused ? colorTextMedium : colorBgBase, style: [!!icon && { paddingRight: inputPaddingRightWithIcon }, style.input, { color }], testID: testID, value: value, onBlur: handleOnBlur,
22
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
23
+ // @ts-ignore
24
+ onChange: handleOnChange, onFocus: handleOnFocus, ...inputRestProps }),
25
+ !!icon && React.createElement(Icon, { color: COLOR.GRAYSCALE_L, name: icon, style: [style.icon, customStyle?.icon], testID: "icon" }),
26
+ !!error && React.createElement(Error, { error: error, style: [style.error, customStyle?.error] })));
27
+ };
28
+ export { InputField };
@@ -0,0 +1,29 @@
1
+ import { StyleSheet } from "react-native";
2
+ declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
3
+ error: {
4
+ marginLeft: number;
5
+ marginTop: number;
6
+ };
7
+ field: {
8
+ left: number;
9
+ maxWidth: "100%";
10
+ position: "absolute";
11
+ zIndex: number;
12
+ };
13
+ icon: {
14
+ height: number;
15
+ position: "absolute";
16
+ right: number;
17
+ top: number;
18
+ width: number;
19
+ zIndex: number;
20
+ };
21
+ input: {
22
+ textOverflow?: string | undefined;
23
+ };
24
+ inputField: {
25
+ borderRadius: number;
26
+ borderWidth: number;
27
+ };
28
+ }>;
29
+ export { style };
@@ -0,0 +1,37 @@
1
+ import { StyleSheet, Platform } from "react-native";
2
+ import { theme } from "@lookiero/sty-psp-ui";
3
+ const { space1, space4, space6, borderRadius2, borderWidth1 } = theme();
4
+ const style = StyleSheet.create({
5
+ error: {
6
+ marginLeft: space6,
7
+ marginTop: space1,
8
+ },
9
+ field: {
10
+ left: space4,
11
+ maxWidth: "100%",
12
+ position: "absolute",
13
+ zIndex: 4,
14
+ },
15
+ icon: {
16
+ height: 16,
17
+ position: "absolute",
18
+ right: space4,
19
+ top: space4,
20
+ width: 16,
21
+ zIndex: 4,
22
+ },
23
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
24
+ // @ts-ignore
25
+ input: {
26
+ ...Platform.select({
27
+ web: {
28
+ textOverflow: "ellipsis",
29
+ },
30
+ }),
31
+ },
32
+ inputField: {
33
+ borderRadius: borderRadius2,
34
+ borderWidth: borderWidth1,
35
+ },
36
+ });
37
+ export { style };
@@ -1 +1 @@
1
- export declare const VERSION = "9.13.0";
1
+ export declare const VERSION = "10.0.0-beta.0";
@@ -1 +1 @@
1
- export const VERSION = "9.13.0";
1
+ export const VERSION = "10.0.0-beta.0";
@@ -7,34 +7,57 @@ import {
7
7
  RefAttributes,
8
8
  useImperativeHandle,
9
9
  } from "react";
10
+ import { PaymentPayload } from "@lookiero/payments-front";
10
11
 
11
12
  const setPaymentsBridge = () => void 0;
12
13
  const PaymentsQueryProvider: FC<PropsWithChildren> = ({ children }) => children;
13
14
  const PaymentInstrumentSelect: FC = () => null;
14
- interface StartLegacyBoxCheckoutCallbackArgs {
15
- readonly status: string;
16
- readonly final: boolean;
17
- }
15
+
18
16
  interface StartLegacyBoxCheckoutFunction {
19
- (paymentFlowPayload: unknown, callback: (params: StartLegacyBoxCheckoutCallbackArgs) => Promise<void>): void;
17
+ (paymentFlowPayload: unknown): void;
20
18
  }
19
+
21
20
  interface PaymentFlowRef {
22
21
  readonly startLegacyBoxCheckout: StartLegacyBoxCheckoutFunction;
23
22
  }
23
+
24
24
  const paymentFlowRef: PaymentFlowRef = {
25
- startLegacyBoxCheckout: async (_paymentFlowPayload, callback) => {
26
- await callback({ status: "EXECUTED", final: true });
27
- },
25
+ startLegacyBoxCheckout: async () => {},
28
26
  };
27
+
29
28
  const PaymentFlow: ForwardRefExoticComponent<RefAttributes<PaymentFlowRef>> = forwardRef<PaymentFlowRef, unknown>(
30
29
  (_props, ref) => {
31
30
  useImperativeHandle(ref, () => paymentFlowRef, []);
32
31
  return null;
33
32
  },
34
33
  );
34
+
35
35
  PaymentFlow.displayName = "PaymentFlow";
36
+
37
+ interface UsePaymentStatusManagerResult {
38
+ isLoading: boolean;
39
+ consumePayload: (callback: (payload: PaymentPayload) => void) => void;
40
+ }
41
+
42
+ const paymentStatusManagerResult: UsePaymentStatusManagerResult = {
43
+ isLoading: false,
44
+ consumePayload: (callback) => callback({ success: true } as PaymentPayload),
45
+ };
46
+
47
+ const usePaymentStatusManager: (section: Section) => UsePaymentStatusManagerResult = () => paymentStatusManagerResult;
48
+
36
49
  enum Section {
37
50
  BOX_CHECKOUT = "box-checkout",
38
51
  }
52
+
39
53
  export type { PaymentFlowRef };
40
- export { PaymentsQueryProvider, PaymentInstrumentSelect, PaymentFlow, Section, setPaymentsBridge, paymentFlowRef };
54
+
55
+ export {
56
+ PaymentsQueryProvider,
57
+ PaymentInstrumentSelect,
58
+ PaymentFlow,
59
+ Section,
60
+ setPaymentsBridge,
61
+ paymentFlowRef,
62
+ usePaymentStatusManager,
63
+ };
package/index.ts CHANGED
@@ -9,12 +9,11 @@ import { CheckoutStatus } from "./src/domain/checkout/model/checkout";
9
9
  import { KameleoonEnvironment } from "./src/infrastructure/ab-testing/kameleoonEnvironment";
10
10
  import { bootstrap as checkoutBootstrap } from "./src/infrastructure/delivery/bootstrap";
11
11
  import { root, RootProps } from "./src/infrastructure/ui/Root";
12
- import { DOMAIN } from "./src/infrastructure/ui/i18n/i18n";
13
12
  import { CheckoutProjection } from "./src/projection/checkout/checkout";
14
13
  import { viewFirstAvailableCheckoutByCustomerId } from "./src/projection/checkout/viewFirstAvailableCheckoutByCustomerId";
15
14
  import { Customer } from "./src/projection/customer/customer";
16
- import { Order } from "./src/projection/order/order";
17
- import { Subscription } from "./src/projection/subscription/subscription";
15
+ import { OrderProjection } from "./src/projection/order/order";
16
+ import { SubscriptionProjection } from "./src/projection/subscription/subscription";
18
17
 
19
18
  interface FirstAvailableCheckoutByCustomerIdFunctionArgs {
20
19
  readonly customerId: string | undefined;
@@ -45,7 +44,7 @@ const bootstrap: BootstrapFunction = ({ apiUrl, getAuthToken, translations, sent
45
44
  const { Component: Messaging, queryBus } = checkoutBootstrap({ apiUrl, getAuthToken });
46
45
  const I18n = i18n({
47
46
  fetchTranslation: fetchTranslations({ translations }),
48
- domain: DOMAIN,
47
+ contextId: "CheckoutI18n",
49
48
  });
50
49
 
51
50
  const firstAvailableCheckoutByCustomerId: FirstAvailableCheckoutByCustomerIdFunction = ({ customerId }) =>
@@ -58,4 +57,11 @@ const bootstrap: BootstrapFunction = ({ apiUrl, getAuthToken, translations, sent
58
57
  };
59
58
 
60
59
  export { bootstrap, translationEndpoint, translationExternalEndpoint, Country, Segment, CheckoutStatus };
61
- export type { SentryEnvironment, KameleoonEnvironment, Customer, Subscription, Order, Locale };
60
+ export type {
61
+ SentryEnvironment,
62
+ KameleoonEnvironment,
63
+ Customer,
64
+ SubscriptionProjection as Subscription,
65
+ OrderProjection as Order,
66
+ Locale,
67
+ };
package/jest.config.js CHANGED
@@ -1,9 +1,9 @@
1
- const jestReactNativeConfig = require("@lookiero/sty-psp-jest-config/jest.config.expo.js");
1
+ const jestReactNativeConfig = require("@lookiero/sty-psp-jest-config/jest.config.react-native.js");
2
2
 
3
3
  module.exports = {
4
4
  ...jestReactNativeConfig,
5
- setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
6
5
  setupFiles: ["../../node_modules/react-native-gesture-handler/jestSetup.js"],
6
+ setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
7
7
  moduleNameMapper: {
8
8
  ...(jestReactNativeConfig.moduleNameMapper || {}),
9
9
  },