@momo-kits/native-kits 0.163.1-beta.2 → 0.163.1-beta.20-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/settings.local.json +112 -0
- package/CLAUDE.md +1 -1
- package/build.gradle.kts +11 -0
- package/compose/build.gradle.kts +190 -0
- package/compose/build.gradle.kts.backup +190 -0
- package/compose/compose.podspec +47 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
- 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 +150 -0
- package/compose/src/commonMain/composeResources/font/momosignature.otf +0 -0
- package/compose/src/commonMain/composeResources/font/momotrustdisplay.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_black.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_black.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_bold.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_heavy.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_light.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_medium.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_regular.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_semibold.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_thin.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_thin.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.ttf +0 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +52 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +106 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +183 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +207 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +39 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +293 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +33 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +826 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +269 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +110 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +378 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +56 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +69 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +82 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +338 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +175 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +356 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +113 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +89 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +128 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +209 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +542 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +23 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +125 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +231 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +112 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +477 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +114 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +214 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +240 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +216 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +259 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +182 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +343 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +41 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +84 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +40 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +328 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +97 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +310 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +59 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +21 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +90 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +323 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +217 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +473 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +122 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +199 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +91 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +470 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +88 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +131 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +203 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +498 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +175 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +182 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +193 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +234 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +188 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +325 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitFontScale.kt +22 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +188 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +276 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +52 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +38 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +39 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +52 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +66 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +104 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +48 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +299 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +129 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +100 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +172 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +372 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +581 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +156 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +225 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +169 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +320 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +81 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +309 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +34 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +360 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +132 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +127 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +91 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +9 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +69 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +55 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +105 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +32 -0
- 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 +207 -0
- package/gradle/libs.versions.toml +69 -0
- package/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/gradle/wrapper/gradle-wrapper.properties +8 -0
- package/gradle.properties +26 -0
- package/gradlew +252 -0
- package/gradlew.bat +94 -0
- package/ios/Application/ApplicationEnvironment.swift +15 -3
- package/ios/Application/Components.swift +36 -30
- package/ios/Application/FloatingButton.swift +10 -9
- package/ios/Application/Localize.swift +309 -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 +203 -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/Navigation/component/HeaderRightWidthKey.swift +11 -0
- package/ios/Application/Navigation/component/NavigationHeaderRight.swift +196 -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 -14
- package/ios/Badge/BadgeRibbon.swift +91 -17
- package/ios/BaselineView/BaselineView.swift +163 -0
- package/ios/Button/Button.swift +137 -28
- package/ios/Carousel/Carousel.swift +196 -0
- package/ios/Checkbox/Checkbox.swift +23 -28
- 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 +3 -1
- package/ios/Input/ErrorView.swift +3 -1
- package/ios/Input/Input.swift +72 -33
- package/ios/Input/InputPhoneNumber.swift +33 -21
- package/ios/Input/InputSearch.swift +107 -48
- package/ios/Input/InputTextArea.swift +134 -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/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 +11 -20
- package/ios/Popup/PopupInput.swift +2 -8
- package/ios/Popup/PopupNotify.swift +218 -0
- package/ios/Popup/PopupPromotion.swift +5 -3
- 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 +7 -8
- 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 +86 -17
- package/ios/Typography/Typography.swift +12 -14
- 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 +64 -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/local.properties +8 -0
- package/package.json +1 -1
- package/publish.sh +53 -0
- package/scripts/gen-ios-color.mjs +136 -0
- package/settings.gradle.kts +64 -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/ios/Application/FontScaleStore.swift +0 -59
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
package vn.momo.kits.platform
|
|
2
|
+
|
|
3
|
+
import android.annotation.SuppressLint
|
|
4
|
+
import android.content.res.Resources
|
|
5
|
+
import android.graphics.BlurMaskFilter
|
|
6
|
+
import android.graphics.PorterDuff
|
|
7
|
+
import android.graphics.PorterDuffColorFilter
|
|
8
|
+
import android.os.Build
|
|
9
|
+
import androidx.compose.foundation.layout.Box
|
|
10
|
+
import androidx.compose.runtime.Composable
|
|
11
|
+
import androidx.compose.runtime.LaunchedEffect
|
|
12
|
+
import androidx.compose.runtime.getValue
|
|
13
|
+
import androidx.compose.runtime.rememberUpdatedState
|
|
14
|
+
import androidx.compose.runtime.snapshotFlow
|
|
15
|
+
import androidx.compose.ui.Modifier
|
|
16
|
+
import androidx.compose.ui.graphics.Color
|
|
17
|
+
import androidx.compose.ui.graphics.NativePaint
|
|
18
|
+
import androidx.compose.ui.graphics.toArgb
|
|
19
|
+
import androidx.compose.ui.platform.LocalConfiguration
|
|
20
|
+
import androidx.compose.ui.semantics.contentDescription
|
|
21
|
+
import androidx.compose.ui.semantics.semantics
|
|
22
|
+
import androidx.compose.ui.unit.Dp
|
|
23
|
+
import androidx.compose.ui.unit.dp
|
|
24
|
+
import com.airbnb.lottie.LottieProperty
|
|
25
|
+
import com.airbnb.lottie.compose.LottieAnimation
|
|
26
|
+
import com.airbnb.lottie.compose.LottieCompositionSpec
|
|
27
|
+
import com.airbnb.lottie.compose.animateLottieCompositionAsState
|
|
28
|
+
import com.airbnb.lottie.compose.rememberLottieComposition
|
|
29
|
+
import com.airbnb.lottie.compose.rememberLottieDynamicProperties
|
|
30
|
+
import com.airbnb.lottie.compose.rememberLottieDynamicProperty
|
|
31
|
+
import vn.momo.kits.const.AppNavigationBar
|
|
32
|
+
import vn.momo.kits.const.AppStatusBar
|
|
33
|
+
import vn.momo.kits.utils.readJson
|
|
34
|
+
import androidx.activity.compose.BackHandler as AndroidBackHandler
|
|
35
|
+
|
|
36
|
+
actual fun getPlatformName(): String = "Android"
|
|
37
|
+
|
|
38
|
+
@Composable
|
|
39
|
+
actual fun getScreenDimensions(): ScreenDimension {
|
|
40
|
+
val config = LocalConfiguration.current
|
|
41
|
+
return ScreenDimension(
|
|
42
|
+
config.screenWidthDp, config.screenHeightDp
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
actual fun NativePaint.setMaskFilter(blurRadius: Float) {
|
|
47
|
+
this.maskFilter = BlurMaskFilter(blurRadius, BlurMaskFilter.Blur.NORMAL)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@SuppressLint("InternalInsetResource")
|
|
51
|
+
@Composable
|
|
52
|
+
actual fun getStatusBarHeight(): Dp {
|
|
53
|
+
val resourceId = Resources.getSystem().getIdentifier(
|
|
54
|
+
"status_bar_height",
|
|
55
|
+
"dimen",
|
|
56
|
+
"android"
|
|
57
|
+
)
|
|
58
|
+
return if(resourceId > 0) Resources.getSystem().getDimensionPixelSize(resourceId).dp else 0.dp
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@Composable
|
|
62
|
+
actual fun BackHandler(enabled: Boolean, onBack: () -> Unit) {
|
|
63
|
+
AndroidBackHandler(enabled = enabled, onBack = onBack)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@Composable
|
|
67
|
+
actual fun ProvideNavigationEventDispatcherOwner(content: @Composable () -> Unit) {
|
|
68
|
+
content()
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@Composable
|
|
72
|
+
actual fun getScreenHeight(): Dp {
|
|
73
|
+
return getScreenDimensions().height.dp + if (getOSVersion() >= 35) 0.dp else AppStatusBar.current + AppNavigationBar.current
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
actual fun getOSVersion(): OSVersion = OSVersion.Android(sdk = Build.VERSION.SDK_INT)
|
|
77
|
+
|
|
78
|
+
@Composable
|
|
79
|
+
actual fun LottieAnimation(
|
|
80
|
+
path: String,
|
|
81
|
+
tintColor: Color?,
|
|
82
|
+
bgColor: Color?,
|
|
83
|
+
placedAsOverlay: Boolean,
|
|
84
|
+
iterations: Int,
|
|
85
|
+
isPlaying: Boolean,
|
|
86
|
+
onEvent: ((String) -> Unit)?,
|
|
87
|
+
modifier: Modifier,
|
|
88
|
+
useCompose: Boolean
|
|
89
|
+
) {
|
|
90
|
+
if (useCompose) {
|
|
91
|
+
ComposeLottieAnimation(path, tintColor, bgColor, iterations, isPlaying, onEvent, modifier)
|
|
92
|
+
return
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
val json = readJson(path)
|
|
96
|
+
|
|
97
|
+
if (json.isEmpty()) {
|
|
98
|
+
Box(modifier)
|
|
99
|
+
return
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
val composition by rememberLottieComposition(
|
|
103
|
+
LottieCompositionSpec.JsonString(json)
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
val colorFilter = PorterDuffColorFilter(
|
|
107
|
+
tintColor?.toArgb() ?: Color.White.toArgb(),
|
|
108
|
+
PorterDuff.Mode.SRC_ATOP
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
val dynamicProperties = rememberLottieDynamicProperties(
|
|
112
|
+
rememberLottieDynamicProperty(
|
|
113
|
+
property = LottieProperty.COLOR_FILTER,
|
|
114
|
+
value = colorFilter,
|
|
115
|
+
keyPath = arrayOf("**")
|
|
116
|
+
)
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
val lottieState = animateLottieCompositionAsState(
|
|
120
|
+
composition = composition,
|
|
121
|
+
iterations = iterations,
|
|
122
|
+
isPlaying = isPlaying,
|
|
123
|
+
restartOnPlay = false,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
val currentOnEvent by rememberUpdatedState(onEvent)
|
|
127
|
+
|
|
128
|
+
LaunchedEffect(isPlaying) {
|
|
129
|
+
currentOnEvent?.invoke(if (isPlaying) LottieEvent.Start else LottieEvent.Pause)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
LaunchedEffect(lottieState) {
|
|
133
|
+
var armed = false
|
|
134
|
+
snapshotFlow { lottieState.isAtEnd }.collect { atEnd ->
|
|
135
|
+
if (!atEnd) armed = true
|
|
136
|
+
else if (armed) { armed = false; currentOnEvent?.invoke(LottieEvent.Finish) }
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
LottieAnimation(
|
|
141
|
+
composition = composition,
|
|
142
|
+
progress = { lottieState.progress },
|
|
143
|
+
dynamicProperties = if (tintColor != null) dynamicProperties else null,
|
|
144
|
+
modifier = modifier
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
actual fun NativePaint.setColor(color: Color){
|
|
149
|
+
this.color = color.toArgb()
|
|
150
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
package vn.momo.kits.application
|
|
2
|
+
|
|
3
|
+
import androidx.compose.foundation.background
|
|
4
|
+
import androidx.compose.foundation.layout.*
|
|
5
|
+
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
6
|
+
import androidx.compose.runtime.Composable
|
|
7
|
+
import androidx.compose.ui.Modifier
|
|
8
|
+
import androidx.compose.ui.graphics.Color
|
|
9
|
+
import androidx.compose.ui.unit.dp
|
|
10
|
+
import androidx.compose.ui.zIndex
|
|
11
|
+
import vn.momo.kits.components.InputSearch
|
|
12
|
+
import vn.momo.kits.components.InputSearchProps
|
|
13
|
+
import vn.momo.kits.const.Radius
|
|
14
|
+
import vn.momo.kits.const.Spacing
|
|
15
|
+
|
|
16
|
+
@Composable
|
|
17
|
+
internal fun AnimationSearchInput(
|
|
18
|
+
animations: HeaderAnimations,
|
|
19
|
+
inputSearchProps: InputSearchProps
|
|
20
|
+
) {
|
|
21
|
+
Box(
|
|
22
|
+
modifier = Modifier
|
|
23
|
+
.fillMaxWidth()
|
|
24
|
+
.offset(
|
|
25
|
+
x = animations.translateX.dp,
|
|
26
|
+
y = animations.translateY.dp
|
|
27
|
+
)
|
|
28
|
+
) {
|
|
29
|
+
Box(
|
|
30
|
+
modifier = Modifier
|
|
31
|
+
.height(HEADER_HEIGHT.dp)
|
|
32
|
+
.padding(vertical = Spacing.S)
|
|
33
|
+
.zIndex(1f)
|
|
34
|
+
) {
|
|
35
|
+
Box(
|
|
36
|
+
modifier = Modifier
|
|
37
|
+
.width(animations.width.dp)
|
|
38
|
+
.background(
|
|
39
|
+
color = animations.backgroundSearch,
|
|
40
|
+
shape = RoundedCornerShape(Radius.XL)
|
|
41
|
+
)
|
|
42
|
+
) {
|
|
43
|
+
InputSearch(
|
|
44
|
+
inputSearchProps = inputSearchProps.copy(
|
|
45
|
+
showButtonText = false,
|
|
46
|
+
backgroundColor = Color.Transparent
|
|
47
|
+
)
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
package vn.momo.kits.application
|
|
2
|
+
|
|
3
|
+
import androidx.compose.runtime.Immutable
|
|
4
|
+
import androidx.compose.runtime.staticCompositionLocalOf
|
|
5
|
+
import vn.momo.kits.components.TrustBannerData
|
|
6
|
+
|
|
7
|
+
@Immutable
|
|
8
|
+
data class FeatureFlags(
|
|
9
|
+
val showBaseLineDebug: Boolean? = false,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
@Immutable
|
|
13
|
+
data class DesignSystemConfig(
|
|
14
|
+
val trustBanner: TrustBannerData? = null,
|
|
15
|
+
val headerBar: String? = null,
|
|
16
|
+
val headerGradient: String? = null,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
@Immutable
|
|
20
|
+
data class MiniAppContext(
|
|
21
|
+
val appIcon: String = "",
|
|
22
|
+
val appName: Any? = null,
|
|
23
|
+
val appId: String = "",
|
|
24
|
+
val appCode: String = "",
|
|
25
|
+
val description: Any? = null,
|
|
26
|
+
val support: Map<String, Any?> = emptyMap(),
|
|
27
|
+
val toolkitConfig: Map<String, Any?> = emptyMap(),
|
|
28
|
+
val providerId: String = "",
|
|
29
|
+
val permissions: List<Map<String, Any>>? = emptyList(),
|
|
30
|
+
val features: FeatureFlags? = null,
|
|
31
|
+
val scaleSizeMaxRate: Float? = null,
|
|
32
|
+
val userScaleRate: Float? = null,
|
|
33
|
+
val useOSScaleRate: Boolean? = null,
|
|
34
|
+
) {
|
|
35
|
+
companion object {
|
|
36
|
+
|
|
37
|
+
fun toMap(context: MiniAppContext?): Map<String, Any?> = mapOf(
|
|
38
|
+
"icon" to (context?.appIcon ?: ""),
|
|
39
|
+
"name" to context?.appName,
|
|
40
|
+
"appId" to (context?.appId ?: ""),
|
|
41
|
+
"code" to (context?.appCode ?: ""),
|
|
42
|
+
"description" to (context?.description ?: ""),
|
|
43
|
+
"support" to (context?.support ?: emptyMap()),
|
|
44
|
+
"toolkitConfig" to (context?.toolkitConfig ?: emptyMap()),
|
|
45
|
+
"providerId" to (context?.providerId ?: ""),
|
|
46
|
+
"permissions" to (context?.permissions ?: emptyList()),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
fun merge(parent: MiniAppContext?, child: MiniAppContext?): MiniAppContext? {
|
|
50
|
+
if (parent == null && child == null) return null
|
|
51
|
+
if (parent == null) return child
|
|
52
|
+
if (child == null) return parent
|
|
53
|
+
|
|
54
|
+
return MiniAppContext(
|
|
55
|
+
appIcon = parent.appIcon.ifBlank { child.appIcon },
|
|
56
|
+
appName = parent.appName ?: child.appName,
|
|
57
|
+
appId = parent.appId.ifBlank { child.appId },
|
|
58
|
+
appCode = parent.appCode.ifBlank { child.appCode },
|
|
59
|
+
description = parent.description ?: child.description,
|
|
60
|
+
support = mergeMaps(parent.support, child.support),
|
|
61
|
+
toolkitConfig = mergeMaps(parent.toolkitConfig, child.toolkitConfig),
|
|
62
|
+
providerId = parent.providerId.ifBlank { child.providerId },
|
|
63
|
+
permissions = if (!parent.permissions.isNullOrEmpty()) parent.permissions else child.permissions,
|
|
64
|
+
features = mergeFeatureFlags(parent.features, child.features),
|
|
65
|
+
scaleSizeMaxRate = parent.scaleSizeMaxRate ?: child.scaleSizeMaxRate,
|
|
66
|
+
userScaleRate = parent.userScaleRate ?: child.userScaleRate,
|
|
67
|
+
useOSScaleRate = parent.useOSScaleRate ?: child.useOSScaleRate,
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
private fun mergeMaps(parent: Map<String, Any?>, child: Map<String, Any?>): Map<String, Any?> {
|
|
72
|
+
return child + parent
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
private fun mergeFeatureFlags(parent: FeatureFlags?, child: FeatureFlags?): FeatureFlags? {
|
|
76
|
+
if (parent == null && child == null) return null
|
|
77
|
+
if (parent == null) return child
|
|
78
|
+
if (child == null) return parent
|
|
79
|
+
|
|
80
|
+
return FeatureFlags(
|
|
81
|
+
showBaseLineDebug = parent.showBaseLineDebug ?: child.showBaseLineDebug
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@Immutable
|
|
88
|
+
data class ComponentInformation(
|
|
89
|
+
val componentName: String? = null,
|
|
90
|
+
val componentId: String? = null,
|
|
91
|
+
val params: Map<String,Any?>? = null,
|
|
92
|
+
val action: String? = null
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
var IsShowBaseLineDebug = false
|
|
96
|
+
|
|
97
|
+
val LocalContext = staticCompositionLocalOf<MiniAppContext?> {
|
|
98
|
+
null
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
val LocalComponentInformation = staticCompositionLocalOf<ComponentInformation?> {
|
|
102
|
+
null
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@Deprecated("Max font scale is fixed at MAX_FONT_SCALE (1.5); this CompositionLocal is no longer read.")
|
|
106
|
+
val ScaleSizeMaxRate = staticCompositionLocalOf<Float?> { null }
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
package vn.momo.kits.application
|
|
2
|
+
|
|
3
|
+
import androidx.compose.animation.*
|
|
4
|
+
import androidx.compose.animation.core.CubicBezierEasing
|
|
5
|
+
import androidx.compose.animation.core.animateDpAsState
|
|
6
|
+
import androidx.compose.animation.core.tween
|
|
7
|
+
import androidx.compose.foundation.ScrollState
|
|
8
|
+
import androidx.compose.foundation.background
|
|
9
|
+
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
10
|
+
import androidx.compose.foundation.layout.*
|
|
11
|
+
import androidx.compose.material3.AlertDialogDefaults.shape
|
|
12
|
+
import androidx.compose.material3.FloatingActionButton
|
|
13
|
+
import androidx.compose.material3.FloatingActionButtonDefaults
|
|
14
|
+
import androidx.compose.runtime.*
|
|
15
|
+
import androidx.compose.runtime.saveable.rememberSaveable
|
|
16
|
+
import androidx.compose.ui.Alignment
|
|
17
|
+
import androidx.compose.ui.Modifier
|
|
18
|
+
import androidx.compose.ui.graphics.Color
|
|
19
|
+
import androidx.compose.ui.unit.Dp
|
|
20
|
+
import androidx.compose.ui.unit.dp
|
|
21
|
+
import androidx.compose.ui.zIndex
|
|
22
|
+
import kotlinx.coroutines.delay
|
|
23
|
+
import kotlinx.coroutines.flow.MutableStateFlow
|
|
24
|
+
import kotlinx.coroutines.flow.collectLatest
|
|
25
|
+
import kotlinx.coroutines.launch
|
|
26
|
+
import vn.momo.kits.components.Icon
|
|
27
|
+
import vn.momo.kits.components.Text
|
|
28
|
+
import vn.momo.kits.const.Typography
|
|
29
|
+
import kotlin.time.Duration.Companion.milliseconds
|
|
30
|
+
|
|
31
|
+
enum class FABSize {
|
|
32
|
+
SMALL,
|
|
33
|
+
DEFAULT,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
enum class FABPosition {
|
|
37
|
+
END,
|
|
38
|
+
CENTER,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
data class FabProps(
|
|
42
|
+
val icon: String,
|
|
43
|
+
val iconColor: Color? = null,
|
|
44
|
+
val label: String? = null,
|
|
45
|
+
val onClick: () -> Unit,
|
|
46
|
+
val size: FABSize = FABSize.DEFAULT,
|
|
47
|
+
val bottom: Dp? = null,
|
|
48
|
+
val scrollState: ScrollState? = null,
|
|
49
|
+
val position: FABPosition? = FABPosition.END,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
@Deprecated("Use vn.momo.kits.navigation.FloatingButton instead", ReplaceWith("vn.momo.kits.navigation.FloatingButton"))
|
|
53
|
+
@Composable
|
|
54
|
+
internal fun FloatingButton(
|
|
55
|
+
scrollPosition: Int,
|
|
56
|
+
bottom: Dp,
|
|
57
|
+
onClick: () -> Unit,
|
|
58
|
+
containerColor: Color,
|
|
59
|
+
contentColor: Color = containerColor,
|
|
60
|
+
icon: String,
|
|
61
|
+
iconColor: Color? = null,
|
|
62
|
+
text: String? = null,
|
|
63
|
+
elevation: androidx.compose.material3.FloatingActionButtonElevation = FloatingActionButtonDefaults.elevation(
|
|
64
|
+
4.dp,
|
|
65
|
+
4.dp,
|
|
66
|
+
4.dp,
|
|
67
|
+
4.dp
|
|
68
|
+
),
|
|
69
|
+
size: FABSize = FABSize.DEFAULT,
|
|
70
|
+
position: FABPosition = FABPosition.END,
|
|
71
|
+
keyboardSize: Dp = 0.dp,
|
|
72
|
+
) {
|
|
73
|
+
val scrollPositionStateFlow = remember { MutableStateFlow(scrollPosition) }
|
|
74
|
+
var lastScrollPosition by rememberSaveable { mutableStateOf(0) }
|
|
75
|
+
val coroutineScope = rememberCoroutineScope()
|
|
76
|
+
var isExpanded by rememberSaveable { mutableStateOf(false) }
|
|
77
|
+
|
|
78
|
+
val startPadding = if (isExpanded) 12.dp else 0.dp
|
|
79
|
+
val endPadding = if (isExpanded) 12.dp else 0.dp
|
|
80
|
+
val widthIn = if ((size === FABSize.SMALL)) 36.dp else 48.dp
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
val width = animateDpAsState(
|
|
84
|
+
targetValue = if (isExpanded && text != null) 80.dp else widthIn,
|
|
85
|
+
animationSpec = tween(
|
|
86
|
+
durationMillis = 200,
|
|
87
|
+
easing = CubicBezierEasing(0.2f, 0.2f, 0.2f, 0.2f),
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
LaunchedEffect(text) {
|
|
92
|
+
if (text != null) {
|
|
93
|
+
coroutineScope.launch {
|
|
94
|
+
scrollPositionStateFlow
|
|
95
|
+
.collectLatest { debouncedScrollPosition ->
|
|
96
|
+
isExpanded = debouncedScrollPosition > lastScrollPosition
|
|
97
|
+
delay(300.milliseconds)
|
|
98
|
+
lastScrollPosition = debouncedScrollPosition
|
|
99
|
+
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
LaunchedEffect(scrollPosition) {
|
|
106
|
+
scrollPositionStateFlow.value = scrollPosition
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
Box(
|
|
110
|
+
Modifier
|
|
111
|
+
.fillMaxSize()
|
|
112
|
+
.padding(end = 12.dp, bottom = bottom)
|
|
113
|
+
.offset(y = -keyboardSize)
|
|
114
|
+
.background(Color.Transparent)
|
|
115
|
+
.zIndex(10f),
|
|
116
|
+
contentAlignment = if (position == FABPosition.END) Alignment.BottomEnd else Alignment.BottomCenter,
|
|
117
|
+
) {
|
|
118
|
+
FloatingActionButton(
|
|
119
|
+
onClick = onClick,
|
|
120
|
+
shape = shape,
|
|
121
|
+
containerColor = containerColor,
|
|
122
|
+
contentColor = contentColor,
|
|
123
|
+
elevation = elevation,
|
|
124
|
+
interactionSource = remember { MutableInteractionSource() },
|
|
125
|
+
modifier = Modifier
|
|
126
|
+
.sizeIn(minWidth = width.value)
|
|
127
|
+
.height(widthIn)
|
|
128
|
+
) {
|
|
129
|
+
Row(
|
|
130
|
+
modifier = Modifier.padding(start = startPadding, end = endPadding),
|
|
131
|
+
verticalAlignment = Alignment.CenterVertically,
|
|
132
|
+
horizontalArrangement = if (isExpanded) Arrangement.Start else Arrangement.Center
|
|
133
|
+
) {
|
|
134
|
+
Icon(
|
|
135
|
+
icon,
|
|
136
|
+
size = if (size === FABSize.SMALL) 12.dp else 24.dp,
|
|
137
|
+
color = iconColor ?: Color.White
|
|
138
|
+
)
|
|
139
|
+
AnimatedVisibility(
|
|
140
|
+
visible = isExpanded,
|
|
141
|
+
enter = ExtendedFabExpandAnimation,
|
|
142
|
+
exit = ExtendedFabCollapseAnimation,
|
|
143
|
+
) {
|
|
144
|
+
Row {
|
|
145
|
+
Spacer(Modifier.width(12.dp))
|
|
146
|
+
Text(
|
|
147
|
+
text ?: "",
|
|
148
|
+
color = Color.White,
|
|
149
|
+
style = Typography.actionDefaultBold
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
private val ExtendedFabCollapseAnimation = fadeOut(
|
|
159
|
+
animationSpec = tween(
|
|
160
|
+
durationMillis = 800,
|
|
161
|
+
easing = CubicBezierEasing(0.0f, 0.0f, 1.0f, 1.0f),
|
|
162
|
+
)
|
|
163
|
+
) + shrinkHorizontally(
|
|
164
|
+
animationSpec = tween(
|
|
165
|
+
durationMillis = 500,
|
|
166
|
+
easing = CubicBezierEasing(0.2f, 0.0f, 0.0f, 1.0f),
|
|
167
|
+
),
|
|
168
|
+
shrinkTowards = Alignment.Start,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
private val ExtendedFabExpandAnimation = fadeIn(
|
|
172
|
+
animationSpec = tween(
|
|
173
|
+
durationMillis = 200,
|
|
174
|
+
delayMillis = 100,
|
|
175
|
+
easing = CubicBezierEasing(0.0f, 0.0f, 1.0f, 1.0f),
|
|
176
|
+
),
|
|
177
|
+
) + expandHorizontally(
|
|
178
|
+
animationSpec = tween(
|
|
179
|
+
durationMillis = 500,
|
|
180
|
+
easing = CubicBezierEasing(0.2f, 0.0f, 0.0f, 1.0f),
|
|
181
|
+
),
|
|
182
|
+
expandFrom = Alignment.Start,
|
|
183
|
+
)
|