@momo-kits/native-kits 0.169.8-beta.7 → 0.169.8-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.
Files changed (156) hide show
  1. package/build.gradle.kts +11 -0
  2. package/compose/build.gradle.kts +198 -0
  3. package/compose/compose.podspec +47 -0
  4. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +19 -0
  5. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
  6. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +12 -0
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +7 -0
  8. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +154 -0
  9. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReduceMotion.android.kt +17 -0
  10. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +6 -0
  11. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +110 -0
  12. package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +62 -0
  13. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +1067 -0
  14. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +267 -0
  15. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +56 -0
  16. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
  17. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +82 -0
  18. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
  19. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +338 -0
  20. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +175 -0
  21. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +356 -0
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +115 -0
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +89 -0
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +128 -0
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +209 -0
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +482 -0
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +49 -0
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +86 -0
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +125 -0
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +224 -0
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +137 -0
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +473 -0
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +113 -0
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +263 -0
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +235 -0
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +228 -0
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +265 -0
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +183 -0
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +343 -0
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +40 -0
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +82 -0
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +39 -0
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +363 -0
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +108 -0
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +307 -0
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +59 -0
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +21 -0
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +88 -0
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +306 -0
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +220 -0
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +457 -0
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +122 -0
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +205 -0
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +89 -0
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +542 -0
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +86 -0
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +175 -0
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +201 -0
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +498 -0
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +176 -0
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +182 -0
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +193 -0
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +210 -0
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +180 -0
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +325 -0
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +12 -0
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +194 -0
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +292 -0
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +54 -0
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +50 -0
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ModalLayout.kt +184 -0
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +316 -0
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +41 -0
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +52 -0
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +66 -0
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +104 -0
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +48 -0
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +397 -0
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +58 -0
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +153 -0
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +113 -0
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +205 -0
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +422 -0
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +727 -0
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +148 -0
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +35 -0
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +242 -0
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +391 -0
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +100 -0
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +97 -0
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +207 -0
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +132 -0
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +167 -0
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +456 -0
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +105 -0
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +106 -0
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +74 -0
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +399 -0
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +39 -0
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +363 -0
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +204 -0
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +133 -0
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +127 -0
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +12 -0
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +114 -0
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +9 -0
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +76 -0
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReduceMotion.kt +7 -0
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +22 -0
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +55 -0
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +118 -0
  123. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +42 -0
  124. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +45 -0
  125. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +32 -0
  126. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +38 -0
  127. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +66 -0
  128. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +218 -0
  129. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReduceMotion.ios.kt +48 -0
  130. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +144 -0
  131. package/gradle/libs.versions.toml +67 -0
  132. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  133. package/gradle/wrapper/gradle-wrapper.properties +8 -0
  134. package/gradle.properties +24 -0
  135. package/gradlew +252 -0
  136. package/gradlew.bat +94 -0
  137. package/ios/Input/InputSearch.swift +6 -23
  138. package/ios/Navigation/BottomTab/BottomTabBar.swift +0 -9
  139. package/ios/Navigation/Component/Header.swift +46 -31
  140. package/ios/Navigation/Component/HeaderJourney.swift +1 -2
  141. package/ios/Navigation/Component/HeaderLocation.swift +1 -2
  142. package/ios/Navigation/Component/HeaderRight.swift +15 -18
  143. package/ios/Navigation/Component/HeaderUser.swift +1 -2
  144. package/ios/Navigation/Component/SideBar.swift +13 -4
  145. package/ios/Navigation/Navigation.swift +1 -31
  146. package/ios/Navigation/StackScreen.swift +14 -43
  147. package/ios/native-kits.podspec +1 -1
  148. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  149. package/ios-demo/README.md +120 -0
  150. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +2 -11
  151. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +1 -13
  152. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +0 -11
  153. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +1 -1
  154. package/package.json +1 -1
  155. package/settings.gradle.kts +64 -0
  156. package/ios/Layout/HeaderLayout.swift +0 -60
