@momo-kits/native-kits 0.300.7 → 0.300.8-beta.1-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 +12 -8
- package/README.md +8 -7
- package/build.gradle.kts +13 -0
- package/compose/build.gradle.kts +195 -0
- package/compose/build.gradle.kts.backup +195 -0
- package/compose/compose.podspec +47 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +19 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +12 -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 +154 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReduceMotion.android.kt +17 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +6 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +110 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +61 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/KitsBinding.kt +60 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/KitsHost.kt +32 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +1067 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +268 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +55 -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 +81 -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 +354 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +115 -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 +130 -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 +482 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +49 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +86 -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 +224 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +137 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +473 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +113 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +262 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +237 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +228 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +280 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +183 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +342 -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 +40 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +82 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +39 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +362 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +108 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +304 -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 +88 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +308 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +218 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +456 -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 +205 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +89 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +542 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +175 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +201 -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 +176 -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 +208 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +180 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +325 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +12 -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 +194 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +291 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +54 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/HeaderLayout.kt +71 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +50 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ModalLayout.kt +184 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +315 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +41 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +54 -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 +397 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +58 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +153 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +118 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +212 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +422 -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 +750 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +152 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +35 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +244 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +398 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +103 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +93 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +208 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +133 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +167 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +446 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +105 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +106 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +74 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +387 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +39 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +363 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HelpCenterRequest.kt +33 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +197 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +133 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/ToolkitRequests.kt +38 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +135 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +12 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +114 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +7 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReduceMotion.kt +7 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +21 -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 +117 -0
- package/compose/src/commonTest/kotlin/vn/momo/kits/application/KitsHostTest.kt +44 -0
- package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/HelpCenterRequestTest.kt +39 -0
- package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/ToolkitRequestsTest.kt +53 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +42 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +45 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +31 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +38 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +65 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +217 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReduceMotion.ios.kt +48 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +143 -0
- package/gradle/libs.versions.toml +66 -0
- package/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/gradle/wrapper/gradle-wrapper.properties +8 -0
- package/gradle.properties +24 -0
- package/gradlew +252 -0
- package/gradlew.bat +94 -0
- package/ios/Application/ApplicationEnvironment.swift +6 -4
- package/ios/Application/DesignSystemKits.swift +59 -13
- package/ios/Application/DesignSystemKitsPayload.swift +0 -8
- package/ios/Application/LanguageSource.swift +2 -11
- package/ios/Application/Localize.swift +8 -35
- package/ios/Application/LocalizeModifier.swift +2 -11
- package/ios/Application/MaxApi.swift +3 -11
- package/ios/Avatar/Avatar.swift +0 -1
- package/ios/Badge/Badge.swift +5 -8
- package/ios/Badge/BadgeRibbon.swift +2 -5
- package/ios/Button/Button.swift +4 -8
- package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +5 -7
- package/ios/Carousel/Carousel.swift +4 -17
- package/ios/Checkbox/Checkbox.swift +0 -2
- package/ios/Collapse/Collapse.swift +17 -11
- package/ios/Colors+Radius+Spacing/Theme.swift +0 -7
- package/ios/DateTimePicker/DateTimePicker.swift +4 -10
- package/ios/DateTimePicker/DateTimePickerTypes.swift +1 -3
- package/ios/DateTimePicker/DateTimePickerUtils.swift +0 -3
- package/ios/DateTimePicker/WheelPicker.swift +2 -4
- package/ios/Extensions/ActiveOpacityButtonStyle.swift +2 -3
- package/ios/Extensions/Color++.swift +2 -4
- package/ios/Extensions/SkeletonUICompat.swift +0 -8
- package/ios/Icon/Icon.swift +3 -6
- package/ios/IconButton/IconButton.swift +2 -5
- package/ios/Input/ErrorView.swift +0 -7
- package/ios/Input/Input.swift +9 -20
- package/ios/Input/InputPhoneNumber.swift +37 -20
- package/ios/Input/InputSearch.swift +23 -12
- package/ios/Input/InputTextArea.swift +4 -13
- package/ios/InputDropDown/InputDropDown.swift +1 -11
- package/ios/InputMoney/InputMoney.swift +9 -28
- package/ios/InputOTP/InputOTP.swift +2 -9
- package/ios/Layout/HeaderLayout.swift +72 -0
- package/ios/Layout/Item.swift +1 -2
- package/ios/Layout/ModalLayout.swift +144 -0
- package/ios/Layout/ScreenLayout.swift +48 -31
- package/ios/Layout/Section.swift +2 -3
- package/ios/Loader/Loader.swift +3 -12
- package/ios/Lottie/LottieView.swift +0 -11
- package/ios/Navigation/BottomSheet.swift +73 -94
- package/ios/Navigation/BottomTab/BottomTab.swift +58 -73
- package/ios/Navigation/BottomTab/BottomTabBar.swift +286 -121
- package/ios/Navigation/BottomTab/CurvedContainer.swift +52 -54
- package/ios/Navigation/BottomTab/DuoBarCompression.swift +5 -12
- package/ios/Navigation/BottomTab/DuoTabBar.swift +67 -202
- package/ios/Navigation/BottomTab/TabBarMetrics.swift +97 -0
- package/ios/Navigation/Component/FloatingButton.swift +4 -11
- package/ios/Navigation/Component/Header.swift +35 -54
- package/ios/Navigation/Component/HeaderBackground.swift +2 -8
- package/ios/Navigation/Component/HeaderJourney.swift +4 -8
- package/ios/Navigation/Component/HeaderLocation.swift +4 -8
- package/ios/Navigation/Component/HeaderRight.swift +20 -22
- package/ios/Navigation/Component/HeaderTitle.swift +1 -6
- package/ios/Navigation/Component/HeaderUser.swift +4 -10
- package/ios/Navigation/Component/SideBar.swift +6 -21
- package/ios/Navigation/Component/SnackBar.swift +9 -13
- package/ios/Navigation/HostBackGestureBridge.swift +2 -9
- package/ios/Navigation/ModalScreen.swift +24 -13
- package/ios/Navigation/Navigation.swift +35 -19
- package/ios/Navigation/NavigationContainer.swift +4 -15
- package/ios/Navigation/Navigator.swift +21 -39
- package/ios/Navigation/StackScreen.swift +64 -51
- package/ios/Navigation/StackTransition.swift +7 -14
- package/ios/Navigation/SwipeBackHaptic.swift +2 -7
- package/ios/Navigation/Tracking/ScreenTracker.swift +2 -7
- package/ios/Pagination/PaginationDot.swift +0 -9
- package/ios/Pagination/PaginationNumber.swift +1 -9
- package/ios/Pagination/PaginationScroll.swift +2 -14
- package/ios/Pagination/PaginationWhiteDot.swift +1 -10
- package/ios/Popup/PopupDisplay.swift +7 -5
- package/ios/Popup/PopupInput.swift +6 -4
- package/ios/Popup/PopupLayout.swift +17 -9
- package/ios/Popup/PopupNotify.swift +32 -25
- package/ios/PopupView/FullscreenPopup.swift +3 -4
- package/ios/PopupView/PopupView.swift +2 -2
- package/ios/PopupView/Utils++.swift +1 -2
- package/ios/ProgressInfo/ProgressInfo.swift +2 -13
- package/ios/Skeleton/Skeleton.swift +5 -16
- package/ios/Slider/Slider.swift +5 -12
- package/ios/StatusBarTap/StatusBarTap.h +2 -3
- package/ios/StatusBarTap/StatusBarTap.m +3 -16
- package/ios/Stepper/Stepper.swift +8 -27
- package/ios/Steps/Steps.swift +29 -26
- package/ios/Swipeable/SwipeCell.swift +2 -2
- package/ios/Swipeable/SwipeCellModel.swift +3 -6
- package/ios/TabView/TabView.swift +14 -28
- package/ios/Template/TrustBanner/TrustBanner.swift +2 -9
- package/ios/Title/Title.swift +1 -3
- package/ios/Tooltip/Tooltip.swift +4 -9
- package/ios/Typography/FontScale.swift +79 -24
- package/ios/Typography/Text.swift +6 -12
- package/ios/Typography/Typography.swift +8 -11
- package/ios/Uploader/Uploader.swift +2 -17
- package/ios-demo/README.md +120 -0
- package/ios-demo/Resources/tabbar_scan_qr_button.json +1 -0
- package/ios-demo/Resources/tabbar_scan_qr_label.json +1 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +11 -2
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +296 -59
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +15 -4
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LocalizeDemo.swift +0 -8
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +114 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +29 -1
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +16 -0
- package/package.json +1 -1
- package/publish.sh +8 -2
- package/scripts/ci/build-swiftui.sh +22 -0
- package/scripts/ci/resolve-version.mjs +144 -0
- package/settings.gradle.kts +63 -0
|
@@ -13,6 +13,14 @@ struct PopupNotifyDemo: View {
|
|
|
13
13
|
|
|
14
14
|
// MARK: - Preview
|
|
15
15
|
|
|
16
|
+
// Figma Risk - eKYC (node 51445-177824)
|
|
17
|
+
private let popupHighlightTitle = "Tạm khoá giao dịch để bảo vệ bạn"
|
|
18
|
+
private let popupHighlightSentence =
|
|
19
|
+
"Mỗi ngày có ít nhất 20 người bị lừa đảo hơn 100 triệu đồng trong các giao dịch có dấu hiệu tương tự"
|
|
20
|
+
private let popupHighlightDescription =
|
|
21
|
+
"Hệ thống AI của MoMo đánh giá giao dịch này có dấu hiệu rủi ro. \(popupHighlightSentence)\n"
|
|
22
|
+
+ "Hãy kiểm tra lại người nhận và lý do chuyển tiền trước khi quyết định tiếp tục."
|
|
23
|
+
|
|
16
24
|
@available(iOS 16.0, *)
|
|
17
25
|
private struct PopupNotifyPreview: View {
|
|
18
26
|
@EnvironmentObject private var navigator: Navigator
|
|
@@ -21,6 +29,22 @@ private struct PopupNotifyPreview: View {
|
|
|
21
29
|
BasicColumnBox("PopupNotify", alignment: .leading) {
|
|
22
30
|
MoMoUIKits.Button(title: "Show popup", action: { show() }, size: .large)
|
|
23
31
|
}
|
|
32
|
+
BasicColumnBox("Highlight text", alignment: .leading) {
|
|
33
|
+
MoMoUIKits.Button(title: "Show highlight popup", action: { showHighlight() }, type: .secondary, size: .large)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private func showHighlight() {
|
|
38
|
+
navigator.showModal {
|
|
39
|
+
PopupNotify(props: PopupNotifyProps(
|
|
40
|
+
title: popupHighlightTitle,
|
|
41
|
+
description: popupHighlightDescription,
|
|
42
|
+
primary: PopupAction(title: "Primary", onPress: { navigator.hideOverplay() }),
|
|
43
|
+
secondary: PopupAction(title: "Secondary", onPress: { navigator.hideOverplay() }),
|
|
44
|
+
onIconClose: { navigator.hideOverplay() },
|
|
45
|
+
highlightText: [popupHighlightSentence]
|
|
46
|
+
))
|
|
47
|
+
}
|
|
24
48
|
}
|
|
25
49
|
|
|
26
50
|
private func show() {
|
|
@@ -53,6 +77,7 @@ private struct PopupNotifyPlayground: View {
|
|
|
53
77
|
@State private var image = "https://static.momocdn.net/app/img/popup_permission/img_permission_popup_camera.png"
|
|
54
78
|
@State private var title = "Title"
|
|
55
79
|
@State private var description = "Check lại một nhịp auto chuyển sang dạng CTA."
|
|
80
|
+
@State private var highlightText = ""
|
|
56
81
|
@State private var error = "9004"
|
|
57
82
|
@State private var primaryTitle = "Primary"
|
|
58
83
|
@State private var secondaryTitle = "Secondary"
|
|
@@ -68,6 +93,7 @@ private struct PopupNotifyPlayground: View {
|
|
|
68
93
|
.string("Image", $image),
|
|
69
94
|
.string("Title", $title),
|
|
70
95
|
.string("Description", $description),
|
|
96
|
+
.string("HighlightText: [String] (comma-separated)", $highlightText),
|
|
71
97
|
.string("Error", $error),
|
|
72
98
|
.string("PrimaryTitle", $primaryTitle),
|
|
73
99
|
.string("SecondaryTitle", $secondaryTitle),
|
|
@@ -88,7 +114,9 @@ private struct PopupNotifyPlayground: View {
|
|
|
88
114
|
secondary: PopupAction(title: secondaryTitle, onPress: { navigator.hideOverplay() }),
|
|
89
115
|
buttonDirection: (direction?.value as? PopupActionDirection) ?? .auto,
|
|
90
116
|
onIconClose: { navigator.hideOverplay() },
|
|
91
|
-
isShowCloseIcon: showClose
|
|
117
|
+
isShowCloseIcon: showClose,
|
|
118
|
+
highlightText: highlightText.components(separatedBy: ",")
|
|
119
|
+
.map { $0.trimmingCharacters(in: .whitespaces) }
|
|
92
120
|
))
|
|
93
121
|
}
|
|
94
122
|
}
|
|
@@ -39,6 +39,8 @@ struct TypographyDemo: View {
|
|
|
39
39
|
// MARK: - Preview
|
|
40
40
|
|
|
41
41
|
private struct TypographyPreview: View {
|
|
42
|
+
@Environment(\.appTheme) private var theme
|
|
43
|
+
|
|
42
44
|
var body: some View {
|
|
43
45
|
BasicColumnBox("Headers", alignment: .leading) {
|
|
44
46
|
MomoText("Headline Default Bold", typography: .headlineDefaultBold)
|
|
@@ -63,6 +65,20 @@ private struct TypographyPreview: View {
|
|
|
63
65
|
MomoText("Action XS Bold", typography: .actionXsBold)
|
|
64
66
|
MomoText("Action XXS Bold", typography: .actionXxsBold)
|
|
65
67
|
}
|
|
68
|
+
BasicColumnBox("ScaleSizeScope", alignment: .leading) {
|
|
69
|
+
MomoText(
|
|
70
|
+
"Increase the system font size to compare",
|
|
71
|
+
typography: .descriptionXsRegular,
|
|
72
|
+
color: theme.colors.text.secondary
|
|
73
|
+
)
|
|
74
|
+
MomoText("No scope", typography: .bodyDefaultRegular)
|
|
75
|
+
ScaleSizeScope(scaleSizeMaxRate: 1) {
|
|
76
|
+
MomoText("ScaleSizeScope(1)", typography: .bodyDefaultRegular)
|
|
77
|
+
}
|
|
78
|
+
ScaleSizeScope(scaleSizeMaxRate: 1.2) {
|
|
79
|
+
MomoText("ScaleSizeScope(1.2)", typography: .bodyDefaultRegular)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
66
82
|
}
|
|
67
83
|
}
|
|
68
84
|
|
package/package.json
CHANGED
package/publish.sh
CHANGED
|
@@ -291,9 +291,14 @@ phase_publish_maven() {
|
|
|
291
291
|
VERSION=$(node -p "require('./package.json').version")
|
|
292
292
|
export VERSION="$VERSION"
|
|
293
293
|
|
|
294
|
+
# Maven publishes to MoMo Artifacts (url in gradle.properties); credentials come from CI variables.
|
|
295
|
+
: "${PUBLISHING_USER:?Set PUBLISHING_USER for MoMo Artifacts}"
|
|
296
|
+
: "${PUBLISHING_PASSWORD:?Set PUBLISHING_PASSWORD for MoMo Artifacts}"
|
|
297
|
+
|
|
294
298
|
echo "📦 Publishing KMP artifacts to Maven (version ${VERSION})..."
|
|
295
299
|
|
|
296
|
-
./gradlew :compose:publishAllPublicationsToGitLabPackagesRepository
|
|
300
|
+
./gradlew :compose:publishAllPublicationsToGitLabPackagesRepository \
|
|
301
|
+
-Pgitlab.user="$PUBLISHING_USER" -Pgitlab.password="$PUBLISHING_PASSWORD"
|
|
297
302
|
|
|
298
303
|
echo "✅ compose Maven publishing completed successfully!"
|
|
299
304
|
|
|
@@ -314,7 +319,8 @@ phase_publish_maven() {
|
|
|
314
319
|
sed -i '/^compose {$/,/^}$/d' sample/shared/build.gradle.kts
|
|
315
320
|
fi
|
|
316
321
|
|
|
317
|
-
./gradlew :sample:shared:publishAllPublicationsToGitLabPackagesRepository
|
|
322
|
+
./gradlew :sample:shared:publishAllPublicationsToGitLabPackagesRepository \
|
|
323
|
+
-Pgitlab.user="$PUBLISHING_USER" -Pgitlab.password="$PUBLISHING_PASSWORD"
|
|
318
324
|
|
|
319
325
|
# Restore composeResources and build.gradle.kts
|
|
320
326
|
echo "📦 Restoring sample/shared composeResources and build.gradle.kts..."
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Compiles the SwiftUI kit (pod MoMoUIKits) through the sample's Pods project, as it ships in the npm package.
|
|
3
|
+
# Exit 3 = the runner has no CocoaPods / Xcode; CI turns that into a warning instead of a failure.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
cd "$(dirname "$0")/../.."
|
|
6
|
+
|
|
7
|
+
for tool in pod xcodebuild; do
|
|
8
|
+
if ! command -v "$tool" >/dev/null 2>&1; then
|
|
9
|
+
echo "⚠️ $tool is not installed on this runner: SwiftUI build skipped"
|
|
10
|
+
exit 3
|
|
11
|
+
fi
|
|
12
|
+
done
|
|
13
|
+
|
|
14
|
+
# pod install rewrites the lock with the podspec's placeholder version; keep the tracked one.
|
|
15
|
+
LOCK_BACKUP="$(mktemp)"
|
|
16
|
+
cp sample/iosApp/Podfile.lock "$LOCK_BACKUP"
|
|
17
|
+
trap 'cp "$LOCK_BACKUP" sample/iosApp/Podfile.lock; rm -f "$LOCK_BACKUP"' EXIT
|
|
18
|
+
(cd sample/iosApp && pod install)
|
|
19
|
+
xcodebuild -project sample/iosApp/Pods/Pods.xcodeproj -scheme MoMoUIKits -sdk iphonesimulator \
|
|
20
|
+
-destination 'generic/platform=iOS Simulator' -derivedDataPath build/swiftui \
|
|
21
|
+
CODE_SIGNING_ALLOWED=NO -quiet build
|
|
22
|
+
echo "✅ SwiftUI kit builds"
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Prints the version to publish as dotenv (VERSION=…, NPM_TAG=…); logs go to stderr.
|
|
3
|
+
//
|
|
4
|
+
// node scripts/ci/resolve-version.mjs release [--version 0.169.1] # default: npm latest + 1 patch
|
|
5
|
+
// node scripts/ci/resolve-version.mjs beta # <npm latest + 1 patch>-beta.N
|
|
6
|
+
//
|
|
7
|
+
// The base comes from npm; a candidate is free only when neither npm (incl. its -debug twin) nor Maven
|
|
8
|
+
// has it, so a publish that died half way burns its number instead of being overwritten.
|
|
9
|
+
|
|
10
|
+
import { execFileSync } from 'node:child_process';
|
|
11
|
+
import { readFileSync } from 'node:fs';
|
|
12
|
+
import https from 'node:https';
|
|
13
|
+
import path from 'node:path';
|
|
14
|
+
import { fileURLToPath } from 'node:url';
|
|
15
|
+
|
|
16
|
+
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..');
|
|
17
|
+
const NPM_REGISTRY = 'https://registry.npmjs.org';
|
|
18
|
+
const MAVEN_ARTIFACTS = ['kits', 'demo'];
|
|
19
|
+
const MAX_TRIES = 500;
|
|
20
|
+
const STABLE = /^(\d+)\.(\d+)\.(\d+)$/;
|
|
21
|
+
|
|
22
|
+
const log = (...args) => console.error(...args);
|
|
23
|
+
const fail = (message) => {
|
|
24
|
+
log(`❌ ${message}`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
function parseArgs([channel, ...rest]) {
|
|
29
|
+
if (channel !== 'release' && channel !== 'beta') fail('Channel must be release or beta');
|
|
30
|
+
let version = '';
|
|
31
|
+
for (let i = 0; i < rest.length; i += 2) {
|
|
32
|
+
if (rest[i] !== '--version') fail(`Unknown option ${rest[i]}`);
|
|
33
|
+
version = rest[i + 1] ?? '';
|
|
34
|
+
}
|
|
35
|
+
if (version && channel !== 'release') fail('--version is only for release');
|
|
36
|
+
if (version && !STABLE.test(version)) fail(`--version must look like 0.169.1, got "${version}"`);
|
|
37
|
+
return { channel, version };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function readGradleProperties() {
|
|
41
|
+
const props = {};
|
|
42
|
+
for (const line of readFileSync(path.join(ROOT, 'gradle.properties'), 'utf8').split('\n')) {
|
|
43
|
+
const match = line.match(/^\s*([^#!\s][^=]*?)\s*=\s*(.*?)\s*$/);
|
|
44
|
+
if (match) props[match[1]] = match[2];
|
|
45
|
+
}
|
|
46
|
+
return props;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function get(url, auth) {
|
|
50
|
+
return new Promise((resolve, reject) => {
|
|
51
|
+
const headers = auth ? { Authorization: `Basic ${Buffer.from(auth).toString('base64')}` } : {};
|
|
52
|
+
const req = https.get(url, { headers, timeout: 30_000 }, (res) => {
|
|
53
|
+
let body = '';
|
|
54
|
+
res.setEncoding('utf8');
|
|
55
|
+
res.on('data', (chunk) => (body += chunk));
|
|
56
|
+
res.on('end', () => resolve({ status: res.statusCode, body }));
|
|
57
|
+
});
|
|
58
|
+
req.on('timeout', () => req.destroy(new Error(`Timed out: ${url}`)));
|
|
59
|
+
req.on('error', reject);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const parseStable = (v) => STABLE.exec(v)?.slice(1).map(Number);
|
|
64
|
+
const isGreater = (a, b) => {
|
|
65
|
+
for (let i = 0; i < 3; i++) if (a[i] !== b[i]) return a[i] > b[i];
|
|
66
|
+
return false;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
async function main() {
|
|
70
|
+
const opts = parseArgs(process.argv.slice(2));
|
|
71
|
+
const pkg = JSON.parse(readFileSync(path.join(ROOT, 'package.json'), 'utf8'));
|
|
72
|
+
const props = readGradleProperties();
|
|
73
|
+
|
|
74
|
+
const npmInfo = JSON.parse(
|
|
75
|
+
execFileSync(
|
|
76
|
+
'npm',
|
|
77
|
+
['view', pkg.name, 'versions', 'time', 'dist-tags', '--json', '--prefer-online', '--registry', NPM_REGISTRY],
|
|
78
|
+
{ cwd: ROOT, encoding: 'utf8', stdio: ['ignore', 'pipe', 'inherit'], maxBuffer: 64 * 1024 * 1024 },
|
|
79
|
+
),
|
|
80
|
+
);
|
|
81
|
+
// `time` also keeps unpublished versions, which npm never lets anyone reuse.
|
|
82
|
+
const npmVersions = new Set([...(npmInfo.versions ?? []), ...Object.keys(npmInfo.time ?? {})]);
|
|
83
|
+
const latestVersion = npmInfo['dist-tags']?.latest;
|
|
84
|
+
const latest = parseStable(String(latestVersion));
|
|
85
|
+
if (!latest) fail(`npm latest is "${latestVersion}", expected x.y.z`);
|
|
86
|
+
|
|
87
|
+
const mavenBase = `${props.url}/${props.group.replace(/\./g, '/')}`;
|
|
88
|
+
const mavenUser = process.env.MAVEN_USER || process.env.PUBLISHING_USER || props['gitlab.user'];
|
|
89
|
+
const mavenToken = process.env.MAVEN_TOKEN || process.env.PUBLISHING_PASSWORD || props['gitlab.password'];
|
|
90
|
+
const mavenAuth = mavenUser && mavenToken ? `${mavenUser}:${mavenToken}` : undefined;
|
|
91
|
+
const mavenVersions = new Set();
|
|
92
|
+
for (const artifact of MAVEN_ARTIFACTS) {
|
|
93
|
+
const res = await get(`${mavenBase}/${artifact}/maven-metadata.xml`, mavenAuth);
|
|
94
|
+
if (res.status === 404) continue;
|
|
95
|
+
if (res.status !== 200) fail(`Maven metadata for ${artifact} returned HTTP ${res.status}`);
|
|
96
|
+
for (const [, v] of res.body.matchAll(/<version>([^<]+)<\/version>/g)) mavenVersions.add(v);
|
|
97
|
+
}
|
|
98
|
+
log(`🔎 npm latest ${latestVersion} (${npmVersions.size} versions), Maven ${mavenVersions.size} versions`);
|
|
99
|
+
|
|
100
|
+
// maven-metadata.xml can lag behind an upload, so the candidate's pom is checked too (HEAD gets a 405).
|
|
101
|
+
const taken = async (v) => {
|
|
102
|
+
if (npmVersions.has(v) || npmVersions.has(`${v}-debug`) || mavenVersions.has(v)) return true;
|
|
103
|
+
for (const artifact of MAVEN_ARTIFACTS) {
|
|
104
|
+
const res = await get(`${mavenBase}/${artifact}/${v}/${artifact}-${v}.pom`, mavenAuth);
|
|
105
|
+
if (res.status < 400) return true;
|
|
106
|
+
if (res.status !== 404) fail(`Could not check ${artifact}@${v} on Maven (HTTP ${res.status})`);
|
|
107
|
+
}
|
|
108
|
+
return false;
|
|
109
|
+
};
|
|
110
|
+
const firstFree = async (candidate) => {
|
|
111
|
+
for (let i = 0; i < MAX_TRIES; i++) {
|
|
112
|
+
const v = candidate(i);
|
|
113
|
+
if (!(await taken(v))) return v;
|
|
114
|
+
log(` ${v} is taken, trying the next one`);
|
|
115
|
+
}
|
|
116
|
+
fail(`No free version after ${MAX_TRIES} tries`);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const [major, minor, patch] = latest;
|
|
120
|
+
let version;
|
|
121
|
+
let npmTag;
|
|
122
|
+
if (opts.channel === 'release') {
|
|
123
|
+
if (opts.version) {
|
|
124
|
+
if (!isGreater(parseStable(opts.version), latest)) fail(`${opts.version} must be above npm latest ${latestVersion}`);
|
|
125
|
+
if (await taken(opts.version)) fail(`${opts.version} already exists on npm or Maven`);
|
|
126
|
+
version = opts.version;
|
|
127
|
+
} else {
|
|
128
|
+
version = await firstFree((i) => `${major}.${minor}.${patch + 1 + i}`);
|
|
129
|
+
}
|
|
130
|
+
npmTag = 'latest';
|
|
131
|
+
} else {
|
|
132
|
+
const base = `${major}.${minor}.${patch + 1}`;
|
|
133
|
+
const pattern = new RegExp(`^${base.replace(/\./g, '\\.')}-beta\\.(\\d+)(?:-debug)?$`);
|
|
134
|
+
const numbers = [...npmVersions].map((v) => pattern.exec(v)?.[1]).filter(Boolean).map(Number);
|
|
135
|
+
const start = numbers.length ? Math.max(...numbers) + 1 : 1;
|
|
136
|
+
version = await firstFree((i) => `${base}-beta.${start + i}`);
|
|
137
|
+
npmTag = 'beta';
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
log(`✅ ${version} (npm tag ${npmTag})`);
|
|
141
|
+
process.stdout.write(`VERSION=${version}\nNPM_TAG=${npmTag}\n`);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
main().catch((error) => fail(error.stack || String(error)));
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import org.gradle.kotlin.dsl.maven
|
|
2
|
+
|
|
3
|
+
rootProject.name = "momo-native-kits"
|
|
4
|
+
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
|
5
|
+
|
|
6
|
+
pluginManagement {
|
|
7
|
+
repositories {
|
|
8
|
+
google {
|
|
9
|
+
mavenContent {
|
|
10
|
+
includeGroupAndSubgroups("androidx")
|
|
11
|
+
includeGroupAndSubgroups("com.android")
|
|
12
|
+
includeGroupAndSubgroups("com.google")
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
mavenCentral()
|
|
16
|
+
gradlePluginPortal()
|
|
17
|
+
maven {
|
|
18
|
+
url = uri("https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven")
|
|
19
|
+
credentials {username = "download_packages"; password = "gldt-bjDqLpU_sPcHDuXau2ws" }
|
|
20
|
+
}
|
|
21
|
+
maven {
|
|
22
|
+
url = uri("https://artifacts.mservice.com.vn/repository/maven-momo-app/")
|
|
23
|
+
credentials {
|
|
24
|
+
username = "viewer"
|
|
25
|
+
password = "viewer"
|
|
26
|
+
}
|
|
27
|
+
isAllowInsecureProtocol = true
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
dependencyResolutionManagement {
|
|
33
|
+
repositories {
|
|
34
|
+
google {
|
|
35
|
+
mavenContent {
|
|
36
|
+
includeGroupAndSubgroups("androidx")
|
|
37
|
+
includeGroupAndSubgroups("com.android")
|
|
38
|
+
includeGroupAndSubgroups("com.google")
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
mavenCentral()
|
|
42
|
+
maven {
|
|
43
|
+
url = uri("https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven")
|
|
44
|
+
credentials {
|
|
45
|
+
username = "download_packages";
|
|
46
|
+
password = "gldt-bjDqLpU_sPcHDuXau2ws"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
maven {
|
|
50
|
+
url = uri("https://artifacts.mservice.com.vn/repository/maven-momo-app/")
|
|
51
|
+
credentials {
|
|
52
|
+
username = "viewer"
|
|
53
|
+
password = "viewer"
|
|
54
|
+
}
|
|
55
|
+
isAllowInsecureProtocol = true
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
include(":compose")
|
|
61
|
+
|
|
62
|
+
include(":sample:androidApp")
|
|
63
|
+
include(":sample:shared")
|