@momo-kits/native-kits 0.168.1-beta.3-debug → 0.168.1-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/CLAUDE.md +14 -10
  2. package/README.md +2 -10
  3. package/ios/Application/ApplicationEnvironment.swift +7 -6
  4. package/ios/Application/DesignSystemKits.swift +163 -0
  5. package/ios/Application/DesignSystemKitsPayload.swift +68 -0
  6. package/ios/Badge/BadgeRibbon.swift +8 -1
  7. package/ios/Extensions/Color++.swift +2 -4
  8. package/ios/Input/Input.swift +13 -3
  9. package/ios/Input/InputPhoneNumber.swift +1 -3
  10. package/ios/Input/InputSearch.swift +1 -2
  11. package/ios/Input/InputTextArea.swift +5 -3
  12. package/ios/InputMoney/InputMoney.swift +6 -7
  13. package/ios/Layout/ScreenLayout.swift +65 -10
  14. package/ios/Navigation/BottomSheet.swift +152 -21
  15. package/ios/Navigation/BottomTab/BottomTab.swift +12 -18
  16. package/ios/Navigation/BottomTab/BottomTabBar.swift +255 -114
  17. package/ios/Navigation/BottomTab/CurvedContainer.swift +51 -47
  18. package/ios/Navigation/BottomTab/DuoBarCompression.swift +2 -3
  19. package/ios/Navigation/BottomTab/DuoTabBar.swift +63 -172
  20. package/ios/Navigation/BottomTab/TabBarMetrics.swift +88 -0
  21. package/ios/Navigation/Component/HeaderBackground.swift +22 -1
  22. package/ios/Navigation/Component/SnackBar.swift +4 -0
  23. package/ios/Navigation/ModalScreen.swift +7 -3
  24. package/ios/Navigation/StackScreen.swift +6 -8
  25. package/ios/Popup/PopupDisplay.swift +2 -2
  26. package/ios/Popup/PopupInput.swift +2 -2
  27. package/ios/Popup/PopupLayout.swift +15 -10
  28. package/ios/Popup/PopupNotify.swift +2 -2
  29. package/ios/Stepper/Stepper.swift +1 -2
  30. package/ios/Template/TrustBanner/TrustBanner.swift +4 -2
  31. package/ios/Typography/FontScale.swift +29 -15
  32. package/ios/Typography/Text.swift +86 -12
  33. package/ios/Typography/Typography.swift +2 -2
  34. package/ios/native-kits.podspec +1 -1
  35. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  36. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +224 -59
  37. package/package.json +1 -1
  38. package/publish.sh +2 -7
  39. package/build.gradle.kts +0 -13
  40. package/compose/build.gradle.kts +0 -197
  41. package/compose/build.gradle.kts.backup +0 -197
  42. package/compose/compose.podspec +0 -47
  43. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +0 -19
  44. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +0 -6
  45. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +0 -12
  46. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +0 -7
  47. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -153
  48. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +0 -6
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -124
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -1071
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +0 -269
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +0 -65
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +0 -157
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +0 -81
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +0 -32
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +0 -338
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -175
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +0 -357
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -115
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -89
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +0 -128
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +0 -209
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -542
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +0 -49
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +0 -86
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +0 -125
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +0 -231
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +0 -189
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -478
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +0 -114
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +0 -265
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -235
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +0 -223
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +0 -265
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +0 -185
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +0 -343
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +0 -108
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +0 -56
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +0 -41
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -84
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +0 -40
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +0 -361
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +0 -108
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -308
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +0 -59
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +0 -87
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -21
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -90
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +0 -330
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +0 -220
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +0 -473
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +0 -122
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -207
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -92
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -560
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -86
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +0 -125
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +0 -207
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +0 -501
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +0 -176
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +0 -182
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +0 -193
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +0 -29
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +0 -236
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -180
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +0 -325
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +0 -16
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitDesignSystem.kt +0 -18
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitFontScale.kt +0 -22
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +0 -12
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +0 -16
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +0 -194
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -283
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +0 -54
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +0 -50
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +0 -309
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +0 -41
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -52
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -66
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +0 -11
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -104
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -48
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +0 -51
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +0 -338
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +0 -58
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +0 -137
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -116
  128. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -215
  129. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +0 -404
  130. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +0 -8
  131. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +0 -732
  132. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +0 -148
  133. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +0 -40
  134. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +0 -233
  135. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -217
  136. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -86
  137. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +0 -98
  138. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +0 -312
  139. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -169
  140. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +0 -455
  141. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -103
  142. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +0 -106
  143. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +0 -74
  144. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +0 -413
  145. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -39
  146. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +0 -363
  147. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HelpCenterRequest.kt +0 -37
  148. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +0 -192
  149. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -133
  150. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/ToolkitRequests.kt +0 -41
  151. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -135
  152. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +0 -12
  153. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -91
  154. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +0 -9
  155. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -74
  156. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +0 -13
  157. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +0 -1329
  158. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +0 -55
  159. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +0 -15
  160. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +0 -118
  161. package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/HelpCenterRequestTest.kt +0 -44
  162. package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/ToolkitRequestsTest.kt +0 -62
  163. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +0 -40
  164. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +0 -45
  165. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +0 -36
  166. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +0 -38
  167. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +0 -66
  168. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -217
  169. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +0 -94
  170. package/gradle/libs.versions.toml +0 -76
  171. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  172. package/gradle/wrapper/gradle-wrapper.properties +0 -10
  173. package/gradle.properties +0 -26
  174. package/gradlew +0 -252
  175. package/gradlew.bat +0 -94
  176. package/ios/Typography/FontScaleStore.swift +0 -58
  177. package/ios/Typography/KitDesignSystem.swift +0 -17
  178. package/ios-demo/README.md +0 -120
  179. package/settings.gradle.kts +0 -64