@@ -0,0 +1,120 @@
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
+ ```
@@ -30,7 +30,6 @@ struct AnimatedHeaderDemoContent: View {
30
30
 
31
31
  @State private var ratio: AnimatedHeaderRatio = .ratio16_9
32
32
  @State private var isSurface = true
33
- @State private var isStretch = true
34
33
 
35
34
  private let imageUrl = "https://static.momocdn.net/app/img/booking/holiday/mid_atumn_dldl.jpeg"
36
35
 
@@ -48,11 +47,6 @@ struct AnimatedHeaderDemoContent: View {
48
47
  MomoText("Surface")
49
48
  }
50
49
 
51
- // wide windows (short side >= 600): phone-sized banner, sides filled with the banner color
52
- Toggle(isOn: $isStretch) {
53
- MomoText("Stretch content layout")
54
- }
55
-
56
50
  MoMoUIKits.Button(
57
51
  title: "Show Animated Header",
58
52
  action: show,
@@ -69,7 +63,6 @@ struct AnimatedHeaderDemoContent: View {
69
63
  private func show() {
70
64
  let ratio = ratio
71
65
  let isSurface = isSurface
72
- let contentLayout: ContentLayout = isStretch ? .stretch : .grid
73
66
  let url = imageUrl
74
67
  navigator.push(
75
68
  { AnimatedHeaderTargetScreen(ratio: ratio) },
@@ -84,10 +77,8 @@ struct AnimatedHeaderDemoContent: View {
84
77
  .frame(maxWidth: .infinity, maxHeight: .infinity)
85
78
  .clipped()
86
79
  )
87
- },
88
- bannerBackgroundColor: Colors.pink09
89
- ),
90
- contentLayout: contentLayout
80
+ }
81
+ )
91
82
  )
92
83
  )
93
84
  }
@@ -39,8 +39,6 @@ private struct DemoConfig: Hashable {
39
39
  var initialRouteName = "Momo"
40
40
  var compressionBehavior: DuoBarCompressionBehavior = .toolbar
41
41
  var backToInitialTab = true
42
- // a sticky footer in the tab's content body, to check it clears the floating bar
43
- var footer = false
44
42
 
45
43
  var visibleTabs: [TabConfig] { Array(tabs.prefix(tabCount)) }
46
44
  }
@@ -109,10 +107,7 @@ struct BottomTabDemoContent: View {
109
107
  icon: tab.icon,
110
108
  showDot: tab.showDot,
111
109
  badgeLabel: tab.badgeLabel,
112
- options: NavigationOptions(
113
- headerTitle: .default(tab.label),
114
- footer: config.footer ? { AnyView(demoFooter) } : nil
115
- ),
110
+ options: NavigationOptions(headerTitle: .default(tab.label)),
116
111
  screen: { TabContent(name: tab.name, config: $config, focused: $focused) }
117
112
  )
118
113
  },
@@ -129,10 +124,6 @@ struct BottomTabDemoContent: View {
129
124
  .onAppear { ctaLottieLoader.load() }
130
125
  }
131
126
 
132
- private var demoFooter: some View {
133
- MoMoUIKits.Button(title: "Footer trong content", action: {}, isFull: true)
134
- }
135
-
136
127
  private var floatingButton: BottomTabFloatingButton? {
137
128
  guard config.special else { return nil }
138
129
  guard config.ctaLottie else {
@@ -211,9 +202,6 @@ private struct TabContent: View {
211
202
  ])
212
203
  Options(title: "backToInitialTab", hint: "Back ở tab khác quay về tab đầu trước khi rời màn",
213
204
  options: yesNo(config.backToInitialTab) { config.backToInitialTab = $0 })
214
- Options(title: "footer",
215
- hint: "Footer dính trong content body, kiểm tra nó nằm trên thanh tab nổi",
216
- options: yesNo(config.footer) { config.footer = $0 })
217
205
  }
218
206
 
219
207
  Section(title: "Nút giữa (floatingButton)") {
@@ -273,9 +273,7 @@ private struct HeaderTypesScreen: View {
273
273
 
274
274
  @EnvironmentObject private var navigation: Navigation
275
275
  @Environment(\.applicationEnvironment) private var applicationEnvironment
276
- @Environment(\.screenLayout) private var layout
277
276
  @State private var kind: AnyHashable = Kind.default
278
- @State private var contentLayout: AnyHashable = ContentLayout.grid
279
277
  @State private var titlePosition: AnyHashable = TitlePosition.left
280
278
  @State private var showBack = true
281
279
  @State private var headerRight: AnyHashable = HeaderRightOption.toolkit
@@ -297,15 +295,6 @@ private struct HeaderTypesScreen: View {
297
295
  }, label: position == .left ? "LEFT" : "CENTER")
298
296
  }
299
297
  Divider()
300
- // stretch only differs on wide windows (short side >= 600, iPhone Duo excluded)
301
- let headerLayout = layout.headerLayout(contentLayout.base as? ContentLayout ?? .grid)
302
- MomoText("Content Layout · wide: \(headerLayout.isWide), frame inset: \(Int(headerLayout.frameInset))")
303
- ForEach([ContentLayout.grid, ContentLayout.stretch], id: \.self) { item in
304
- Radio(value: item, groupValue: $contentLayout, onChange: {
305
- navigation.setOptions { $0.contentLayout = item }
306
- }, label: item == .grid ? "Grid" : "Stretch")
307
- }
308
- Divider()
309
298
  Checkbox($showBack, onChange: { checked in
310
299
  navigation.setOptions { $0.hiddenBack = !checked }
311
300
  }, title: "Show Back")
@@ -14,7 +14,7 @@ struct PopupNotifyDemo: View {
14
14
  // MARK: - Preview
15
15
 
16
16
  // Figma Risk - eKYC (node 51445-177824)
17
- private let popupHighlightTitle = "Tạm khoá giao dịch để báo vệ bạn"
17
+ private let popupHighlightTitle = "Tạm khoá giao dịch để bảo vệ bạn"
18
18
  private let popupHighlightSentence =
19
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
20
  private let popupHighlightDescription =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.169.8-beta.7",
3
+ "version": "0.169.8-debug",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "publish:local": "bash publish.sh local"
@@ -0,0 +1,64 @@
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")
@@ -1,60 +0,0 @@
1
- // Top navigation spec (Figma "Top Navigation · Màn hình gập"). Mirrors Compose `layout/HeaderLayout.kt`
2
- // and RN; keep the three in sync.
3
-
4
- import SwiftUI
5
-
6
- /// Header spec values, in points. Public so custom header rights and extensions can match them.
7
- public enum HeaderLayoutMetrics {
8
- public static let buttonSize: CGFloat = 32
9
- public static let iconSize: CGFloat = 20
10
- public static let pillWidth: CGFloat = 72
11
- public static let searchHeight: CGFloat = 32
12
- public static let titleGap: CGFloat = Spacing.S
13
- public static let sidePadding: CGFloat = Spacing.M
14
- /// shortcut + gap + help/home pill
15
- public static let clusterWidth: CGFloat = buttonSize + titleGap + pillWidth
16
- public static let frameMaxWidth: CGFloat = 600
17
- /// Banner image width on every device: wide windows keep the phone size, centered.
18
- public static let bannerWidth: CGFloat = 375
19
- }
20
-
21
- /// How a screen lays out its content on wide windows; the header row follows it.
22
- public enum ContentLayout: Equatable {
23
- /// 12 column grid: the header keeps the 12pt side padding.
24
- case grid
25
- /// One column of at most `HeaderLayoutMetrics.frameMaxWidth`, centered: the header row sits in the same frame.
26
- case stretch
27
- }
28
-
29
- /// Header geometry for a window; see `ScreenLayout.headerLayout(_:)`.
30
- public struct HeaderLayout: Equatable {
31
- /// Short side >= 600, iPhone Duo excluded (it has its own layout).
32
- public let isWide: Bool
33
- /// Padding from each side of the safe area to the header row (back, title / search, right cluster).
34
- public let frameInset: CGFloat
35
- /// Width of the header row, so tabs and other header extensions can line up with it.
36
- public let frameWidth: CGFloat
37
- }
38
-
39
- public extension ScreenLayout {
40
- func headerLayout(_ contentLayout: ContentLayout = .grid) -> HeaderLayout {
41
- let isWide = !isIPhoneDuo && !isDuoDevice && min(width, height) >= ModalMetrics.foldableMinWidth
42
- let safeWidth = width - insets.leading - insets.trailing
43
- let frameInset = isWide && contentLayout == .stretch
44
- ? max(HeaderLayoutMetrics.sidePadding, (safeWidth - HeaderLayoutMetrics.frameMaxWidth) / 2)
45
- : HeaderLayoutMetrics.sidePadding
46
- return HeaderLayout(isWide: isWide, frameInset: frameInset, frameWidth: safeWidth - frameInset * 2)
47
- }
48
- }
49
-
50
- private struct ContentLayoutKey: EnvironmentKey {
51
- static let defaultValue: ContentLayout = .grid
52
- }
53
-
54
- public extension EnvironmentValues {
55
- /// The enclosing screen's `NavigationOptions.contentLayout`, set by `StackScreen`.
56
- var contentLayout: ContentLayout {
57
- get { self[ContentLayoutKey.self] }
58
- set { self[ContentLayoutKey.self] = newValue }
59
- }
60
- }