@lookiero/checkout 0.3.26 → 0.4.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.
- package/dist/domain/checkout/command/startCheckout.d.ts +13 -0
- package/dist/domain/checkout/command/startCheckout.js +4 -0
- package/dist/domain/checkout/model/checkout.d.ts +18 -0
- package/dist/domain/checkout/model/checkout.js +20 -0
- package/dist/domain/checkout/model/checkoutStarted.d.ts +13 -0
- package/dist/domain/checkout/model/checkoutStarted.js +4 -0
- package/dist/domain/checkout/model/checkouts.d.ts +7 -0
- package/dist/domain/checkout/model/checkouts.js +1 -0
- package/dist/domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem.d.ts +15 -0
- package/dist/domain/checkoutBooking/command/bookCheckoutBookingForCheckoutItem.js +7 -0
- package/dist/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.d.ts +15 -0
- package/dist/domain/checkoutBooking/command/bookSizeReplaceableProductVariantsForCheckoutItem.js +7 -0
- package/dist/domain/checkoutBooking/model/checkoutBooking.d.ts +9 -0
- package/dist/domain/checkoutBooking/model/checkoutBooking.js +9 -0
- package/dist/domain/checkoutBooking/model/checkoutBookingBooked.d.ts +14 -0
- package/dist/domain/checkoutBooking/model/checkoutBookingBooked.js +7 -0
- package/dist/domain/checkoutBooking/model/checkoutBookings.d.ts +7 -0
- package/dist/domain/checkoutBooking/model/checkoutBookings.js +1 -0
- package/dist/domain/checkoutItem/command/keepCheckoutItem.d.ts +13 -0
- package/dist/domain/checkoutItem/command/keepCheckoutItem.js +4 -0
- package/dist/domain/checkoutItem/command/replaceCheckoutItem.d.ts +14 -0
- package/dist/domain/checkoutItem/command/replaceCheckoutItem.js +7 -0
- package/dist/domain/checkoutItem/command/returnCheckoutItem.d.ts +15 -0
- package/dist/domain/checkoutItem/command/returnCheckoutItem.js +7 -0
- package/dist/domain/checkoutItem/model/checkoutItem.d.ts +24 -0
- package/dist/domain/checkoutItem/model/checkoutItem.js +40 -0
- package/dist/domain/checkoutItem/model/checkoutItemKept.d.ts +13 -0
- package/dist/domain/checkoutItem/model/checkoutItemKept.js +4 -0
- package/dist/domain/checkoutItem/model/checkoutItemReplaced.d.ts +13 -0
- package/dist/domain/checkoutItem/model/checkoutItemReplaced.js +4 -0
- package/dist/domain/checkoutItem/model/checkoutItemReturned.d.ts +13 -0
- package/dist/domain/checkoutItem/model/checkoutItemReturned.js +4 -0
- package/dist/domain/checkoutItem/model/checkoutItems.d.ts +7 -0
- package/dist/domain/checkoutItem/model/checkoutItems.js +1 -0
- package/dist/domain/checkoutItem/model/currency.d.ts +5 -0
- package/dist/domain/checkoutItem/model/currency.js +6 -0
- package/dist/domain/checkoutItem/model/feedbacks.d.ts +3 -0
- package/dist/domain/checkoutItem/model/feedbacks.js +1 -0
- package/dist/domain/checkoutItem/model/price.d.ts +10 -0
- package/dist/domain/checkoutItem/model/price.js +1 -0
- package/dist/domain/uiSetting/command/updateUiSetting.d.ts +15 -0
- package/dist/domain/uiSetting/command/updateUiSetting.js +10 -0
- package/dist/domain/uiSetting/model/uiSetting.d.ts +9 -0
- package/dist/domain/uiSetting/model/uiSetting.js +11 -0
- package/dist/domain/uiSetting/model/uiSettingUpdated.d.ts +14 -0
- package/dist/domain/uiSetting/model/uiSettingUpdated.js +7 -0
- package/dist/domain/uiSetting/model/uiSettings.d.ts +7 -0
- package/dist/domain/uiSetting/model/uiSettings.js +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +19 -0
- package/dist/infrastructure/delivery/baseBootstrap.d.ts +56 -0
- package/dist/infrastructure/delivery/baseBootstrap.js +55 -0
- package/dist/infrastructure/delivery/bootstrap.d.ts +10 -0
- package/dist/infrastructure/delivery/bootstrap.js +44 -0
- package/dist/infrastructure/delivery/http/fetchHttpClient.d.ts +14 -0
- package/dist/infrastructure/delivery/http/fetchHttpClient.js +20 -0
- package/dist/infrastructure/delivery/http/httpClient.d.ts +16 -0
- package/dist/infrastructure/delivery/http/httpClient.js +1 -0
- package/dist/infrastructure/delivery/mock/checkoutBookingDataSource.d.ts +14 -0
- package/dist/infrastructure/delivery/mock/checkoutBookingDataSource.js +12 -0
- package/dist/infrastructure/delivery/mock/checkoutDataSource.d.ts +17 -0
- package/dist/infrastructure/delivery/mock/checkoutDataSource.js +18 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckoutBookings.d.ts +14 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckoutBookings.js +21 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckoutItems.d.ts +14 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckoutItems.js +25 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckouts.d.ts +11 -0
- package/dist/infrastructure/delivery/mock/dataSourceCheckouts.js +27 -0
- package/dist/infrastructure/domain/checkout/model/httpCheckouts.d.ts +16 -0
- package/dist/infrastructure/domain/checkout/model/httpCheckouts.js +19 -0
- package/dist/infrastructure/domain/checkout/model/httpCheckoutsStart.d.ts +5 -0
- package/dist/infrastructure/domain/checkout/model/httpCheckoutsStart.js +13 -0
- package/dist/infrastructure/domain/checkout/react/useStartCheckout.d.ts +13 -0
- package/dist/infrastructure/domain/checkout/react/useStartCheckout.js +10 -0
- package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.d.ts +16 -0
- package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.js +15 -0
- package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookingsBook.d.ts +5 -0
- package/dist/infrastructure/domain/checkoutBooking/model/httpCheckoutBookingsBook.js +18 -0
- package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +15 -0
- package/dist/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.js +15 -0
- package/dist/infrastructure/domain/checkoutBooking/react/useBookSizeReplaceableProductVariantsForCheckoutItem.d.ts +15 -0
- package/dist/infrastructure/domain/checkoutBooking/react/useBookSizeReplaceableProductVariantsForCheckoutItem.js +14 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItems.d.ts +16 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItems.js +26 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItemsKeep.d.ts +5 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItemsKeep.js +13 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItemsReplace.d.ts +5 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItemsReplace.js +13 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItemsReturn.d.ts +5 -0
- package/dist/infrastructure/domain/checkoutItem/model/httpCheckoutItemsReturn.js +13 -0
- package/dist/infrastructure/domain/checkoutItem/react/useKeepCheckoutItem.d.ts +13 -0
- package/dist/infrastructure/domain/checkoutItem/react/useKeepCheckoutItem.js +12 -0
- package/dist/infrastructure/domain/checkoutItem/react/useReplaceCheckoutItem.d.ts +16 -0
- package/dist/infrastructure/domain/checkoutItem/react/useReplaceCheckoutItem.js +13 -0
- package/dist/infrastructure/domain/checkoutItem/react/useReturnCheckoutItem.d.ts +17 -0
- package/dist/infrastructure/domain/checkoutItem/react/useReturnCheckoutItem.js +13 -0
- package/dist/infrastructure/domain/uiSetting/model/storageUiSettings.d.ts +17 -0
- package/dist/infrastructure/domain/uiSetting/model/storageUiSettings.js +20 -0
- package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.d.ts +10 -0
- package/dist/infrastructure/domain/uiSetting/react/useIncrementIntroShownCount.js +11 -0
- package/dist/infrastructure/domain/uiSetting/react/useUpdateUiSetting.d.ts +14 -0
- package/dist/infrastructure/domain/uiSetting/react/useUpdateUiSetting.js +15 -0
- package/dist/infrastructure/persistence/asyncStorageStorage.d.ts +5 -0
- package/dist/infrastructure/persistence/asyncStorageStorage.js +7 -0
- package/dist/infrastructure/persistence/storage.d.ts +7 -0
- package/dist/infrastructure/persistence/storage.js +1 -0
- package/dist/infrastructure/persistence/uiSettingData.d.ts +6 -0
- package/dist/infrastructure/persistence/uiSettingData.js +1 -0
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.d.ts +12 -0
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +9 -0
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.d.ts +10 -0
- package/dist/infrastructure/projection/bookedSizeChangeProductsVariants/react/useViewBookedSizeChangeProductsVariantsForCheckoutItem.js +9 -0
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/bookedSizeReplaceableProductVariants.mock.d.ts +3 -0
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/bookedSizeReplaceableProductVariants.mock.js +17 -0
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.d.ts +34 -0
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/httpBookedSizeReplaceableProductVariantsForCheckoutItemView.js +26 -0
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/react/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.d.ts +10 -0
- package/dist/infrastructure/projection/bookedSizeReplaceableProductVariants/react/useViewBookedSizeReplaceableProductVariantsForCheckoutItem.js +9 -0
- package/dist/infrastructure/projection/checkout/checkout.d.ts +18 -0
- package/dist/infrastructure/projection/checkout/checkout.js +5 -0
- package/dist/infrastructure/projection/checkout/httpCheckoutByIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkout/httpCheckoutByIdView.js +10 -0
- package/dist/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.js +10 -0
- package/dist/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.js +8 -0
- package/dist/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.js +8 -0
- package/dist/infrastructure/projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId.d.ts +10 -0
- package/dist/infrastructure/projection/checkout/react/useViewFirstAvailableCheckoutByCustomerId.js +14 -0
- package/dist/infrastructure/projection/checkout/react/useViewFiveItemsDiscountByCustomerId.d.ts +10 -0
- package/dist/infrastructure/projection/checkout/react/useViewFiveItemsDiscountByCustomerId.js +9 -0
- package/dist/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +10 -0
- package/dist/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +9 -0
- package/dist/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.js +9 -0
- package/dist/infrastructure/projection/checkoutItem/checkoutItem.d.ts +45 -0
- package/dist/infrastructure/projection/checkoutItem/checkoutItem.js +40 -0
- package/dist/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.d.ts +12 -0
- package/dist/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.js +9 -0
- package/dist/infrastructure/projection/feedback/feedback.mock.d.ts +3 -0
- package/dist/infrastructure/projection/feedback/feedback.mock.js +6 -0
- package/dist/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.d.ts +12 -0
- package/dist/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.js +9 -0
- package/dist/infrastructure/projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId.d.ts +10 -0
- package/dist/infrastructure/projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId.js +9 -0
- package/dist/infrastructure/projection/returnQuestion/returnQuestion.d.ts +14 -0
- package/dist/infrastructure/projection/returnQuestion/returnQuestion.js +9 -0
- package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.d.ts +6 -0
- package/dist/infrastructure/projection/uiSetting/react/useShouldIntroBeShown.js +7 -0
- package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.d.ts +6 -0
- package/dist/infrastructure/projection/uiSetting/react/useViewIntroShownCount.js +9 -0
- package/dist/infrastructure/projection/uiSetting/react/useViewUiSettingByKey.d.ts +10 -0
- package/dist/infrastructure/projection/uiSetting/react/useViewUiSettingByKey.js +12 -0
- package/dist/infrastructure/projection/uiSetting/storageUiSettingByKeyView.d.ts +13 -0
- package/dist/infrastructure/projection/uiSetting/storageUiSettingByKeyView.js +15 -0
- package/dist/infrastructure/ui/Root.d.ts +20 -0
- package/dist/infrastructure/ui/Root.js +11 -0
- package/dist/infrastructure/ui/components/atoms/price/Price.d.ts +12 -0
- package/dist/infrastructure/ui/components/atoms/price/Price.js +28 -0
- package/dist/infrastructure/ui/components/atoms/price/Price.style.d.ts +13 -0
- package/dist/infrastructure/ui/components/atoms/price/Price.style.js +16 -0
- package/dist/infrastructure/ui/components/layouts/body/Body.d.ts +9 -0
- package/dist/infrastructure/ui/components/layouts/body/Body.js +7 -0
- package/dist/infrastructure/ui/components/layouts/body/Body.style.d.ts +7 -0
- package/dist/infrastructure/ui/components/layouts/body/Body.style.js +8 -0
- package/dist/infrastructure/ui/components/layouts/tabs/Tabs.d.ts +26 -0
- package/dist/infrastructure/ui/components/layouts/tabs/Tabs.js +47 -0
- package/dist/infrastructure/ui/components/layouts/tabs/Tabs.style.d.ts +32 -0
- package/dist/infrastructure/ui/components/layouts/tabs/Tabs.style.js +35 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.d.ts +9 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +8 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.d.ts +8 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.js +4 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback.d.ts +29 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionFeedback.js +27 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.d.ts +18 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.js +12 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +10 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.js +1 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.js +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +12 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.style.d.ts +8 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.style.js +11 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +34 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.d.ts +11 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.style.js +14 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.js +27 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.style.d.ts +12 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/HostStackReturnQuestionItem.style.js +15 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +15 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.style.d.ts +12 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.style.js +15 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +26 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.style.d.ts +10 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.style.js +13 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.d.ts +3 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +13 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.d.ts +22 -0
- package/dist/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +58 -0
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.d.ts +8 -0
- package/dist/infrastructure/ui/components/templates/SafeAreaScrollView.js +14 -0
- package/dist/infrastructure/ui/hooks/useMediaImage.d.ts +7 -0
- package/dist/infrastructure/ui/hooks/useMediaImage.js +12 -0
- package/dist/infrastructure/ui/i18n/i18n.d.ts +39 -0
- package/dist/infrastructure/ui/i18n/i18n.js +40 -0
- package/dist/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +9 -0
- package/dist/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +21 -0
- package/dist/infrastructure/ui/routing/CheckoutMiddleware.d.ts +9 -0
- package/dist/infrastructure/ui/routing/CheckoutMiddleware.js +47 -0
- package/dist/infrastructure/ui/routing/Routing.d.ts +12 -0
- package/dist/infrastructure/ui/routing/Routing.js +45 -0
- package/dist/infrastructure/ui/routing/router/Router.d.ts +1 -0
- package/dist/infrastructure/ui/routing/router/Router.js +1 -0
- package/dist/infrastructure/ui/routing/router/Router.native.d.ts +1 -0
- package/dist/infrastructure/ui/routing/router/Router.native.js +1 -0
- package/dist/infrastructure/ui/routing/routes.d.ts +6 -0
- package/dist/infrastructure/ui/routing/routes.js +7 -0
- package/dist/infrastructure/ui/settings/UISettings.d.ts +4 -0
- package/dist/infrastructure/ui/settings/UISettings.js +5 -0
- package/dist/infrastructure/ui/shared/components/atoms/error/Error.d.ts +10 -0
- package/dist/infrastructure/ui/shared/components/atoms/error/Error.js +5 -0
- package/dist/infrastructure/ui/shared/components/atoms/error/Error.style.d.ts +6 -0
- package/dist/infrastructure/ui/shared/components/atoms/error/Error.style.js +9 -0
- package/dist/infrastructure/ui/shared/components/atoms/field/Field.d.ts +14 -0
- package/dist/infrastructure/ui/shared/components/atoms/field/Field.js +29 -0
- package/dist/infrastructure/ui/shared/components/atoms/field/Field.style.d.ts +14 -0
- package/dist/infrastructure/ui/shared/components/atoms/field/Field.style.js +17 -0
- package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.d.ts +12 -0
- package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.js +7 -0
- package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.style.d.ts +13 -0
- package/dist/infrastructure/ui/shared/components/atoms/icon/Icon.style.js +16 -0
- package/dist/infrastructure/ui/shared/components/atoms/input/Input.d.ts +11 -0
- package/dist/infrastructure/ui/shared/components/atoms/input/Input.js +37 -0
- package/dist/infrastructure/ui/shared/components/atoms/input/Input.style.d.ts +19 -0
- package/dist/infrastructure/ui/shared/components/atoms/input/Input.style.js +26 -0
- package/dist/infrastructure/ui/shared/components/atoms/spinner/Spinner.d.ts +3 -0
- package/dist/infrastructure/ui/shared/components/atoms/spinner/Spinner.js +8 -0
- package/dist/infrastructure/ui/shared/components/atoms/spinner/Spinner.style.d.ts +9 -0
- package/dist/infrastructure/ui/shared/components/atoms/spinner/Spinner.style.js +10 -0
- package/dist/infrastructure/ui/shared/components/layouts/column/Column.d.ts +10 -0
- package/dist/infrastructure/ui/shared/components/layouts/column/Column.js +10 -0
- package/dist/infrastructure/ui/shared/components/layouts/column/Column.style.d.ts +12 -0
- package/dist/infrastructure/ui/shared/components/layouts/column/Column.style.js +23 -0
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.d.ts +20 -0
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.js +79 -0
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.style.d.ts +58 -0
- package/dist/infrastructure/ui/shared/components/layouts/modal/Modal.style.js +70 -0
- package/dist/infrastructure/ui/shared/components/layouts/row/Row.d.ts +6 -0
- package/dist/infrastructure/ui/shared/components/layouts/row/Row.js +10 -0
- package/dist/infrastructure/ui/shared/components/layouts/row/Row.style.d.ts +13 -0
- package/dist/infrastructure/ui/shared/components/layouts/row/Row.style.js +17 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Pagination.d.ts +14 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Pagination.js +11 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Pagination.style.d.ts +23 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Pagination.style.js +27 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Slider.d.ts +20 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Slider.js +132 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Slider.style.d.ts +11 -0
- package/dist/infrastructure/ui/shared/components/layouts/slider/Slider.style.js +12 -0
- package/dist/infrastructure/ui/shared/components/layouts/sticky/Sticky.d.ts +14 -0
- package/dist/infrastructure/ui/shared/components/layouts/sticky/Sticky.js +12 -0
- package/dist/infrastructure/ui/shared/components/layouts/sticky/Sticky.style.d.ts +46 -0
- package/dist/infrastructure/ui/shared/components/layouts/sticky/Sticky.style.js +33 -0
- package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.d.ts +16 -0
- package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.js +7 -0
- package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.style.d.ts +7 -0
- package/dist/infrastructure/ui/shared/components/molecules/buttonIcon/ButtonIcon.style.js +10 -0
- package/dist/infrastructure/ui/shared/components/molecules/inputField/InputField.d.ts +25 -0
- package/dist/infrastructure/ui/shared/components/molecules/inputField/InputField.js +26 -0
- package/dist/infrastructure/ui/shared/components/molecules/inputField/InputField.style.d.ts +17 -0
- package/dist/infrastructure/ui/shared/components/molecules/inputField/InputField.style.js +20 -0
- package/dist/infrastructure/ui/shared/components/molecules/selectField/SelectField.d.ts +26 -0
- package/dist/infrastructure/ui/shared/components/molecules/selectField/SelectField.js +26 -0
- package/dist/infrastructure/ui/shared/components/molecules/selectField/SelectField.style.d.ts +15 -0
- package/dist/infrastructure/ui/shared/components/molecules/selectField/SelectField.style.js +18 -0
- package/dist/infrastructure/ui/shared/hooks/useScreenSize.d.ts +4 -0
- package/dist/infrastructure/ui/shared/hooks/useScreenSize.js +9 -0
- package/dist/infrastructure/ui/theme/theme.d.ts +10 -0
- package/dist/infrastructure/ui/theme/theme.js +5 -0
- package/dist/infrastructure/ui/views/App.d.ts +6 -0
- package/dist/infrastructure/ui/views/App.js +6 -0
- package/dist/infrastructure/ui/views/intro/Intro.d.ts +6 -0
- package/dist/infrastructure/ui/views/intro/Intro.js +51 -0
- package/dist/infrastructure/ui/views/intro/Intro.style.d.ts +52 -0
- package/dist/infrastructure/ui/views/intro/Intro.style.js +55 -0
- package/dist/infrastructure/ui/views/item/Item.d.ts +7 -0
- package/dist/infrastructure/ui/views/item/Item.js +97 -0
- package/dist/infrastructure/ui/views/item/Item.style.d.ts +15 -0
- package/dist/infrastructure/ui/views/item/Item.style.js +18 -0
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.d.ts +10 -0
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.js +21 -0
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.style.d.ts +17 -0
- package/dist/infrastructure/ui/views/item/components/banner/CustomerDecissionBanner.style.js +20 -0
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.d.ts +8 -0
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.js +34 -0
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.d.ts +19 -0
- package/dist/infrastructure/ui/views/item/components/getOutOfCheckoutModal/GetOutOfCheckoutModal.style.js +22 -0
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.d.ts +18 -0
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.js +33 -0
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.style.d.ts +21 -0
- package/dist/infrastructure/ui/views/item/components/itemActions/ItemActions.style.js +24 -0
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.d.ts +13 -0
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.js +30 -0
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.d.ts +23 -0
- package/dist/infrastructure/ui/views/item/components/productVariant/ProductVariant.style.js +27 -0
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.d.ts +12 -0
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.js +26 -0
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.d.ts +19 -0
- package/dist/infrastructure/ui/views/item/components/productVariantDescription/ProductVariantDescription.style.js +22 -0
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.d.ts +7 -0
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.js +22 -0
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.d.ts +25 -0
- package/dist/infrastructure/ui/views/item/components/productVariantSlider/ProductVariantSlider.style.js +29 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.d.ts +10 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +32 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.d.ts +12 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.style.js +15 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +15 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +46 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +11 -0
- package/dist/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +14 -0
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.d.ts +7 -0
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.js +25 -0
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.d.ts +16 -0
- package/dist/infrastructure/ui/views/item/components/sizeChangeModal/SizeChangeModal.style.js +19 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.d.ts +7 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.js +25 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.d.ts +16 -0
- package/dist/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.style.js +19 -0
- package/dist/infrastructure/ui/views/summary/Summary.d.ts +6 -0
- package/dist/infrastructure/ui/views/summary/Summary.js +18 -0
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.d.ts +7 -0
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js +20 -0
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.d.ts +9 -0
- package/dist/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.style.js +12 -0
- package/dist/package.json +1 -1
- package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +13 -0
- package/dist/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.js +1 -0
- package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.d.ts +25 -0
- package/dist/projection/bookedSizeChangeProductsVariants/viewBookedSizeChangeProductVariantsForCheckoutItem.js +8 -0
- package/dist/projection/bookedSizeReplaceableProductVariants/viewBookedSizeReplaceableProductVariantsForCheckoutItem.d.ts +33 -0
- package/dist/projection/bookedSizeReplaceableProductVariants/viewBookedSizeReplaceableProductVariantsForCheckoutItem.js +8 -0
- package/dist/projection/checkout/checkout.d.ts +12 -0
- package/dist/projection/checkout/checkout.js +1 -0
- package/dist/projection/checkout/viewCheckoutById.d.ts +25 -0
- package/dist/projection/checkout/viewCheckoutById.js +8 -0
- package/dist/projection/checkout/viewFirstAvailableCheckoutByCustomerId.d.ts +25 -0
- package/dist/projection/checkout/viewFirstAvailableCheckoutByCustomerId.js +8 -0
- package/dist/projection/checkout/viewFiveItemsDiscountByCustomerId.d.ts +24 -0
- package/dist/projection/checkout/viewFiveItemsDiscountByCustomerId.js +8 -0
- package/dist/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +17 -0
- package/dist/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +13 -0
- package/dist/projection/checkout/viewIsCheckoutEnabledByCustomerId.d.ts +24 -0
- package/dist/projection/checkout/viewIsCheckoutEnabledByCustomerId.js +8 -0
- package/dist/projection/checkoutBooking/checkoutBooking.d.ts +6 -0
- package/dist/projection/checkoutBooking/checkoutBooking.js +1 -0
- package/dist/projection/checkoutBooking/viewCheckoutBookingById.d.ts +25 -0
- package/dist/projection/checkoutBooking/viewCheckoutBookingById.js +8 -0
- package/dist/projection/checkoutItem/checkoutItem.d.ts +53 -0
- package/dist/projection/checkoutItem/checkoutItem.js +17 -0
- package/dist/projection/checkoutItem/viewCheckoutItemById.d.ts +25 -0
- package/dist/projection/checkoutItem/viewCheckoutItemById.js +8 -0
- package/dist/projection/feedback/feedback.d.ts +3 -0
- package/dist/projection/feedback/feedback.js +1 -0
- package/dist/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.d.ts +25 -0
- package/dist/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.js +8 -0
- package/dist/projection/returnQuestion/returnQuestion.d.ts +17 -0
- package/dist/projection/returnQuestion/returnQuestion.js +11 -0
- package/dist/projection/shared/size.d.ts +10 -0
- package/dist/projection/shared/size.js +1 -0
- package/dist/projection/uiSetting/viewUiSettingByKey.d.ts +29 -0
- package/dist/projection/uiSetting/viewUiSettingByKey.js +8 -0
- package/dist/src/ExpoRoot.js +10 -2
- package/dist/src/domain/checkout/model/checkout.d.ts +2 -3
- package/dist/src/domain/checkout/model/checkout.js +0 -1
- package/dist/src/domain/checkoutBooking/model/checkoutBooking.d.ts +1 -5
- package/dist/src/domain/checkoutBooking/model/checkoutBooking.js +1 -17
- package/dist/src/domain/checkoutItem/command/replaceCheckoutItem.d.ts +1 -1
- package/dist/src/domain/checkoutItem/model/checkoutItem.d.ts +1 -1
- package/dist/src/domain/checkoutItem/model/checkoutItem.js +2 -2
- package/dist/src/infrastructure/delivery/baseBootstrap.d.ts +0 -2
- package/dist/src/infrastructure/delivery/baseBootstrap.js +2 -8
- package/dist/src/infrastructure/delivery/bootstrap.js +0 -2
- package/dist/src/infrastructure/delivery/mock/dataSourceCheckoutBookings.js +1 -5
- package/dist/src/infrastructure/delivery/mock/dataSourceCheckoutItems.js +0 -2
- package/dist/src/infrastructure/delivery/mock/dataSourceCheckouts.js +2 -2
- package/dist/src/infrastructure/domain/checkout/model/httpCheckouts.js +1 -1
- package/dist/src/infrastructure/domain/checkoutBooking/model/httpCheckoutBookings.js +2 -9
- package/dist/src/infrastructure/domain/checkoutBooking/react/useBookCheckouBookingForCheckoutItem.d.ts +13 -0
- package/dist/src/infrastructure/domain/checkoutBooking/react/{useBookCheckoutBookingForCheckoutItem.js → useBookCheckouBookingForCheckoutItem.js} +2 -2
- package/dist/src/infrastructure/domain/checkoutItem/model/httpCheckoutItems.js +1 -1
- package/dist/src/infrastructure/domain/checkoutItem/model/httpCheckoutItemsReplace.js +2 -2
- package/dist/src/infrastructure/domain/checkoutItem/react/useReplaceCheckoutItem.d.ts +1 -1
- package/dist/src/infrastructure/domain/checkoutItem/react/useReplaceCheckoutItem.js +2 -2
- package/dist/src/infrastructure/projection/bookedSizeChangeProductsVariants/httpBookedSizeChangeProductsVariantsForCheckoutItemView.js +1 -1
- package/dist/src/infrastructure/projection/checkout/checkout.d.ts +1 -1
- package/dist/src/infrastructure/projection/pricing/react/useViewPricingByCheckoutId.js +1 -9
- package/dist/src/infrastructure/ui/Root.d.ts +2 -0
- package/dist/src/infrastructure/ui/Root.js +2 -2
- package/dist/src/infrastructure/ui/routing/CheckoutMiddleware.js +9 -7
- package/dist/src/infrastructure/ui/routing/Routing.d.ts +2 -0
- package/dist/src/infrastructure/ui/routing/Routing.js +2 -2
- package/dist/src/infrastructure/ui/views/App.d.ts +2 -0
- package/dist/src/infrastructure/ui/views/App.js +2 -2
- package/dist/src/infrastructure/ui/views/header/Header.d.ts +7 -0
- package/dist/src/infrastructure/ui/views/header/Header.js +8 -6
- package/dist/src/infrastructure/ui/views/item/Item.js +25 -49
- package/dist/src/infrastructure/ui/views/summary/components/checkoutItemsTabs/CheckoutItemsTabs.js +4 -7
- package/dist/src/infrastructure/ui/views/summary/components/pricing/Pricing.js +2 -2
- package/dist/src/projection/bookedSizeChangeProductsVariants/bookedSizeChangeProductsVariants.d.ts +1 -0
- package/dist/src/projection/checkout/checkout.d.ts +1 -1
- package/dist/src/projection/checkoutBooking/checkoutBooking.d.ts +0 -2
- package/dist/src/projection/checkoutItem/checkoutItem.d.ts +1 -1
- package/dist/src/projection/pricing/pricing.d.ts +3 -3
- package/package.json +1 -1
- package/dist/src/domain/checkoutBooking/command/blockCheckoutBooking.d.ts +0 -13
- package/dist/src/domain/checkoutBooking/command/blockCheckoutBooking.js +0 -4
- package/dist/src/domain/checkoutBooking/model/checkoutBookingBlocked.d.ts +0 -13
- package/dist/src/domain/checkoutBooking/model/checkoutBookingBlocked.js +0 -4
- package/dist/src/domain/checkoutBooking/model/checkoutBookingExpired.d.ts +0 -13
- package/dist/src/domain/checkoutBooking/model/checkoutBookingExpired.js +0 -4
- package/dist/src/infrastructure/domain/checkoutBooking/model/httpCheckoutBookingsBlock.d.ts +0 -5
- package/dist/src/infrastructure/domain/checkoutBooking/model/httpCheckoutBookingsBlock.js +0 -15
- package/dist/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.d.ts +0 -13
- package/dist/src/infrastructure/domain/checkoutBooking/react/useBlockCheckoutBooking.js +0 -12
- package/dist/src/infrastructure/domain/checkoutBooking/react/useBookCheckoutBookingForCheckoutItem.d.ts +0 -13
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { useScreenSize } from "../../../hooks/useScreenSize";
|
|
4
|
+
import { style } from "./Column.style";
|
|
5
|
+
const Column = ({ children, style: customStyle, size = { M: "2/3", L: "1/3" } }) => {
|
|
6
|
+
const screenSize = useScreenSize();
|
|
7
|
+
const columnSizeForScreenSize = size[screenSize];
|
|
8
|
+
return (React.createElement(View, { style: [style.column, columnSizeForScreenSize && style[columnSizeForScreenSize], customStyle] }, children));
|
|
9
|
+
};
|
|
10
|
+
export { Column };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
const stylesForColumSize = {
|
|
3
|
+
["1/4"]: {
|
|
4
|
+
maxWidth: `${100 * (1 / 4)}%`,
|
|
5
|
+
},
|
|
6
|
+
["1/3"]: {
|
|
7
|
+
maxWidth: `${100 * (1 / 3)}%`,
|
|
8
|
+
},
|
|
9
|
+
["1/2"]: {
|
|
10
|
+
maxWidth: `${100 * (1 / 2)}%`,
|
|
11
|
+
},
|
|
12
|
+
["2/3"]: {
|
|
13
|
+
maxWidth: `${100 * (2 / 3)}%`,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
const style = StyleSheet.create({
|
|
17
|
+
column: {
|
|
18
|
+
flex: 1,
|
|
19
|
+
width: "100%",
|
|
20
|
+
},
|
|
21
|
+
...stylesForColumSize,
|
|
22
|
+
});
|
|
23
|
+
export { style };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
import { ScreenSize } from "../../../hooks/useScreenSize";
|
|
4
|
+
declare type ColumnSize = "1/4" | "1/3" | "1/2" | "2/3";
|
|
5
|
+
declare type ModalStyle = "overlay" | "row" | "modal" | "header" | "closeButton";
|
|
6
|
+
interface ModalProps {
|
|
7
|
+
readonly children: ReactNode;
|
|
8
|
+
readonly visible: boolean;
|
|
9
|
+
readonly onClose: () => void;
|
|
10
|
+
readonly showCloseButton?: boolean;
|
|
11
|
+
readonly header?: ReactNode;
|
|
12
|
+
readonly footer?: ReactNode;
|
|
13
|
+
readonly portalHostName?: string;
|
|
14
|
+
readonly scroll?: boolean;
|
|
15
|
+
readonly size?: Partial<Record<ScreenSize, ColumnSize>>;
|
|
16
|
+
readonly style?: Partial<Record<ModalStyle, StyleProp<ViewStyle>>>;
|
|
17
|
+
}
|
|
18
|
+
declare const Modal: FC<ModalProps>;
|
|
19
|
+
export type { ColumnSize };
|
|
20
|
+
export { Modal };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Portal } from "@gorhom/portal";
|
|
2
|
+
import { useBack } from "@lookiero/aurora-next/build/hooks/useBack/useBack";
|
|
3
|
+
import { animated, useTransition } from "@react-spring/native";
|
|
4
|
+
import React, { useCallback, useMemo, useState } from "react";
|
|
5
|
+
import { Dimensions, Platform, ScrollView, TouchableWithoutFeedback, View, } from "react-native";
|
|
6
|
+
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
|
|
7
|
+
import { theme } from "../../../../theme/theme";
|
|
8
|
+
import { useScreenSize } from "../../../hooks/useScreenSize";
|
|
9
|
+
import { ButtonIcon } from "../../molecules/buttonIcon/ButtonIcon";
|
|
10
|
+
import { Row } from "../row/Row";
|
|
11
|
+
import { Sticky } from "../sticky/Sticky";
|
|
12
|
+
import { style } from "./Modal.style";
|
|
13
|
+
const { spaceXXL } = theme();
|
|
14
|
+
const TRANSITION_MODAL_SCALE = 0.9;
|
|
15
|
+
const DEFAULT_SAFEAREA_INSET_TOP = spaceXXL;
|
|
16
|
+
const Modal = ({ children, visible, header, footer, portalHostName, onClose, showCloseButton = false, size = { M: "2/3", L: "1/3" }, style: customStyle, scroll = false, }) => {
|
|
17
|
+
const { height: screenHeight } = Dimensions.get(Platform.OS === "web" ? "window" : "screen");
|
|
18
|
+
const { top: safeAreaInsetTop, bottom: safeAreaInsetBottom } = useSafeAreaInsets();
|
|
19
|
+
// On Android safeAreaInsetTop won't return the actual value.
|
|
20
|
+
const screenSizeWithoutInsets = screenHeight - (Platform.OS === "android" ? DEFAULT_SAFEAREA_INSET_TOP : safeAreaInsetTop);
|
|
21
|
+
const screenSize = useScreenSize();
|
|
22
|
+
const isSmallDevice = screenSize === "S";
|
|
23
|
+
const columnSizeForScreenSize = size[screenSize];
|
|
24
|
+
const handleHardwareBackPress = useCallback(() => {
|
|
25
|
+
if (!visible) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
onClose();
|
|
29
|
+
return true; // The event will not be bubbled up
|
|
30
|
+
}, [onClose, visible]);
|
|
31
|
+
useBack(handleHardwareBackPress);
|
|
32
|
+
const [modalHeight, setModalHeight] = useState();
|
|
33
|
+
const handleOnModalLayout = useCallback(({ nativeEvent: { layout: { height }, }, }) => setModalHeight(height), []);
|
|
34
|
+
const [footerHeight, setFooterHeight] = useState(0);
|
|
35
|
+
const handleOnFooterLayout = useCallback(({ height }) => setFooterHeight(height), []);
|
|
36
|
+
const transitions = useTransition(visible, {
|
|
37
|
+
from: isSmallDevice
|
|
38
|
+
? {
|
|
39
|
+
modalOpacity: 1,
|
|
40
|
+
overlayOpacity: 0,
|
|
41
|
+
modalTranslateY: (modalHeight || screenHeight) + safeAreaInsetBottom,
|
|
42
|
+
modalScale: 1,
|
|
43
|
+
}
|
|
44
|
+
: { modalOpacity: 0, overlayOpacity: 0, modalTranslateY: 0, modalScale: TRANSITION_MODAL_SCALE },
|
|
45
|
+
enter: { modalOpacity: 1, overlayOpacity: 1, modalTranslateY: 0, modalScale: 1 },
|
|
46
|
+
leave: isSmallDevice
|
|
47
|
+
? {
|
|
48
|
+
modalOpacity: 1,
|
|
49
|
+
overlayOpacity: 0,
|
|
50
|
+
modalTranslateY: (modalHeight || screenHeight) + safeAreaInsetBottom,
|
|
51
|
+
modalScale: 1,
|
|
52
|
+
}
|
|
53
|
+
: { modalOpacity: 0, overlayOpacity: 0, modalTranslateY: 0, modalScale: TRANSITION_MODAL_SCALE },
|
|
54
|
+
unique: true,
|
|
55
|
+
});
|
|
56
|
+
const ModalContentView = useMemo(() => (scroll ? ScrollView : View), [scroll]);
|
|
57
|
+
return (React.createElement(Portal, { hostName: portalHostName }, transitions(({ modalOpacity, overlayOpacity, modalTranslateY, modalScale }, item) => item && (React.createElement(View, { pointerEvents: visible ? "auto" : "none", style: style.container, testID: "modal" },
|
|
58
|
+
React.createElement(TouchableWithoutFeedback, { onPress: visible ? onClose : undefined },
|
|
59
|
+
React.createElement(animated.View, { style: [style.overlay, { opacity: overlayOpacity }, customStyle?.overlay] })),
|
|
60
|
+
React.createElement(SafeAreaView, { edges: ["right", "top", "left"], pointerEvents: "box-none", style: style.safeArea },
|
|
61
|
+
React.createElement(Row, { pointerEvents: "box-none", style: [style.row, isSmallDevice && style.rowSmall, customStyle?.row] },
|
|
62
|
+
React.createElement(animated.View, { pointerEvents: visible ? "auto" : "none", style: [
|
|
63
|
+
style.modal,
|
|
64
|
+
columnSizeForScreenSize && style[columnSizeForScreenSize],
|
|
65
|
+
{
|
|
66
|
+
opacity: modalOpacity,
|
|
67
|
+
transform: [{ translateY: modalTranslateY }, { scale: modalScale }],
|
|
68
|
+
maxHeight: screenSizeWithoutInsets,
|
|
69
|
+
},
|
|
70
|
+
customStyle?.modal,
|
|
71
|
+
], onLayout: handleOnModalLayout },
|
|
72
|
+
(header || showCloseButton) && (React.createElement(View, { style: [style.header, customStyle?.header] },
|
|
73
|
+
React.createElement(View, null, header),
|
|
74
|
+
showCloseButton && (React.createElement(ButtonIcon, { name: "close", style: { button: customStyle?.closeButton }, onPress: onClose })))),
|
|
75
|
+
React.createElement(ModalContentView, null,
|
|
76
|
+
React.createElement(View, { style: { paddingBottom: safeAreaInsetBottom + footerHeight } }, children)),
|
|
77
|
+
footer && (React.createElement(Sticky, { style: style.stickyFooter, onLayout: handleOnFooterLayout }, footer))))))))));
|
|
78
|
+
};
|
|
79
|
+
export { Modal };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { StyleSheet, ViewStyle } from "react-native";
|
|
2
|
+
declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
|
|
3
|
+
overlay: {
|
|
4
|
+
height: string;
|
|
5
|
+
position: "absolute";
|
|
6
|
+
width: string;
|
|
7
|
+
zIndex: number;
|
|
8
|
+
cursor?: string | undefined;
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
};
|
|
11
|
+
row: {
|
|
12
|
+
alignContent: "center";
|
|
13
|
+
flex: number;
|
|
14
|
+
justifyContent: "center";
|
|
15
|
+
};
|
|
16
|
+
rowSmall: {
|
|
17
|
+
justifyContent: "flex-end";
|
|
18
|
+
};
|
|
19
|
+
safeArea: {
|
|
20
|
+
flex: number;
|
|
21
|
+
zIndex: number;
|
|
22
|
+
};
|
|
23
|
+
stickyFooter: {
|
|
24
|
+
paddingHorizontal: number;
|
|
25
|
+
};
|
|
26
|
+
"1/4": ViewStyle;
|
|
27
|
+
"1/3": ViewStyle;
|
|
28
|
+
"1/2": ViewStyle;
|
|
29
|
+
"2/3": ViewStyle;
|
|
30
|
+
container: {
|
|
31
|
+
width: string;
|
|
32
|
+
height: string;
|
|
33
|
+
overflow: "hidden";
|
|
34
|
+
} | {
|
|
35
|
+
width: string;
|
|
36
|
+
position: "fixed";
|
|
37
|
+
height: string;
|
|
38
|
+
overflow: "hidden";
|
|
39
|
+
} | {
|
|
40
|
+
width: string;
|
|
41
|
+
position: "absolute";
|
|
42
|
+
height: string;
|
|
43
|
+
overflow: "hidden";
|
|
44
|
+
};
|
|
45
|
+
header: {
|
|
46
|
+
alignItems: "center";
|
|
47
|
+
flexDirection: "row";
|
|
48
|
+
justifyContent: "space-between";
|
|
49
|
+
padding: number;
|
|
50
|
+
};
|
|
51
|
+
modal: {
|
|
52
|
+
backgroundColor: string;
|
|
53
|
+
position: "absolute";
|
|
54
|
+
width: string;
|
|
55
|
+
zIndex: number;
|
|
56
|
+
};
|
|
57
|
+
}>;
|
|
58
|
+
export { style };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Platform, StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "../../../../theme/theme";
|
|
3
|
+
const { colorBase, colorOverlay, spaceM, spaceXL } = theme();
|
|
4
|
+
const modalStylesForColumSize = {
|
|
5
|
+
["1/4"]: {
|
|
6
|
+
maxWidth: `${100 * (1 / 4)}%`,
|
|
7
|
+
},
|
|
8
|
+
["1/3"]: {
|
|
9
|
+
maxWidth: `${100 * (1 / 3)}%`,
|
|
10
|
+
},
|
|
11
|
+
["1/2"]: {
|
|
12
|
+
maxWidth: `${100 * (1 / 2)}%`,
|
|
13
|
+
},
|
|
14
|
+
["2/3"]: {
|
|
15
|
+
maxWidth: `${100 * (2 / 3)}%`,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
const style = StyleSheet.create({
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
container: {
|
|
22
|
+
height: "100%",
|
|
23
|
+
overflow: "hidden",
|
|
24
|
+
...Platform.select({
|
|
25
|
+
web: { position: "fixed" },
|
|
26
|
+
android: { position: "absolute" },
|
|
27
|
+
ios: { position: "absolute" },
|
|
28
|
+
}),
|
|
29
|
+
width: "100%",
|
|
30
|
+
},
|
|
31
|
+
header: {
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
flexDirection: "row",
|
|
34
|
+
justifyContent: "space-between",
|
|
35
|
+
padding: spaceM,
|
|
36
|
+
},
|
|
37
|
+
modal: {
|
|
38
|
+
backgroundColor: colorBase,
|
|
39
|
+
position: "absolute",
|
|
40
|
+
width: "100%",
|
|
41
|
+
zIndex: 3,
|
|
42
|
+
},
|
|
43
|
+
...modalStylesForColumSize,
|
|
44
|
+
overlay: {
|
|
45
|
+
backgroundColor: colorOverlay,
|
|
46
|
+
...Platform.select({
|
|
47
|
+
web: { cursor: "pointer" },
|
|
48
|
+
}),
|
|
49
|
+
height: "100%",
|
|
50
|
+
position: "absolute",
|
|
51
|
+
width: "100%",
|
|
52
|
+
zIndex: 1,
|
|
53
|
+
},
|
|
54
|
+
row: {
|
|
55
|
+
alignContent: "center",
|
|
56
|
+
flex: 1,
|
|
57
|
+
justifyContent: "center",
|
|
58
|
+
},
|
|
59
|
+
rowSmall: {
|
|
60
|
+
justifyContent: "flex-end",
|
|
61
|
+
},
|
|
62
|
+
safeArea: {
|
|
63
|
+
flex: 1,
|
|
64
|
+
zIndex: 2,
|
|
65
|
+
},
|
|
66
|
+
stickyFooter: {
|
|
67
|
+
paddingHorizontal: spaceXL,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
export { style };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { useScreenSize } from "../../../hooks/useScreenSize";
|
|
4
|
+
import { style } from "./Row.style";
|
|
5
|
+
const Row = ({ children, style: customStyle, ...restProps }) => {
|
|
6
|
+
const screenSize = useScreenSize();
|
|
7
|
+
const largeStyle = screenSize !== "S" && style.rowLarge;
|
|
8
|
+
return (React.createElement(View, { style: [style.row, largeStyle, customStyle], ...restProps }, children));
|
|
9
|
+
};
|
|
10
|
+
export { Row };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "../../../../theme/theme";
|
|
3
|
+
const { spaceXXL, layoutMaxWidth } = theme();
|
|
4
|
+
const rowLargeMaxWidth = layoutMaxWidth - 2 * spaceXXL;
|
|
5
|
+
const style = StyleSheet.create({
|
|
6
|
+
row: {
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
flexWrap: "wrap",
|
|
9
|
+
marginHorizontal: "auto",
|
|
10
|
+
maxWidth: layoutMaxWidth,
|
|
11
|
+
width: "100%",
|
|
12
|
+
},
|
|
13
|
+
rowLarge: {
|
|
14
|
+
maxWidth: rowLargeMaxWidth,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
export { style };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
interface PaginationProps {
|
|
4
|
+
readonly touchable?: boolean;
|
|
5
|
+
readonly paginationStyle?: StyleProp<ViewStyle>;
|
|
6
|
+
readonly paginationItemStyle?: StyleProp<ViewStyle>;
|
|
7
|
+
readonly paginationActiveItemStyle?: StyleProp<ViewStyle>;
|
|
8
|
+
readonly count?: number;
|
|
9
|
+
readonly activeIndex?: number;
|
|
10
|
+
readonly onChange: (index: number) => void;
|
|
11
|
+
readonly renderItem?: (index: number) => ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare const Pagination: FC<PaginationProps>;
|
|
14
|
+
export { Pagination };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Pressable, View } from "react-native";
|
|
3
|
+
import { style } from "./Pagination.style";
|
|
4
|
+
const Pagination = ({ touchable = true, paginationStyle, paginationItemStyle, paginationActiveItemStyle, count = 0, activeIndex = 0, renderItem, onChange, }) => (React.createElement(View, { style: [style.paginationWrapper, paginationStyle], testID: "slider-pagination" }, Array.from(Array(count).keys()).map((index) => (React.createElement(View, { key: index, style: style.paginationContainer },
|
|
5
|
+
React.createElement(Pressable, { testID: "slider-pagination-item", style: [
|
|
6
|
+
style.paginationItem,
|
|
7
|
+
activeIndex === index && style.active,
|
|
8
|
+
paginationItemStyle,
|
|
9
|
+
activeIndex === index && paginationActiveItemStyle,
|
|
10
|
+
], onPress: !touchable ? undefined : () => onChange(index) }, renderItem?.(index)))))));
|
|
11
|
+
export { Pagination };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const style: {
|
|
2
|
+
active: {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
};
|
|
5
|
+
paginationContainer: {
|
|
6
|
+
margin: number;
|
|
7
|
+
};
|
|
8
|
+
paginationItem: {
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
borderRadius: number;
|
|
11
|
+
height: number;
|
|
12
|
+
width: number;
|
|
13
|
+
};
|
|
14
|
+
paginationWrapper: {
|
|
15
|
+
alignItems: "center";
|
|
16
|
+
bottom: number;
|
|
17
|
+
flexDirection: "row";
|
|
18
|
+
justifyContent: "center";
|
|
19
|
+
position: "absolute";
|
|
20
|
+
width: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export { style };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
import { theme } from "../../../../theme/theme";
|
|
3
|
+
const { colorGrayscaleS, colorGrayscaleXL } = theme();
|
|
4
|
+
const DOT_SIZE = 8;
|
|
5
|
+
const style = StyleSheet.create({
|
|
6
|
+
active: {
|
|
7
|
+
backgroundColor: colorGrayscaleXL,
|
|
8
|
+
},
|
|
9
|
+
paginationContainer: {
|
|
10
|
+
margin: 3,
|
|
11
|
+
},
|
|
12
|
+
paginationItem: {
|
|
13
|
+
backgroundColor: colorGrayscaleS,
|
|
14
|
+
borderRadius: DOT_SIZE / 2,
|
|
15
|
+
height: DOT_SIZE,
|
|
16
|
+
width: DOT_SIZE,
|
|
17
|
+
},
|
|
18
|
+
paginationWrapper: {
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
bottom: 10,
|
|
21
|
+
flexDirection: "row",
|
|
22
|
+
justifyContent: "center",
|
|
23
|
+
position: "absolute",
|
|
24
|
+
width: "100%",
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
export { style };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
interface SliderProps {
|
|
4
|
+
readonly children: ReactNode[];
|
|
5
|
+
readonly active?: number;
|
|
6
|
+
readonly loop?: boolean;
|
|
7
|
+
readonly minDistanceToCapture?: number;
|
|
8
|
+
readonly minDistanceForAction?: number;
|
|
9
|
+
readonly gesturesEnabled?: boolean;
|
|
10
|
+
readonly paginationEnabled?: boolean;
|
|
11
|
+
readonly paginationStyle?: StyleProp<ViewStyle>;
|
|
12
|
+
readonly paginationItemStyle?: StyleProp<ViewStyle>;
|
|
13
|
+
readonly paginationActiveItemStyle?: StyleProp<ViewStyle>;
|
|
14
|
+
readonly onSliderStart?: () => void;
|
|
15
|
+
readonly onSliderEnd?: () => void;
|
|
16
|
+
readonly onChanged?: (index: number) => void;
|
|
17
|
+
readonly paginationRenderItem?: (index: number) => ReactNode;
|
|
18
|
+
}
|
|
19
|
+
declare const Slider: FC<SliderProps>;
|
|
20
|
+
export { Slider };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { Animated, I18nManager, PanResponder, StyleSheet, View, } from "react-native";
|
|
3
|
+
import { Pagination } from "./Pagination";
|
|
4
|
+
import { style } from "./Slider.style";
|
|
5
|
+
const DEFAULT_WIDTH = 200;
|
|
6
|
+
const Slider = ({ children, active = 0, loop = false, minDistanceToCapture = 5, minDistanceForAction = 0.2, gesturesEnabled = true, paginationEnabled = true, paginationStyle, paginationItemStyle, paginationActiveItemStyle, onSliderStart, onSliderEnd, onChanged, paginationRenderItem, }) => {
|
|
7
|
+
const flatennedChildren = children.flat();
|
|
8
|
+
const count = flatennedChildren.length;
|
|
9
|
+
const [width, setWidth] = useState(0);
|
|
10
|
+
const widthRef = useRef(width);
|
|
11
|
+
const activeIndex = useRef(active);
|
|
12
|
+
const animatedValueX = useRef(0);
|
|
13
|
+
const animatedValueY = useRef(0);
|
|
14
|
+
const pan = useRef(new Animated.ValueXY()).current;
|
|
15
|
+
const started = useRef(false);
|
|
16
|
+
const panResponder = useRef(PanResponder.create({
|
|
17
|
+
onPanResponderTerminationRequest: () => false,
|
|
18
|
+
onMoveShouldSetPanResponder: () => gesturesEnabled,
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
20
|
+
onMoveShouldSetPanResponderCapture: (_e, gestureState) => {
|
|
21
|
+
if (!gesturesEnabled) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
startAnimation();
|
|
25
|
+
const allow = Math.abs(gestureState.dx) > minDistanceToCapture;
|
|
26
|
+
return allow;
|
|
27
|
+
},
|
|
28
|
+
onPanResponderGrant: () => fixState(),
|
|
29
|
+
onPanResponderMove: Animated.event([null, { dx: pan.x }], {
|
|
30
|
+
useNativeDriver: false,
|
|
31
|
+
}),
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
33
|
+
onPanResponderRelease: (_e, gesture) => {
|
|
34
|
+
const correction = gesture.moveX - gesture.x0;
|
|
35
|
+
if (Math.abs(correction) < widthRef.current * minDistanceForAction) {
|
|
36
|
+
spring({ x: 0, y: 0 });
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
changeIndex(correction > 0 ? (I18nManager.isRTL ? 1 : -1) : I18nManager.isRTL ? -1 : 1);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
onPanResponderEnd: () => endAnimation(),
|
|
43
|
+
})).current;
|
|
44
|
+
const startAnimation = useCallback(() => {
|
|
45
|
+
if (!started.current) {
|
|
46
|
+
onSliderStart?.();
|
|
47
|
+
started.current = true;
|
|
48
|
+
}
|
|
49
|
+
}, [onSliderStart]);
|
|
50
|
+
const endAnimation = useCallback(() => {
|
|
51
|
+
if (started.current) {
|
|
52
|
+
onSliderEnd?.();
|
|
53
|
+
started.current = false;
|
|
54
|
+
}
|
|
55
|
+
}, [onSliderEnd]);
|
|
56
|
+
const fixState = useCallback(() => {
|
|
57
|
+
animatedValueX.current = widthRef.current * activeIndex.current * (I18nManager.isRTL ? 1 : -1);
|
|
58
|
+
animatedValueY.current = 0;
|
|
59
|
+
pan.setOffset({
|
|
60
|
+
x: animatedValueX.current,
|
|
61
|
+
y: animatedValueY.current,
|
|
62
|
+
});
|
|
63
|
+
pan.setValue({ x: 0, y: 0 });
|
|
64
|
+
}, [pan]);
|
|
65
|
+
const spring = useCallback((toValue) => {
|
|
66
|
+
Animated.spring(pan, {
|
|
67
|
+
toValue,
|
|
68
|
+
useNativeDriver: false,
|
|
69
|
+
}).start();
|
|
70
|
+
}, [pan]);
|
|
71
|
+
const changeIndex = useCallback((delta = 1) => {
|
|
72
|
+
const toValue = { x: 0, y: 0 };
|
|
73
|
+
let skipChanges = !delta;
|
|
74
|
+
let calcDelta = delta;
|
|
75
|
+
if (activeIndex.current <= 0 && delta < 0) {
|
|
76
|
+
skipChanges = !loop;
|
|
77
|
+
calcDelta = count + delta;
|
|
78
|
+
}
|
|
79
|
+
else if (activeIndex.current + 1 >= count && delta > 0) {
|
|
80
|
+
skipChanges = !loop;
|
|
81
|
+
calcDelta = -1 * activeIndex.current + delta - 1;
|
|
82
|
+
}
|
|
83
|
+
if (skipChanges) {
|
|
84
|
+
return spring(toValue);
|
|
85
|
+
}
|
|
86
|
+
const index = activeIndex.current + calcDelta;
|
|
87
|
+
activeIndex.current = index;
|
|
88
|
+
toValue.x = widthRef.current * (I18nManager.isRTL ? 1 : -1) * calcDelta;
|
|
89
|
+
spring(toValue);
|
|
90
|
+
onChanged?.(index);
|
|
91
|
+
}, [count, loop, onChanged, spring]);
|
|
92
|
+
const fixAndGo = useCallback((delta) => {
|
|
93
|
+
fixState();
|
|
94
|
+
startAnimation();
|
|
95
|
+
changeIndex(delta);
|
|
96
|
+
}, [changeIndex, fixState, startAnimation]);
|
|
97
|
+
const goTo = useCallback((index = 0) => {
|
|
98
|
+
const delta = index - activeIndex.current;
|
|
99
|
+
if (delta) {
|
|
100
|
+
fixAndGo(delta);
|
|
101
|
+
}
|
|
102
|
+
}, [fixAndGo]);
|
|
103
|
+
const getActiveIndex = useCallback(() => activeIndex.current, []);
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
pan.x.addListener(({ value }) => (animatedValueX.current = value));
|
|
106
|
+
pan.y.addListener(({ value }) => (animatedValueY.current = value));
|
|
107
|
+
return () => {
|
|
108
|
+
pan.x.removeAllListeners();
|
|
109
|
+
pan.y.removeAllListeners();
|
|
110
|
+
};
|
|
111
|
+
}, [pan.x, pan.y]);
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (activeIndex.current !== active) {
|
|
114
|
+
goTo(active);
|
|
115
|
+
}
|
|
116
|
+
}, [active, goTo]);
|
|
117
|
+
const onLayoutWrapper = useCallback(({ nativeEvent: { layout: { width: wrapperWidth }, }, }) => {
|
|
118
|
+
const width = wrapperWidth || DEFAULT_WIDTH;
|
|
119
|
+
setWidth(width);
|
|
120
|
+
widthRef.current = width;
|
|
121
|
+
fixState();
|
|
122
|
+
}, [fixState]);
|
|
123
|
+
return (React.createElement(View, { style: style.container, testID: "slider", onLayout: onLayoutWrapper },
|
|
124
|
+
React.createElement(Animated.View, { style: StyleSheet.flatten([
|
|
125
|
+
{
|
|
126
|
+
transform: [{ translateX: pan.x }, { translateY: pan.y }],
|
|
127
|
+
},
|
|
128
|
+
style.sliderAreaStyle,
|
|
129
|
+
]), ...panResponder.panHandlers }, flatennedChildren.map((child, index) => (React.createElement(View, { key: index, style: { width }, testID: "slider-child" }, child)))),
|
|
130
|
+
paginationEnabled && (React.createElement(Pagination, { activeIndex: getActiveIndex(), count: count, paginationActiveItemStyle: paginationActiveItemStyle, paginationItemStyle: paginationItemStyle, paginationStyle: paginationStyle, renderItem: paginationRenderItem, onChange: (index) => goTo(index) }))));
|
|
131
|
+
};
|
|
132
|
+
export { Slider };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
interface Layout {
|
|
4
|
+
readonly width: number;
|
|
5
|
+
readonly height: number;
|
|
6
|
+
}
|
|
7
|
+
interface StickyProps {
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
10
|
+
readonly onLayout?: ({ width, height }: Layout) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const Sticky: FC<StickyProps>;
|
|
13
|
+
export type { Layout };
|
|
14
|
+
export { Sticky };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { useCallback } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
4
|
+
import { theme } from "../../../../theme/theme";
|
|
5
|
+
import { style } from "./Sticky.style";
|
|
6
|
+
const { spaceL } = theme();
|
|
7
|
+
const Sticky = ({ children, style: customStyle, onLayout }) => {
|
|
8
|
+
const { bottom: safeAreaInsetBottom } = useSafeAreaInsets();
|
|
9
|
+
const handleOnLayout = useCallback(({ nativeEvent: { layout: { width, height }, }, }) => onLayout?.({ width, height }), [onLayout]);
|
|
10
|
+
return (React.createElement(View, { style: [style.sticky, { paddingBottom: safeAreaInsetBottom + spaceL }, customStyle], onLayout: handleOnLayout }, children));
|
|
11
|
+
};
|
|
12
|
+
export { Sticky };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
declare const style: StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
|
|
3
|
+
sticky: {
|
|
4
|
+
backgroundColor: string;
|
|
5
|
+
bottom: number;
|
|
6
|
+
elevation: number;
|
|
7
|
+
paddingTop: number;
|
|
8
|
+
shadowColor: string;
|
|
9
|
+
shadowOffset: {
|
|
10
|
+
height: number;
|
|
11
|
+
width: number;
|
|
12
|
+
};
|
|
13
|
+
shadowOpacity: number;
|
|
14
|
+
shadowRadius: number;
|
|
15
|
+
width: string;
|
|
16
|
+
} | {
|
|
17
|
+
position: "sticky";
|
|
18
|
+
backgroundColor: string;
|
|
19
|
+
bottom: number;
|
|
20
|
+
elevation: number;
|
|
21
|
+
paddingTop: number;
|
|
22
|
+
shadowColor: string;
|
|
23
|
+
shadowOffset: {
|
|
24
|
+
height: number;
|
|
25
|
+
width: number;
|
|
26
|
+
};
|
|
27
|
+
shadowOpacity: number;
|
|
28
|
+
shadowRadius: number;
|
|
29
|
+
width: string;
|
|
30
|
+
} | {
|
|
31
|
+
position: "absolute";
|
|
32
|
+
backgroundColor: string;
|
|
33
|
+
bottom: number;
|
|
34
|
+
elevation: number;
|
|
35
|
+
paddingTop: number;
|
|
36
|
+
shadowColor: string;
|
|
37
|
+
shadowOffset: {
|
|
38
|
+
height: number;
|
|
39
|
+
width: number;
|
|
40
|
+
};
|
|
41
|
+
shadowOpacity: number;
|
|
42
|
+
shadowRadius: number;
|
|
43
|
+
width: string;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
export { style };
|