package/gradlew.bat DELETED
@@ -1,94 +0,0 @@
1
- @rem
2
- @rem Copyright 2015 the original author or authors.
3
- @rem
4
- @rem Licensed under the Apache License, Version 2.0 (the "License");
5
- @rem you may not use this file except in compliance with the License.
6
- @rem You may obtain a copy of the License at
7
- @rem
8
- @rem https://www.apache.org/licenses/LICENSE-2.0
9
- @rem
10
- @rem Unless required by applicable law or agreed to in writing, software
11
- @rem distributed under the License is distributed on an "AS IS" BASIS,
12
- @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- @rem See the License for the specific language governing permissions and
14
- @rem limitations under the License.
15
- @rem
16
- @rem SPDX-License-Identifier: Apache-2.0
17
- @rem
18
-
19
- @if "%DEBUG%"=="" @echo off
20
- @rem ##########################################################################
21
- @rem
22
- @rem Gradle startup script for Windows
23
- @rem
24
- @rem ##########################################################################
25
-
26
- @rem Set local scope for the variables with windows NT shell
27
- if "%OS%"=="Windows_NT" setlocal
28
-
29
- set DIRNAME=%~dp0
30
- if "%DIRNAME%"=="" set DIRNAME=.
31
- @rem This is normally unused
32
- set APP_BASE_NAME=%~n0
33
- set APP_HOME=%DIRNAME%
34
-
35
- @rem Resolve any "." and ".." in APP_HOME to make it shorter.
36
- for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
37
-
38
- @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
39
- set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
40
-
41
- @rem Find java.exe
42
- if defined JAVA_HOME goto findJavaFromJavaHome
43
-
44
- set JAVA_EXE=java.exe
45
- %JAVA_EXE% -version >NUL 2>&1
46
- if %ERRORLEVEL% equ 0 goto execute
47
-
48
- echo. 1>&2
49
- echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50
- echo. 1>&2
51
- echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52
- echo location of your Java installation. 1>&2
53
-
54
- goto fail
55
-
56
- :findJavaFromJavaHome
57
- set JAVA_HOME=%JAVA_HOME:"=%
58
- set JAVA_EXE=%JAVA_HOME%/bin/java.exe
59
-
60
- if exist "%JAVA_EXE%" goto execute
61
-
62
- echo. 1>&2
63
- echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64
- echo. 1>&2
65
- echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66
- echo location of your Java installation. 1>&2
67
-
68
- goto fail
69
-
70
- :execute
71
- @rem Setup the command line
72
-
73
- set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
74
-
75
-
76
- @rem Execute Gradle
77
- "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
78
-
79
- :end
80
- @rem End local scope for the variables with windows NT shell
81
- if %ERRORLEVEL% equ 0 goto mainEnd
82
-
83
- :fail
84
- rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
85
- rem the _cmd.exe /c_ return code!
86
- set EXIT_CODE=%ERRORLEVEL%
87
- if %EXIT_CODE% equ 0 set EXIT_CODE=1
88
- if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
89
- exit /b %EXIT_CODE%
90
-
91
- :mainEnd
92
- if "%OS%"=="Windows_NT" endlocal
93
-
94
- :omega
@@ -1,58 +0,0 @@
1
- import SwiftUI
2
-
3
- /// App-wide font-scale inputs for the SwiftUI kit, and the single place they publish from.
4
- /// The host writes `update(...)` at startup (from the cache-backed `FontScaleProvider`) and again
5
- /// whenever the in-app font-size preference changes; the OS Dynamic Type factor is tracked here.
6
- /// Mirrors Compose's `KitFontScale` + `ProvideOsFontScale` pair, including its live behaviour —
7
- /// views re-render on change as long as the subtree got `.momoFontScale()` (`NavigationContainer`
8
- /// applies it). When `useOSScaleRate` is false the kit applies `userScaleRate` instead of the OS factor.
9
- public final class FontScaleStore: ObservableObject {
10
- public static let shared = FontScaleStore()
11
-
12
- @Published public private(set) var userScaleRate: CGFloat = 1
13
- @Published public private(set) var useOSScaleRate: Bool = true
14
- @Published public private(set) var osFontScale: CGFloat = FontScaleStore.currentOsFontScale()
15
-
16
- private init() {
17
- NotificationCenter.default.addObserver(
18
- self,
19
- selector: #selector(contentSizeCategoryDidChange),
20
- name: UIContentSizeCategory.didChangeNotification,
21
- object: nil
22
- )
23
- }
24
-
25
- public var snapshot: FontScale {
26
- FontScale(
27
- userScaleRate: userScaleRate,
28
- useOSScaleRate: useOSScaleRate,
29
- osFontScale: osFontScale
30
- )
31
- }
32
-
33
- public func update(userScaleRate: CGFloat, useOSScaleRate: Bool) {
34
- onMain {
35
- // Re-assigning an unchanged value would still publish and invalidate every kit subtree.
36
- if self.userScaleRate != userScaleRate { self.userScaleRate = userScaleRate }
37
- if self.useOSScaleRate != useOSScaleRate { self.useOSScaleRate = useOSScaleRate }
38
- }
39
- }
40
-
41
- @objc private func contentSizeCategoryDidChange() {
42
- let next = Self.currentOsFontScale()
43
- guard next != osFontScale else { return }
44
- osFontScale = next
45
- }
46
-
47
- /// Same factor Compose's iOS `ProvideOsFontScale` derives from
48
- /// `UIFont.preferredFont(forTextStyle: .body).pointSize / 17`, so both iOS surfaces scale alike.
49
- static func currentOsFontScale() -> CGFloat {
50
- let base = UIFont.systemFont(ofSize: UIFont.labelFontSize)
51
- return UIFontMetrics.default.scaledFont(for: base).pointSize / base.pointSize
52
- }
53
-
54
- /// Synchronous when already on main — an async hop would defer the change by a frame.
55
- private func onMain(_ work: @escaping () -> Void) {
56
- if Thread.isMainThread { work() } else { DispatchQueue.main.async(execute: work) }
57
- }
58
- }
@@ -1,17 +0,0 @@
1
- import Foundation
2
-
3
- /// Design-system rollout flag for the SwiftUI kit, mirroring Compose's `KitDesignSystem`.
4
- /// The kit is sandboxed and can't read the host config, so the host writes `update(_:)` once at
5
- /// startup from `DesignSystemConfig`. Startup-only and non-reactive, like `FontScaleStore` was
6
- /// before it gained live updates: there is no SwiftUI navigation container to re-render from.
7
- public final class KitDesignSystem {
8
- public static let shared = KitDesignSystem()
9
-
10
- public private(set) var isWhiteList: Bool = false
11
-
12
- private init() {}
13
-
14
- public func update(isWhiteList: Bool) {
15
- self.isWhiteList = isWhiteList
16
- }
17
- }
@@ -1,120 +0,0 @@
1
- # MoMoUIKitsDemo
2
-
3
- SwiftUI demo browser for `MoMoUIKits`.
4
-
5
- The package can optionally host a Compose UIKits screen by receiving a
6
- `UIViewController` factory from the host app. It does not import the KMP
7
- `shared` module directly.
8
-
9
- SwiftUI mode reuses the full demo screen set from
10
- `sample/iosApp/iosApp/Demo`, including the sample `HomeView` registry and demo
11
- screens for all currently available components.
12
-
13
- ## CocoaPods
14
-
15
- In the host app `Podfile`, include both local pods:
16
-
17
- ```ruby
18
- pod 'MoMoUIKits', :path => '../momo-native-kits/ios/native-kits.podspec'
19
- pod 'MoMoUIKitsDemo', :path => '../momo-native-kits/ios-demo'
20
- ```
21
-
22
- Adjust the relative paths to match the host app checkout.
23
-
24
- ## Host App Usage
25
-
26
- ```swift
27
- import MoMoUIKitsDemo
28
- import shared
29
-
30
- class UIKitsViewController: BaseComposeAppViewController {
31
- override func getViewController() -> UIViewController? {
32
- let params = self.application.data as? [String: Any]
33
-
34
- return MoMoUIKitsDemoViewControllerFactory.make(
35
- context: MoMoUIKitsDemoContext(
36
- appId: params?["appId"] as? String ?? "",
37
- appCode: params?["code"] as? String ?? "",
38
- appName: params?["name"] as? String,
39
- appIcon: params?["icon"] as? String ?? ""
40
- ),
41
- composeViewController: {
42
- UIKitsScreenComposeViewControllerKt.UIKitsScreenComposeViewController(
43
- params: params
44
- )
45
- }
46
- )
47
- }
48
-
49
- override func viewDidDisappear(_ animated: Bool) {
50
- super.viewDidDisappear(animated)
51
- composeViewController = nil
52
- }
53
- }
54
- ```
55
-
56
- If the host does not pass `composeViewController`, the demo opens directly in
57
- SwiftUI mode.
58
-
59
- ## Included SwiftUI Demos
60
-
61
- The pod includes the sample demo screens for:
62
-
63
- - Animated Header
64
- - Avatar
65
- - Badge
66
- - Baseline View
67
- - Bottom Tab
68
- - Button
69
- - Carousel
70
- - Checkbox
71
- - Chip
72
- - Collapse
73
- - DateTimePicker
74
- - Divider
75
- - Header User
76
- - Icon Button
77
- - Image
78
- - Information
79
- - Input
80
- - Input DropDown
81
- - Input Money
82
- - Input OTP
83
- - Input Phone Number
84
- - Input Search
85
- - Input TextArea
86
- - Loader
87
- - Navigation
88
- - Pagination
89
- - Popup Display
90
- - Popup Notify
91
- - Popup Promotion
92
- - Progress Info
93
- - Radio
94
- - Rating
95
- - Skeleton
96
- - Slider
97
- - SnackBar
98
- - Stepper
99
- - Steps
100
- - Suggest Action
101
- - Swipe
102
- - Switch
103
- - TabView
104
- - Tag
105
- - Theme
106
- - Title
107
- - Tooltip
108
- - Typography
109
- - Uploader
110
-
111
- ## Validation Notes
112
-
113
- Validated locally with:
114
-
115
- ```sh
116
- pod ipc spec ios/MoMoUIKits.podspec
117
- pod ipc spec ios-demo/MoMoUIKitsDemo.podspec
118
- pod lib lint ios/MoMoUIKits.podspec --allow-warnings --skip-import-validation
119
- pod lib lint ios-demo/MoMoUIKitsDemo.podspec --allow-warnings --skip-import-validation --include-podspecs=ios/MoMoUIKits.podspec
120
- ```
@@ -1,64 +0,0 @@
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 { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
43
- maven {
44
- url = uri("https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven")
45
- credentials {
46
- username = "download_packages";
47
- password = "gldt-bjDqLpU_sPcHDuXau2ws"
48
- }
49
- }
50
- maven {
51
- url = uri("https://artifacts.mservice.com.vn/repository/maven-momo-app/")
52
- credentials {
53
- username = "viewer"
54
- password = "viewer"
55
- }
56
- isAllowInsecureProtocol = true
57
- }
58
- }
59
- }
60
-
61
- include(":compose")
62
-
63
- include(":sample:androidApp")
64
- include(":sample:shared")