@momo-kits/native-kits 0.163.1-beta.1-debug → 0.163.1-beta.10-debug
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/CLAUDE.md +1 -1
- package/compose/build.gradle.kts +12 -8
- package/compose/build.gradle.kts.backup +11 -7
- package/compose/compose.podspec +1 -1
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +7 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +30 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +2 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +6 -9
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +6 -24
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +4 -19
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +1 -10
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +5 -16
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +6 -101
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +6 -16
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +8 -33
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +56 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +22 -25
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +27 -29
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +3 -26
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +30 -31
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +3 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +3 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +3 -18
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +11 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +42 -65
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +69 -26
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +1 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +84 -59
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +13 -71
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +10 -51
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +6 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +4 -21
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +16 -75
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +5 -26
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +3 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +16 -40
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +3 -9
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -28
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +2 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +4 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +4 -10
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +3 -28
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +8 -47
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +4 -25
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +2 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +1 -17
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +1 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +50 -111
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +1 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +1 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +1 -12
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +4 -96
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +5 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +2 -12
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +9 -21
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +9 -14
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +8 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +19 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitFontScale.kt +22 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +11 -20
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +50 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +22 -21
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +37 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +94 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +5 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +4 -8
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +12 -16
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +121 -84
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +48 -33
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +88 -63
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +9 -14
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +13 -31
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +6 -24
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +11 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +2 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +9 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +3 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +3 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +1 -40
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +23 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +9 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +10 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +2 -17
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +3 -3
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +2 -3
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +66 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +26 -5
- package/gradle/libs.versions.toml +2 -0
- package/gradle.properties +1 -1
- package/ios/Application/ApplicationEnvironment.swift +15 -2
- package/ios/Application/Components.swift +50 -43
- package/ios/Application/FloatingButton.swift +10 -8
- package/ios/Application/HeaderRight.swift +79 -45
- package/ios/Application/Localize.swift +277 -0
- package/ios/Application/MaxApi.swift +18 -0
- package/ios/Application/Navigation/BottomTab/BottomTab.swift +104 -0
- package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +215 -0
- package/ios/Application/Navigation/BottomTab/CurvedContainer.swift +65 -0
- package/ios/Application/Navigation/HeaderBackProps.swift +66 -0
- package/ios/Application/Navigation/HeaderTitle.swift +57 -0
- package/ios/Application/Navigation/HeaderUser.swift +209 -0
- package/ios/Application/Navigation/NavigationContainer.swift +200 -0
- package/ios/Application/Navigation/NavigationOptions.swift +109 -0
- package/ios/Application/Navigation/Navigator.swift +385 -0
- package/ios/Application/Navigation/Overplay/BottomSheet.swift +256 -0
- package/ios/Application/Navigation/Overplay/ModalScreen.swift +74 -0
- package/ios/Application/Navigation/Overplay/SnackBar.swift +144 -0
- package/ios/Application/Navigation/Tracking/ScreenTracker.swift +117 -0
- package/ios/Application/Navigation/component/Header.swift +178 -0
- package/ios/Application/Navigation/component/HeaderBackground.swift +83 -0
- package/ios/Application/Navigation/component/HeaderColor.swift +65 -0
- package/ios/Application/Screen.swift +2 -1
- package/ios/Application/StackScreen.swift +501 -0
- package/ios/Avatar/Avatar.swift +193 -0
- package/ios/Badge/Badge.swift +11 -13
- package/ios/Badge/BadgeRibbon.swift +92 -19
- package/ios/BaselineView/BaselineView.swift +163 -0
- package/ios/Button/Button.swift +124 -29
- package/ios/Carousel/Carousel.swift +196 -0
- package/ios/Checkbox/Checkbox.swift +23 -27
- package/ios/Chip/Chip.swift +56 -33
- package/ios/Collapse/Collapse.swift +192 -0
- package/ios/Colors+Radius+Spacing/Colors.swift +20 -17
- package/ios/Colors+Radius+Spacing/Spacing.swift +3 -1
- package/ios/Colors+Radius+Spacing/Theme.swift +295 -0
- package/ios/DateTimePicker/DateTimePicker.swift +212 -0
- package/ios/DateTimePicker/DateTimePickerTypes.swift +55 -0
- package/ios/DateTimePicker/DateTimePickerUtils.swift +167 -0
- package/ios/DateTimePicker/WheelPicker.swift +165 -0
- package/ios/Divider/Divider.swift +16 -0
- package/ios/Extensions/ActiveOpacityButtonStyle.swift +14 -0
- package/ios/Extensions/Color++.swift +32 -0
- package/ios/Icon/Icon.swift +10 -1
- package/ios/IconButton/IconButton.swift +140 -0
- package/ios/Image/Image.swift +16 -3
- package/ios/Information/Information.swift +153 -0
- package/ios/Input/ErrorView.swift +3 -1
- package/ios/Input/Input.swift +73 -33
- package/ios/Input/InputPhoneNumber.swift +34 -21
- package/ios/Input/InputSearch.swift +108 -46
- package/ios/Input/InputTextArea.swift +135 -64
- package/ios/InputDropDown/InputDropDown.swift +201 -0
- package/ios/InputMoney/InputMoney.swift +347 -0
- package/ios/InputOTP/InputOTP.swift +210 -0
- package/ios/Loader/Loader.swift +113 -0
- package/ios/MoMoUIKits.podspec +5 -0
- package/ios/OTPKeyboard/KeyboardButton.swift +1 -1
- package/ios/Pagination/PaginationDot.swift +61 -0
- package/ios/Pagination/PaginationNumber.swift +35 -0
- package/ios/Pagination/PaginationScroll.swift +101 -0
- package/ios/Pagination/PaginationWhiteDot.swift +37 -0
- package/ios/Popup/PopupDisplay.swift +13 -16
- package/ios/Popup/PopupInput.swift +2 -6
- package/ios/Popup/PopupNotify.swift +218 -0
- package/ios/Popup/PopupPromotion.swift +16 -8
- package/ios/ProgressInfo/ProgressInfo.swift +296 -0
- package/ios/Radio/Radio.swift +69 -0
- package/ios/Rating/Rating.swift +82 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/AccentColor.colorset/Contents.json +11 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Background.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Border.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Card.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Contents.json +6 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Error.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Primary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryDark.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryLight.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Success.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Text.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/TextSecondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/Contents.json +9 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-default.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-disable.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-pressed.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-selected.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-surface.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-tonal.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-default.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-disable.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/gradient.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/primary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-container.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-primary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-default.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-disable.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-hint.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Warning.colorset/Contents.json +38 -0
- package/ios/Skeleton/Skeleton.swift +99 -0
- package/ios/Slider/Slider.swift +237 -0
- package/ios/Stepper/Stepper.swift +220 -0
- package/ios/Steps/Steps.swift +467 -0
- package/ios/SuggestAction/SuggestAction.swift +99 -0
- package/ios/Swipeable/SwipeCell.swift +187 -0
- package/ios/Swipeable/SwipeCellModel.swift +21 -0
- package/ios/Switch/Switch.swift +53 -28
- package/ios/TabView/TabView.swift +534 -0
- package/ios/Tag/Tag.swift +98 -0
- package/ios/Template/TrustBanner/TrustBanner.swift +8 -7
- package/ios/Title/Title.swift +269 -0
- package/ios/Tooltip/Tooltip.swift +485 -0
- package/ios/Typography/FontScaleStore.swift +19 -0
- package/ios/Typography/Text.swift +80 -5
- package/ios/Typography/Typography.swift +17 -5
- package/ios/Uploader/Uploader.swift +174 -0
- package/ios/native-kits.podspec +61 -8
- package/ios-demo/MoMoUIKitsDemo.podspec +20 -0
- package/ios-demo/README.md +120 -0
- package/ios-demo/Resources/dot_loading.json +558 -0
- package/ios-demo/Resources/icon.json +4052 -0
- package/ios-demo/Resources/lottie_circle_loader.json +1 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/DemoScaffold.swift +48 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsBadgeDemoView.swift +25 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsButtonDemoView.swift +26 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsCheckboxDemoView.swift +19 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsChipDemoView.swift +33 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsInputDemoView.swift +48 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsPopupDemoView.swift +21 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsRadioDemoView.swift +17 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsTypographyDemoView.swift +28 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoContext.swift +31 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoFactory.swift +24 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +110 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AvatarDemo.swift +93 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BadgeDemo.swift +269 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BaselineView.swift +117 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +89 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ButtonDemo.swift +100 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CarouselDemo.swift +126 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CheckboxDemo.swift +63 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ChipDemo.swift +20 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CollapseDemo.swift +93 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +107 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DateTimePickerDemo.swift +124 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DividerDemo.swift +14 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/HeaderUserDemo.swift +49 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +279 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconButtonDemo.swift +58 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ImageDemo.swift +78 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InformationDemo.swift +138 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDemo.swift +111 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDropDownDemo.swift +136 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputMoneyDemo.swift +107 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputOTPDemo.swift +73 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +100 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputSearchDemo.swift +32 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputTextAreaDemo.swift +57 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LoaderDemo.swift +70 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LocalizeDemo.swift +188 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +229 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PaginationDemo.swift +72 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +175 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +121 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +76 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ProgressInfoDemo.swift +89 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RadioDemo.swift +32 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RatingDemo.swift +56 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SkeletonDemo.swift +32 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SliderDemo.swift +150 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SnackBarDemo.swift +138 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepperDemo.swift +103 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepsDemo.swift +94 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SuggestActionDemo.swift +79 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwipeDemo.swift +152 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwitchDemo.swift +33 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TabViewDemo.swift +190 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TagDemo.swift +34 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ThemeDemo.swift +182 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TitleDemo.swift +109 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TooltipDemo.swift +187 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +87 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/UploaderDemo.swift +131 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +51 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoModels.swift +15 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoRegistry.swift +73 -0
- package/package.json +1 -1
- package/publish.sh +53 -0
- package/scripts/gen-ios-color.mjs +136 -0
- package/example/ios/Example.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -5
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImage.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SkeletonUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -46
- package/local.properties +0 -8
|
@@ -45,8 +45,8 @@ import androidx.compose.ui.layout.onGloballyPositioned
|
|
|
45
45
|
import androidx.compose.ui.platform.LocalDensity
|
|
46
46
|
import androidx.compose.ui.unit.Dp
|
|
47
47
|
import androidx.compose.ui.unit.dp
|
|
48
|
-
import androidx.compose.ui.unit.min
|
|
49
48
|
import androidx.compose.ui.zIndex
|
|
49
|
+
import kotlinx.coroutines.flow.Flow
|
|
50
50
|
import vn.momo.kits.components.InputSearch
|
|
51
51
|
import vn.momo.kits.const.AppNavigationBar
|
|
52
52
|
import vn.momo.kits.const.AppStatusBar
|
|
@@ -56,6 +56,7 @@ import vn.momo.kits.const.Colors
|
|
|
56
56
|
import vn.momo.kits.const.Spacing
|
|
57
57
|
import vn.momo.kits.modifier.conditional
|
|
58
58
|
import vn.momo.kits.modifier.hideKeyboardOnTap
|
|
59
|
+
import vn.momo.kits.navigation.bottomtab.BOTTOM_TAB_BAR_HEIGHT
|
|
59
60
|
import vn.momo.kits.navigation.component.FABPosition
|
|
60
61
|
import vn.momo.kits.navigation.component.FloatingButton
|
|
61
62
|
import vn.momo.kits.navigation.component.HEADER_HEIGHT
|
|
@@ -69,13 +70,21 @@ import vn.momo.kits.platform.supportsImePadding
|
|
|
69
70
|
import vn.momo.kits.navigation.tracking.ScreenTracker
|
|
70
71
|
import vn.momo.kits.navigation.tracking.ScreenTrackingState
|
|
71
72
|
import kotlinx.coroutines.delay
|
|
72
|
-
import vn.momo.kits.application.
|
|
73
|
+
import vn.momo.kits.application.LocalContext
|
|
73
74
|
import kotlin.time.Clock
|
|
75
|
+
import kotlin.time.Duration.Companion.milliseconds
|
|
74
76
|
import kotlin.time.ExperimentalTime
|
|
75
77
|
|
|
76
78
|
internal val LocalFooterHeightPx = staticCompositionLocalOf { mutableIntStateOf(0) }
|
|
77
79
|
internal val LocalHeaderRightWidthPx = staticCompositionLocalOf { mutableIntStateOf(0) }
|
|
78
80
|
|
|
81
|
+
@Composable
|
|
82
|
+
private fun bottomTabBarInset(): Dp {
|
|
83
|
+
if (LocalNavigation.current.bottomTabIndex == -1) return 0.dp
|
|
84
|
+
val keyboard = keyboardSizeState().value
|
|
85
|
+
return (BOTTOM_TAB_BAR_HEIGHT.dp + Spacing.S - keyboard).coerceAtLeast(0.dp)
|
|
86
|
+
}
|
|
87
|
+
|
|
79
88
|
@OptIn(ExperimentalMaterialApi::class, ExperimentalTime::class)
|
|
80
89
|
@Composable
|
|
81
90
|
internal fun StackScreen(
|
|
@@ -88,17 +97,20 @@ internal fun StackScreen(
|
|
|
88
97
|
) {
|
|
89
98
|
val navigator = LocalNavigator.current
|
|
90
99
|
val maxApi = LocalMaxApi.current
|
|
91
|
-
val context =
|
|
100
|
+
val context = LocalContext.current
|
|
92
101
|
val statusBar = AppStatusBar.current
|
|
93
102
|
val density = LocalDensity.current
|
|
94
|
-
val
|
|
103
|
+
val screenRegistry = LocalDynamicScreenRegistry.current
|
|
104
|
+
val navigation = remember { Navigation(id = id, bottomTabIndex = bottomTabIndex, initOptions = navigationOptions, registry = screenRegistry) }
|
|
95
105
|
|
|
96
106
|
val options by navigation.currentOptions
|
|
107
|
+
val isBottomTabChild = bottomTabIndex != -1
|
|
108
|
+
val isBottomTabRoot = navigation.isBottomTabRoot
|
|
97
109
|
|
|
98
110
|
// Auto tracking state
|
|
99
111
|
val trackingState = remember {
|
|
100
112
|
ScreenTrackingState().apply {
|
|
101
|
-
|
|
113
|
+
time = Clock.System.now().toEpochMilliseconds()
|
|
102
114
|
}
|
|
103
115
|
}
|
|
104
116
|
|
|
@@ -119,8 +131,8 @@ internal fun StackScreen(
|
|
|
119
131
|
)
|
|
120
132
|
|
|
121
133
|
// Track screen displayed after 2 seconds (debounce)
|
|
122
|
-
delay(2000)
|
|
123
|
-
val loadTime = Clock.System.now().toEpochMilliseconds() - trackingState.
|
|
134
|
+
delay(2000.milliseconds)
|
|
135
|
+
val loadTime = Clock.System.now().toEpochMilliseconds() - trackingState.time
|
|
124
136
|
ScreenTracker.trackScreenDisplayed(
|
|
125
137
|
maxApi = maxApi,
|
|
126
138
|
context = context,
|
|
@@ -130,7 +142,7 @@ internal fun StackScreen(
|
|
|
130
142
|
)
|
|
131
143
|
|
|
132
144
|
// Track screen interacted after displayed
|
|
133
|
-
val interactionTime = Clock.System.now().toEpochMilliseconds() - trackingState.
|
|
145
|
+
val interactionTime = Clock.System.now().toEpochMilliseconds() - trackingState.time
|
|
134
146
|
ScreenTracker.trackScreenInteracted(
|
|
135
147
|
maxApi = maxApi,
|
|
136
148
|
context = context,
|
|
@@ -191,29 +203,35 @@ internal fun StackScreen(
|
|
|
191
203
|
}
|
|
192
204
|
|
|
193
205
|
Column(Modifier.zIndex(2f).fillMaxSize()) {
|
|
194
|
-
MainContent(content = content)
|
|
206
|
+
MainContent(content = content, isBottomTabRoot = isBottomTabRoot, isBottomTabChild = isBottomTabChild)
|
|
195
207
|
FooterContent()
|
|
196
208
|
}
|
|
197
209
|
|
|
198
210
|
Box(Modifier.zIndex(6f)) {
|
|
199
|
-
FloatingContent()
|
|
211
|
+
FloatingContent(isBottomTabChild = isBottomTabChild)
|
|
200
212
|
}
|
|
201
213
|
|
|
202
|
-
OverplayView(
|
|
214
|
+
OverplayView(isBottomTabChild = isBottomTabChild, id = id)
|
|
203
215
|
}
|
|
204
216
|
}
|
|
205
217
|
}
|
|
206
218
|
|
|
219
|
+
@Suppress("FrequentlyChangingValue")
|
|
207
220
|
@Composable
|
|
208
|
-
fun FloatingContent() {
|
|
221
|
+
internal fun FloatingContent(isBottomTabChild: Boolean) {
|
|
209
222
|
val options = LocalOptions.current
|
|
210
223
|
val density = LocalDensity.current
|
|
211
224
|
val footerHeightPx = LocalFooterHeightPx.current
|
|
212
225
|
val scrollState = LocalScrollState.current
|
|
226
|
+
val navigationBar = AppNavigationBar.current
|
|
213
227
|
|
|
214
228
|
val fabProps = options.floatingButtonProps ?: return
|
|
215
229
|
val bottomPadding = fabProps.bottom
|
|
216
|
-
?: (Spacing.M +
|
|
230
|
+
?: (Spacing.M + when {
|
|
231
|
+
options.hasFooter() -> with(density) { footerHeightPx.intValue.toDp() }
|
|
232
|
+
isBottomTabChild -> bottomTabBarInset() + (navigationBar - keyboardSizeState().value).coerceAtLeast(0.dp)
|
|
233
|
+
else -> navigationBar
|
|
234
|
+
})
|
|
217
235
|
|
|
218
236
|
FloatingButton(
|
|
219
237
|
scrollPosition = fabProps.scrollState?.value ?: scrollState.value,
|
|
@@ -229,11 +247,12 @@ fun FloatingContent() {
|
|
|
229
247
|
}
|
|
230
248
|
|
|
231
249
|
@Composable
|
|
232
|
-
fun ColumnScope.MainContent(content: @Composable () -> Unit) {
|
|
250
|
+
internal fun ColumnScope.MainContent(content: @Composable () -> Unit, isBottomTabRoot: Boolean, isBottomTabChild: Boolean) {
|
|
233
251
|
val options = LocalOptions.current
|
|
234
252
|
val inputSearchType = getInputSearchType(options)
|
|
235
253
|
val density = LocalDensity.current
|
|
236
254
|
val scrollState = LocalScrollState.current
|
|
255
|
+
val navigationBar = AppNavigationBar.current
|
|
237
256
|
|
|
238
257
|
Spacer(
|
|
239
258
|
Modifier.height(
|
|
@@ -257,6 +276,14 @@ fun ColumnScope.MainContent(content: @Composable () -> Unit) {
|
|
|
257
276
|
.conditional(options.scrollData.scrollable && options.scrollData.scrollState is ScrollState) {
|
|
258
277
|
verticalScroll(scrollState)
|
|
259
278
|
}
|
|
279
|
+
.padding(
|
|
280
|
+
bottom = when {
|
|
281
|
+
options.hasFooter() || isBottomTabRoot -> 0.dp
|
|
282
|
+
isBottomTabChild -> bottomTabBarInset() + (navigationBar - keyboardSizeState().value).coerceAtLeast(0.dp)
|
|
283
|
+
!options.scrollData.scrollable && options.scrollData.scrollState == null -> 0.dp
|
|
284
|
+
else -> navigationBar
|
|
285
|
+
}
|
|
286
|
+
)
|
|
260
287
|
) {
|
|
261
288
|
ScreenContent(content = content)
|
|
262
289
|
}
|
|
@@ -264,7 +291,7 @@ fun ColumnScope.MainContent(content: @Composable () -> Unit) {
|
|
|
264
291
|
}
|
|
265
292
|
|
|
266
293
|
@Composable
|
|
267
|
-
fun ScreenContent(content: @Composable () -> Unit) {
|
|
294
|
+
internal fun ScreenContent(content: @Composable () -> Unit) {
|
|
268
295
|
val scrollState = LocalScrollState.current
|
|
269
296
|
val options = LocalOptions.current
|
|
270
297
|
|
|
@@ -284,9 +311,9 @@ fun ScreenContent(content: @Composable () -> Unit) {
|
|
|
284
311
|
}
|
|
285
312
|
|
|
286
313
|
@Composable
|
|
287
|
-
fun FooterContent() {
|
|
314
|
+
internal fun FooterContent() {
|
|
288
315
|
val options = LocalOptions.current
|
|
289
|
-
if (options.
|
|
316
|
+
if (options.hasFooter()) {
|
|
290
317
|
val keyboardSize = keyboardSizeState()
|
|
291
318
|
val bottomPadding = (AppNavigationBar.current - keyboardSize.value).coerceAtLeast(0.dp)
|
|
292
319
|
Footer(footerComponent = options.footerComponent, bottomPadding = bottomPadding)
|
|
@@ -294,18 +321,18 @@ fun FooterContent() {
|
|
|
294
321
|
}
|
|
295
322
|
|
|
296
323
|
@Composable
|
|
297
|
-
fun keyboardSizeState(): State<Dp> {
|
|
324
|
+
internal fun keyboardSizeState(): State<Dp> {
|
|
298
325
|
val bottom = WindowInsets.ime.asPaddingValues()
|
|
299
326
|
return rememberUpdatedState(bottom.calculateBottomPadding())
|
|
300
327
|
}
|
|
301
328
|
|
|
302
329
|
@Composable
|
|
303
|
-
fun OverplayView(
|
|
330
|
+
internal fun OverplayView(isBottomTabChild: Boolean, id: Int) {
|
|
304
331
|
val overplayType = OverplayComponentRegistry.getOverplayType()
|
|
305
332
|
|
|
306
333
|
if (overplayType != null) {
|
|
307
334
|
Box(Modifier.zIndex(if (overplayType == OverplayComponentType.SNACK_BAR) 3f else 7f).fillMaxSize()) {
|
|
308
|
-
if (
|
|
335
|
+
if (isBottomTabChild) return@Box
|
|
309
336
|
if (OverplayComponentRegistry.currentRootId() != id) return@Box
|
|
310
337
|
OverplayComponentRegistry.OverlayComponent()
|
|
311
338
|
}
|
|
@@ -355,8 +382,9 @@ data class InputSearchLayoutParams(
|
|
|
355
382
|
val endPadding: Dp
|
|
356
383
|
)
|
|
357
384
|
|
|
385
|
+
@Suppress("FrequentlyChangingValue")
|
|
358
386
|
@Composable
|
|
359
|
-
fun SearchAnimated(
|
|
387
|
+
internal fun SearchAnimated(
|
|
360
388
|
isScrollInProgress: Boolean
|
|
361
389
|
) {
|
|
362
390
|
val scrollState = LocalScrollState.current
|
|
@@ -469,64 +497,61 @@ private fun quantize(value: Int, stepPx: Int): Int {
|
|
|
469
497
|
}
|
|
470
498
|
|
|
471
499
|
@Composable
|
|
472
|
-
fun LazyListState.proxyScrollState(
|
|
500
|
+
internal fun LazyListState.proxyScrollState(
|
|
473
501
|
thresholdPx: Int = 200,
|
|
474
502
|
stepPx: Int = 4
|
|
475
|
-
): Pair<ScrollState, Boolean>
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
if (scrollState.value != desired) {
|
|
489
|
-
scrollState.scrollTo(desired.coerceAtLeast(0))
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
val inProgress = remember { mutableStateOf(false) }
|
|
495
|
-
LaunchedEffect(this, thresholdPx) {
|
|
496
|
-
snapshotFlow { isScrollInProgress }
|
|
497
|
-
.collect { progressing ->
|
|
498
|
-
inProgress.value = if (locked.value) false else progressing
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
return scrollState to inProgress.value
|
|
503
|
-
}
|
|
503
|
+
): Pair<ScrollState, Boolean> = proxyScroll(
|
|
504
|
+
source = this,
|
|
505
|
+
thresholdPx = thresholdPx,
|
|
506
|
+
stepPx = stepPx,
|
|
507
|
+
isScrollInProgress = { isScrollInProgress },
|
|
508
|
+
rawTargetFlow = {
|
|
509
|
+
snapshotFlow {
|
|
510
|
+
if (firstVisibleItemIndex == 0) firstVisibleItemScrollOffset
|
|
511
|
+
else SCROLLED_PAST_FIRST_ITEM_THRESHOLD
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
)
|
|
504
515
|
|
|
505
516
|
@Composable
|
|
506
|
-
fun ScrollState.proxyLimitedScrollState(
|
|
517
|
+
internal fun ScrollState.proxyLimitedScrollState(
|
|
507
518
|
thresholdPx: Int = 200,
|
|
508
519
|
stepPx: Int = 4
|
|
520
|
+
): Pair<ScrollState, Boolean> = proxyScroll(
|
|
521
|
+
source = this,
|
|
522
|
+
thresholdPx = thresholdPx,
|
|
523
|
+
stepPx = stepPx,
|
|
524
|
+
isScrollInProgress = { isScrollInProgress },
|
|
525
|
+
rawTargetFlow = { snapshotFlow { value } },
|
|
526
|
+
)
|
|
527
|
+
|
|
528
|
+
@Composable
|
|
529
|
+
private fun proxyScroll(
|
|
530
|
+
source: Any,
|
|
531
|
+
thresholdPx: Int,
|
|
532
|
+
stepPx: Int,
|
|
533
|
+
isScrollInProgress: () -> Boolean,
|
|
534
|
+
rawTargetFlow: () -> Flow<Int>,
|
|
509
535
|
): Pair<ScrollState, Boolean> {
|
|
510
536
|
val proxy = rememberScrollState()
|
|
511
537
|
val locked = remember { mutableStateOf(false) }
|
|
512
538
|
|
|
513
|
-
LaunchedEffect(
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
if (locked.value != shouldLock) locked.value = shouldLock
|
|
539
|
+
LaunchedEffect(source, proxy, thresholdPx, stepPx) {
|
|
540
|
+
rawTargetFlow().collect { rawTarget ->
|
|
541
|
+
val shouldLock = rawTarget > thresholdPx
|
|
542
|
+
if (locked.value != shouldLock) locked.value = shouldLock
|
|
518
543
|
|
|
519
|
-
|
|
544
|
+
val desired = if (shouldLock) thresholdPx else quantize(rawTarget, stepPx)
|
|
520
545
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
}
|
|
546
|
+
if (proxy.value != desired) {
|
|
547
|
+
proxy.scrollTo(desired.coerceAtLeast(0))
|
|
524
548
|
}
|
|
549
|
+
}
|
|
525
550
|
}
|
|
526
551
|
|
|
527
552
|
val inProgress = remember { mutableStateOf(false) }
|
|
528
|
-
LaunchedEffect(
|
|
529
|
-
snapshotFlow { isScrollInProgress }
|
|
553
|
+
LaunchedEffect(source, thresholdPx) {
|
|
554
|
+
snapshotFlow { isScrollInProgress() }
|
|
530
555
|
.collect { progressing ->
|
|
531
556
|
inProgress.value = if (locked.value) false else progressing
|
|
532
557
|
}
|
|
@@ -6,13 +6,7 @@ import androidx.compose.animation.fadeOut
|
|
|
6
6
|
import androidx.compose.animation.scaleIn
|
|
7
7
|
import androidx.compose.animation.scaleOut
|
|
8
8
|
import androidx.compose.foundation.background
|
|
9
|
-
import androidx.compose.foundation.layout
|
|
10
|
-
import androidx.compose.foundation.layout.Column
|
|
11
|
-
import androidx.compose.foundation.layout.Spacer
|
|
12
|
-
import androidx.compose.foundation.layout.fillMaxSize
|
|
13
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
14
|
-
import androidx.compose.foundation.layout.height
|
|
15
|
-
import androidx.compose.foundation.layout.padding
|
|
9
|
+
import androidx.compose.foundation.layout.*
|
|
16
10
|
import androidx.compose.runtime.Composable
|
|
17
11
|
import androidx.compose.runtime.LaunchedEffect
|
|
18
12
|
import androidx.compose.ui.Alignment
|
|
@@ -24,20 +18,20 @@ import androidx.navigation.compose.rememberNavController
|
|
|
24
18
|
import vn.momo.kits.const.AppNavigationBar
|
|
25
19
|
import vn.momo.kits.const.AppTheme
|
|
26
20
|
import vn.momo.kits.const.Spacing
|
|
21
|
+
import vn.momo.kits.navigation.KeyboardOptions
|
|
27
22
|
import vn.momo.kits.navigation.LocalNavigation
|
|
28
23
|
import vn.momo.kits.navigation.LocalNavigator
|
|
29
24
|
import vn.momo.kits.navigation.NavigationOptions
|
|
30
25
|
import vn.momo.kits.navigation.StackScreen
|
|
31
26
|
import vn.momo.kits.navigation.component.HeaderType
|
|
32
|
-
import vn.momo.kits.platform.getScreenHeight
|
|
33
27
|
|
|
34
28
|
private var bottomTabOptionItems : MutableList<NavigationOptions?> = mutableListOf()
|
|
35
|
-
fun setBottomTabOption(index: Int, options: NavigationOptions){
|
|
29
|
+
internal fun setBottomTabOption(index: Int, options: NavigationOptions){
|
|
36
30
|
if (index in bottomTabOptionItems.indices) {
|
|
37
31
|
bottomTabOptionItems[index] = options
|
|
38
32
|
}
|
|
39
33
|
}
|
|
40
|
-
fun getBottomTabOption(index: Int): NavigationOptions? {
|
|
34
|
+
internal fun getBottomTabOption(index: Int): NavigationOptions? {
|
|
41
35
|
return if (index in bottomTabOptionItems.indices) {
|
|
42
36
|
bottomTabOptionItems[index]
|
|
43
37
|
} else null
|
|
@@ -58,15 +52,16 @@ fun BottomTab(
|
|
|
58
52
|
|
|
59
53
|
|
|
60
54
|
LaunchedEffect(Unit){
|
|
55
|
+
navigation.markAsBottomTabRoot()
|
|
61
56
|
navigation.setOptions(
|
|
62
|
-
headerType = HeaderType.None
|
|
57
|
+
headerType = HeaderType.None,
|
|
58
|
+
keyboardOptions = KeyboardOptions(useAvoidKeyboard = false)
|
|
63
59
|
)
|
|
64
60
|
}
|
|
65
61
|
|
|
66
|
-
Box(modifier = Modifier.
|
|
62
|
+
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.BottomCenter) {
|
|
67
63
|
Box(modifier = Modifier
|
|
68
64
|
.fillMaxSize()
|
|
69
|
-
.padding(bottom = BOTTOM_TAB_BAR_HEIGHT.dp + AppNavigationBar.current)
|
|
70
65
|
) {
|
|
71
66
|
NavHost(
|
|
72
67
|
navController = navController,
|
|
@@ -133,7 +128,7 @@ fun BottomTab(
|
|
|
133
128
|
onTabSelected = {
|
|
134
129
|
val currentRoute = navController.currentBackStackEntry?.destination?.route
|
|
135
130
|
val targetRoute = "option$it"
|
|
136
|
-
if (currentRoute != targetRoute){
|
|
131
|
+
if (currentRoute != targetRoute) {
|
|
137
132
|
navController.navigate(targetRoute)
|
|
138
133
|
}
|
|
139
134
|
}
|
|
@@ -5,19 +5,7 @@ import androidx.compose.animation.core.animateDpAsState
|
|
|
5
5
|
import androidx.compose.animation.core.tween
|
|
6
6
|
import androidx.compose.foundation.background
|
|
7
7
|
import androidx.compose.foundation.border
|
|
8
|
-
import androidx.compose.foundation.layout
|
|
9
|
-
import androidx.compose.foundation.layout.Box
|
|
10
|
-
import androidx.compose.foundation.layout.Column
|
|
11
|
-
import androidx.compose.foundation.layout.Row
|
|
12
|
-
import androidx.compose.foundation.layout.RowScope
|
|
13
|
-
import androidx.compose.foundation.layout.Spacer
|
|
14
|
-
import androidx.compose.foundation.layout.fillMaxSize
|
|
15
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
16
|
-
import androidx.compose.foundation.layout.height
|
|
17
|
-
import androidx.compose.foundation.layout.offset
|
|
18
|
-
import androidx.compose.foundation.layout.padding
|
|
19
|
-
import androidx.compose.foundation.layout.size
|
|
20
|
-
import androidx.compose.foundation.layout.width
|
|
8
|
+
import androidx.compose.foundation.layout.*
|
|
21
9
|
import androidx.compose.foundation.shape.CircleShape
|
|
22
10
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
23
11
|
import androidx.compose.runtime.Composable
|
|
@@ -32,26 +20,20 @@ import androidx.compose.ui.text.style.TextOverflow
|
|
|
32
20
|
import androidx.compose.ui.unit.dp
|
|
33
21
|
import androidx.navigation.NavController
|
|
34
22
|
import androidx.navigation.compose.currentBackStackEntryAsState
|
|
35
|
-
import vn.momo.kits.components.Badge
|
|
36
|
-
import vn.momo.kits.components.Icon
|
|
37
|
-
import vn.momo.kits.components.Text
|
|
38
|
-
import vn.momo.kits.const.AppTheme
|
|
39
|
-
import vn.momo.kits.const.Colors
|
|
40
|
-
import vn.momo.kits.const.Radius
|
|
41
|
-
import vn.momo.kits.const.Spacing
|
|
42
23
|
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
43
|
-
import vn.momo.kits.components
|
|
44
|
-
import vn.momo.kits.
|
|
45
|
-
import vn.momo.kits.
|
|
24
|
+
import vn.momo.kits.components.*
|
|
25
|
+
import vn.momo.kits.const.*
|
|
26
|
+
import vn.momo.kits.modifier.InternalApi
|
|
46
27
|
import vn.momo.kits.modifier.conditional
|
|
47
28
|
import vn.momo.kits.modifier.noFeedbackClickable
|
|
48
29
|
import vn.momo.kits.platform.getScreenDimensions
|
|
49
30
|
|
|
50
|
-
val floatingButtonWidth = 75.dp
|
|
31
|
+
internal val floatingButtonWidth = 75.dp
|
|
32
|
+
@InternalApi
|
|
51
33
|
const val BOTTOM_TAB_BAR_HEIGHT = 64
|
|
52
34
|
|
|
53
35
|
@Composable
|
|
54
|
-
fun BottomTabBar(
|
|
36
|
+
internal fun BottomTabBar(
|
|
55
37
|
items: List<BottomTabItem>,
|
|
56
38
|
floatingButton: BottomTabFloatingButton? = null,
|
|
57
39
|
navController: NavController,
|
|
@@ -91,11 +73,11 @@ fun BottomTabBar(
|
|
|
91
73
|
horizontalArrangement = Arrangement.SpaceAround,
|
|
92
74
|
) {
|
|
93
75
|
if (floatingButton == null) {
|
|
94
|
-
|
|
76
|
+
RenderTabBarItem(items, 0, items.size, selectedIndex, onTabSelected)
|
|
95
77
|
} else {
|
|
96
|
-
|
|
78
|
+
RenderTabBarItem(items, 0, mid, selectedIndex, onTabSelected)
|
|
97
79
|
Spacer(modifier = Modifier.width(floatingButtonWidth).padding(horizontal = Spacing.XXS))
|
|
98
|
-
|
|
80
|
+
RenderTabBarItem(items, mid, items.size, selectedIndex, onTabSelected)
|
|
99
81
|
}
|
|
100
82
|
}
|
|
101
83
|
|
|
@@ -124,7 +106,7 @@ fun BottomTabBar(
|
|
|
124
106
|
}
|
|
125
107
|
|
|
126
108
|
@Composable
|
|
127
|
-
fun RowScope.
|
|
109
|
+
internal fun RowScope.RenderTabBarItem(
|
|
128
110
|
items: List<BottomTabItem>,
|
|
129
111
|
fromIndex: Int,
|
|
130
112
|
toIndex: Int,
|
|
@@ -143,7 +125,7 @@ fun RowScope.renderTabBarItem(
|
|
|
143
125
|
}
|
|
144
126
|
|
|
145
127
|
@Composable
|
|
146
|
-
fun TabBarItem(item: BottomTabItem, selected: Boolean, onClick: () -> Unit) {
|
|
128
|
+
internal fun TabBarItem(item: BottomTabItem, selected: Boolean, onClick: () -> Unit) {
|
|
147
129
|
fun isNumber(label: String): Boolean {
|
|
148
130
|
val numberRegex = "^\\d+$".toRegex()
|
|
149
131
|
return numberRegex.matches(label)
|
|
@@ -203,7 +185,7 @@ fun TabBarItem(item: BottomTabItem, selected: Boolean, onClick: () -> Unit) {
|
|
|
203
185
|
}
|
|
204
186
|
|
|
205
187
|
@Composable
|
|
206
|
-
fun FloatingButton(data: BottomTabFloatingButton) {
|
|
188
|
+
internal fun FloatingButton(data: BottomTabFloatingButton) {
|
|
207
189
|
Column(
|
|
208
190
|
modifier = Modifier
|
|
209
191
|
.width(floatingButtonWidth)
|
|
@@ -1,40 +1,21 @@
|
|
|
1
1
|
package vn.momo.kits.navigation.component
|
|
2
2
|
|
|
3
|
-
import androidx.compose.animation
|
|
3
|
+
import androidx.compose.animation.*
|
|
4
4
|
import androidx.compose.animation.core.CubicBezierEasing
|
|
5
5
|
import androidx.compose.animation.core.LinearEasing
|
|
6
6
|
import androidx.compose.animation.core.animateDpAsState
|
|
7
7
|
import androidx.compose.animation.core.tween
|
|
8
|
-
import androidx.compose.animation.expandHorizontally
|
|
9
|
-
import androidx.compose.animation.fadeIn
|
|
10
|
-
import androidx.compose.animation.fadeOut
|
|
11
|
-
import androidx.compose.animation.shrinkHorizontally
|
|
12
8
|
import androidx.compose.foundation.ScrollState
|
|
13
9
|
import androidx.compose.foundation.background
|
|
14
10
|
import androidx.compose.foundation.border
|
|
15
11
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
16
|
-
import androidx.compose.foundation.layout
|
|
17
|
-
import androidx.compose.foundation.layout.Box
|
|
18
|
-
import androidx.compose.foundation.layout.Row
|
|
19
|
-
import androidx.compose.foundation.layout.Spacer
|
|
20
|
-
import androidx.compose.foundation.layout.fillMaxSize
|
|
21
|
-
import androidx.compose.foundation.layout.height
|
|
22
|
-
import androidx.compose.foundation.layout.offset
|
|
23
|
-
import androidx.compose.foundation.layout.padding
|
|
24
|
-
import androidx.compose.foundation.layout.sizeIn
|
|
25
|
-
import androidx.compose.foundation.layout.width
|
|
12
|
+
import androidx.compose.foundation.layout.*
|
|
26
13
|
import androidx.compose.material3.AlertDialogDefaults
|
|
27
14
|
import androidx.compose.material3.FloatingActionButton
|
|
28
15
|
import androidx.compose.material3.FloatingActionButtonDefaults
|
|
29
16
|
import androidx.compose.material3.FloatingActionButtonElevation
|
|
30
|
-
import androidx.compose.runtime
|
|
31
|
-
import androidx.compose.runtime.LaunchedEffect
|
|
32
|
-
import androidx.compose.runtime.getValue
|
|
33
|
-
import androidx.compose.runtime.mutableStateOf
|
|
34
|
-
import androidx.compose.runtime.remember
|
|
35
|
-
import androidx.compose.runtime.rememberCoroutineScope
|
|
17
|
+
import androidx.compose.runtime.*
|
|
36
18
|
import androidx.compose.runtime.saveable.rememberSaveable
|
|
37
|
-
import androidx.compose.runtime.setValue
|
|
38
19
|
import androidx.compose.ui.Alignment
|
|
39
20
|
import androidx.compose.ui.Modifier
|
|
40
21
|
import androidx.compose.ui.graphics.Color
|
|
@@ -50,6 +31,7 @@ import vn.momo.kits.components.Text
|
|
|
50
31
|
import vn.momo.kits.const.Colors
|
|
51
32
|
import vn.momo.kits.const.Typography
|
|
52
33
|
import vn.momo.kits.modifier.conditional
|
|
34
|
+
import kotlin.time.Duration.Companion.milliseconds
|
|
53
35
|
|
|
54
36
|
enum class FABSize { SMALL, DEFAULT }
|
|
55
37
|
enum class FABPosition { END, CENTER }
|
|
@@ -73,7 +55,7 @@ private val FabIconSizeDefault = 24.dp
|
|
|
73
55
|
private val FabPaddingHorizontal = 12.dp
|
|
74
56
|
|
|
75
57
|
@Composable
|
|
76
|
-
fun FloatingButton(
|
|
58
|
+
internal fun FloatingButton(
|
|
77
59
|
scrollPosition: Int,
|
|
78
60
|
bottom: Dp,
|
|
79
61
|
onClick: () -> Unit,
|
|
@@ -106,7 +88,7 @@ fun FloatingButton(
|
|
|
106
88
|
coroutineScope.launch {
|
|
107
89
|
scrollStateFlow.collectLatest { newScroll ->
|
|
108
90
|
isExpanded = newScroll <= lastScrollPosition
|
|
109
|
-
delay(100)
|
|
91
|
+
delay(100.milliseconds)
|
|
110
92
|
lastScrollPosition = newScroll
|
|
111
93
|
}
|
|
112
94
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
package vn.momo.kits.navigation.component
|
|
2
2
|
|
|
3
|
+
import vn.momo.kits.modifier.InternalApi
|
|
4
|
+
|
|
3
5
|
import androidx.compose.animation.core.animateFloatAsState
|
|
4
6
|
import androidx.compose.foundation.background
|
|
5
7
|
import androidx.compose.foundation.border
|
|
@@ -42,12 +44,14 @@ import vn.momo.kits.navigation.LocalOptions
|
|
|
42
44
|
import vn.momo.kits.navigation.LocalScrollState
|
|
43
45
|
import vn.momo.kits.navigation.getInputSearchType
|
|
44
46
|
|
|
47
|
+
@InternalApi
|
|
45
48
|
const val HEADER_HEIGHT = 52
|
|
46
|
-
enum class InputSearchType { None, Header, Animated }
|
|
49
|
+
internal enum class InputSearchType { None, Header, Animated }
|
|
47
50
|
enum class TitlePosition { LEFT, CENTER }
|
|
48
51
|
|
|
52
|
+
@Suppress("FrequentlyChangingValue")
|
|
49
53
|
@Composable
|
|
50
|
-
fun Header(onBackHandler: (() -> Unit)? = null) {
|
|
54
|
+
internal fun Header(onBackHandler: (() -> Unit)? = null) {
|
|
51
55
|
val options = LocalOptions.current
|
|
52
56
|
val navigator = LocalNavigator.current
|
|
53
57
|
val scrollState = LocalScrollState.current
|
|
@@ -106,7 +110,7 @@ fun Header(onBackHandler: (() -> Unit)? = null) {
|
|
|
106
110
|
backgroundButton = headerColor.backgroundButton,
|
|
107
111
|
tintIconColor = headerColor.tintIconColor,
|
|
108
112
|
onBackHandler = {
|
|
109
|
-
|
|
113
|
+
navigator.onBackSafe { }
|
|
110
114
|
}
|
|
111
115
|
)
|
|
112
116
|
Spacer(Modifier.width(Spacing.S))
|
|
@@ -168,7 +172,7 @@ private fun BackButton(borderColor: Color, backgroundButton: Color, tintIconColo
|
|
|
168
172
|
}
|
|
169
173
|
|
|
170
174
|
@Composable
|
|
171
|
-
fun HeaderContent(
|
|
175
|
+
internal fun HeaderContent(
|
|
172
176
|
headerTitle: HeaderTitle,
|
|
173
177
|
tintIconColor: Color,
|
|
174
178
|
titlePosition: TitlePosition = TitlePosition.LEFT,
|
|
@@ -199,7 +203,7 @@ fun HeaderContent(
|
|
|
199
203
|
}
|
|
200
204
|
|
|
201
205
|
@Composable
|
|
202
|
-
fun VerticalShadow(opacity: Float){
|
|
206
|
+
internal fun VerticalShadow(opacity: Float){
|
|
203
207
|
if(opacity == 1f){
|
|
204
208
|
Box(modifier = Modifier
|
|
205
209
|
.fillMaxWidth()
|
|
@@ -282,8 +286,9 @@ data class HeaderBackProps(
|
|
|
282
286
|
val preventBack: PopupNotifyProps? = null,
|
|
283
287
|
)
|
|
284
288
|
|
|
289
|
+
@InternalApi
|
|
285
290
|
data class HeaderColor(val tintIconColor: Color, val backgroundButton: Color, val borderColor: Color)
|
|
286
|
-
fun getHeaderColor(headerType: HeaderType, opacity: Float, tintColor: Color?, defaultColor: Color): HeaderColor{
|
|
291
|
+
internal fun getHeaderColor(headerType: HeaderType, opacity: Float, tintColor: Color?, defaultColor: Color): HeaderColor{
|
|
287
292
|
return if(headerType is HeaderType.Animated) {
|
|
288
293
|
if (opacity == 1f || !headerType.isSurface)
|
|
289
294
|
HeaderColor(
|
|
@@ -27,8 +27,9 @@ enum class AnimatedHeaderRatio(val value: Float){
|
|
|
27
27
|
RATIO_3_2(3f / 2f)
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
@Suppress("FrequentlyChangingValue")
|
|
30
31
|
@Composable
|
|
31
|
-
fun HeaderBackground() {
|
|
32
|
+
internal fun HeaderBackground() {
|
|
32
33
|
val density = LocalDensity.current
|
|
33
34
|
val theme = AppTheme.current
|
|
34
35
|
val options = LocalOptions.current
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
package vn.momo.kits.navigation.component
|
|
2
2
|
|
|
3
|
+
import vn.momo.kits.modifier.InternalApi
|
|
4
|
+
|
|
3
5
|
import androidx.compose.foundation.background
|
|
4
6
|
import androidx.compose.foundation.border
|
|
5
7
|
import androidx.compose.foundation.layout.Arrangement
|
|
@@ -24,7 +26,7 @@ import androidx.compose.ui.Modifier
|
|
|
24
26
|
import androidx.compose.ui.draw.clip
|
|
25
27
|
import androidx.compose.ui.graphics.Color
|
|
26
28
|
import androidx.compose.ui.unit.dp
|
|
27
|
-
import vn.momo.kits.application.
|
|
29
|
+
import vn.momo.kits.application.LocalContext
|
|
28
30
|
import vn.momo.kits.application.MiniAppContext
|
|
29
31
|
import vn.momo.kits.components.BadgeDot
|
|
30
32
|
import vn.momo.kits.components.DotSize
|
|
@@ -35,6 +37,7 @@ import vn.momo.kits.modifier.activeOpacityClickable
|
|
|
35
37
|
import vn.momo.kits.navigation.LocalMaxApi
|
|
36
38
|
|
|
37
39
|
@Composable
|
|
40
|
+
@InternalApi
|
|
38
41
|
fun HeaderRight(
|
|
39
42
|
headerRight: HeaderRight,
|
|
40
43
|
tintColor: Color? = null,
|
|
@@ -57,13 +60,13 @@ fun HeaderRight(
|
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
@Composable
|
|
60
|
-
fun Toolkit(
|
|
63
|
+
internal fun Toolkit(
|
|
61
64
|
headerRight: HeaderRight.Toolkit,
|
|
62
65
|
tintColor: Color? = null,
|
|
63
66
|
headerColor: HeaderColor
|
|
64
67
|
) {
|
|
65
68
|
val api = LocalMaxApi.current
|
|
66
|
-
val context =
|
|
69
|
+
val context = LocalContext.current
|
|
67
70
|
|
|
68
71
|
var isFavorite by remember { mutableStateOf(false) }
|
|
69
72
|
val isLoading by remember { mutableStateOf(false) }
|
|
@@ -186,7 +189,7 @@ fun Toolkit(
|
|
|
186
189
|
|
|
187
190
|
|
|
188
191
|
@Composable
|
|
189
|
-
fun NavigationButton(
|
|
192
|
+
internal fun NavigationButton(
|
|
190
193
|
disabled: Boolean,
|
|
191
194
|
icon: String,
|
|
192
195
|
showBadge: Boolean? = false,
|
|
@@ -300,7 +303,7 @@ data class Tool(
|
|
|
300
303
|
}
|
|
301
304
|
}
|
|
302
305
|
|
|
303
|
-
data class NavigationButtonConfig(
|
|
306
|
+
private data class NavigationButtonConfig(
|
|
304
307
|
val icon: String,
|
|
305
308
|
val onPress: () -> Unit
|
|
306
|
-
)
|
|
309
|
+
)
|