@momo-kits/native-kits 0.167.1-duo.2-debug → 0.167.1-duo.3-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 (48) hide show
  1. package/.claude/scheduled_tasks.lock +1 -0
  2. package/.claude/settings.local.json +185 -0
  3. package/CLAUDE.md +8 -3
  4. package/compose/build.gradle.kts +15 -1
  5. package/compose/build.gradle.kts.backup +14 -0
  6. package/compose/compose.podspec +1 -1
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +2 -0
  8. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +52 -25
  9. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +12 -2
  10. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +45 -15
  11. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +43 -4
  12. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +8 -0
  13. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +34 -8
  14. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +81 -62
  15. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +281 -0
  16. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +31 -4
  17. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +27 -2
  18. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +17 -10
  19. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +3 -0
  20. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +4 -0
  21. package/gradle.properties +1 -1
  22. package/ios/Application/HeaderRight.swift +25 -12
  23. package/ios/Application/Layout/ScreenLayout.swift +196 -0
  24. package/ios/Application/Navigation/BottomTab/BottomTab.swift +30 -9
  25. package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +5 -2
  26. package/ios/Application/Navigation/BottomTab/DuoTabBar.swift +275 -0
  27. package/ios/Application/Navigation/HeaderUser.swift +4 -1
  28. package/ios/Application/Navigation/NavigationContainer.swift +3 -0
  29. package/ios/Application/Navigation/Overplay/BottomSheet.swift +41 -4
  30. package/ios/Application/Navigation/Overplay/ModalScreen.swift +5 -1
  31. package/ios/Application/Navigation/component/DuoScrollGradient.swift +55 -0
  32. package/ios/Application/Navigation/component/Header.swift +9 -3
  33. package/ios/Application/Navigation/component/HeaderBackground.swift +3 -2
  34. package/ios/Application/Navigation/component/NavigationFooter.swift +1 -1
  35. package/ios/Application/Navigation/component/NavigationHeaderRight.swift +61 -9
  36. package/ios/Application/Navigation/component/SideBar.swift +155 -0
  37. package/ios/Application/StackScreen.swift +135 -18
  38. package/ios/Popup/PopupDisplay.swift +84 -68
  39. package/ios/Popup/PopupLayout.swift +45 -0
  40. package/ios/Popup/PopupNotify.swift +43 -32
  41. package/ios/Popup/PopupPromotion.swift +17 -5
  42. package/ios/native-kits.podspec +1 -1
  43. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  44. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DuoTabDemo.swift +76 -0
  45. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +1 -0
  46. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IPhoneDuoDemo.swift +170 -0
  47. package/local.properties +8 -0
  48. package/package.json +1 -1
@@ -0,0 +1,170 @@
1
+ //
2
+ // IPhoneDuoDemo.swift
3
+ // Example
4
+ //
5
+ // Mirrors RN `app/screens/IPhoneDuo`: the live screen layout, an extended header + search
6
+ // + footer screen, the Duo tab bars, the popup / bottom sheet behaviour and a grid to scroll.
7
+ //
8
+
9
+ import MoMoUIKits
10
+ import SwiftUI
11
+
12
+ private let gridRows: [[Int]] = [[12], [6, 6], [4, 4, 4], [3, 3, 3, 3]]
13
+
14
+ // enough rows to scroll, so the header glass and side bar can be checked
15
+ private let scrollRows: [[Int]] = Array(repeating: gridRows, count: 4).flatMap { $0 }
16
+
17
+ struct IPhoneDuoDemo: View {
18
+ var body: some View {
19
+ if #available(iOS 16.0, *) {
20
+ IPhoneDuoDemoContent()
21
+ } else {
22
+ Text("Requires iOS 16+").padding()
23
+ }
24
+ }
25
+ }
26
+
27
+ @available(iOS 16.0, *)
28
+ private struct IPhoneDuoDemoContent: View {
29
+ @EnvironmentObject private var navigator: Navigator
30
+ @Environment(\.screenLayout) private var layout
31
+
32
+ var body: some View {
33
+ VStack(alignment: .leading, spacing: Spacing.M) {
34
+ VStack(spacing: 0) {
35
+ ForEach(info, id: \.0) { label, value in
36
+ HStack {
37
+ MomoText(label, typography: .bodyDefaultRegular)
38
+ Spacer()
39
+ MomoText(value, typography: .headerSSemibold)
40
+ }
41
+ .padding(.vertical, Spacing.XS)
42
+ }
43
+ }
44
+ .padding(.horizontal, Spacing.M)
45
+
46
+ VStack(spacing: Spacing.S) {
47
+ demoButton("Extended header + footer") {
48
+ navigator.push({ DuoGridScreen() }, options: extendedOptions)
49
+ }
50
+ demoButton("Glass tab bar") {
51
+ navigator.push({ DuoTabDemo(useShortcut: false) }, options: tabOptions)
52
+ }
53
+ demoButton("Glass tab bar + useShortcut") {
54
+ navigator.push({ DuoTabDemo(useShortcut: true) }, options: tabOptions)
55
+ }
56
+ demoButton("Bottom sheet: iPhone Duo safe area") {
57
+ navigator.showBottomSheet({ BottomSheetSafeArea() }, isSurface: true, header: .title("Safe area"))
58
+ }
59
+ demoButton("PopupNotify") {
60
+ navigator.showModal {
61
+ PopupNotify(props: PopupNotifyProps(
62
+ image: "https://static.momocdn.net/app/img/popup_permission/img_permission_popup_camera.png",
63
+ title: "Title",
64
+ description: String(repeating: "Check lại một nhịp auto chuyển sang dạng CTA. ", count: 8),
65
+ primary: PopupAction(title: "Đồng ý", onPress: { navigator.hideOverplay() }),
66
+ secondary: PopupAction(title: "Đóng", onPress: { navigator.hideOverplay() }),
67
+ onIconClose: { navigator.hideOverplay() }
68
+ ))
69
+ }
70
+ }
71
+ }
72
+ .padding(.horizontal, Spacing.M)
73
+
74
+ DuoGrid()
75
+ }
76
+ .padding(.vertical, Spacing.M)
77
+ }
78
+
79
+ private var info: [(String, String)] {
80
+ let insets = layout.insets
81
+ return [
82
+ ("iPhone Duo", layout.isIPhoneDuo ? "yes" : "no"),
83
+ ("Window", "\(Int(layout.width)) x \(Int(layout.height))"),
84
+ ("Safe area (T R B L)", "\(Int(insets.top)) \(Int(insets.trailing)) \(Int(insets.bottom)) \(Int(insets.leading))"),
85
+ ("Content inset (L R)", "\(Int(layout.insetLeft)) \(Int(layout.insetRight))"),
86
+ ("Content width", "\(Int(layout.contentWidth))"),
87
+ ("Header height", "\(Int(layout.headerHeight))"),
88
+ ("Side bar", layout.sideBar.map { "\($0.edge == .left ? "left" : "right"), \(Int($0.width))pt, top \(Int($0.top))" } ?? "none"),
89
+ ]
90
+ }
91
+
92
+ private var extendedOptions: NavigationOptions {
93
+ NavigationOptions(
94
+ title: "Extended",
95
+ headerType: .extended,
96
+ headerRightData: HeaderRightData(useShortcut: true),
97
+ footer: { AnyView(MoMoUIKits.Button(title: "Footer action", action: {}, size: .large)) }
98
+ )
99
+ }
100
+
101
+ private var tabOptions: NavigationOptions {
102
+ NavigationOptions(title: "Duo tabs", headerType: .none, scrollable: false)
103
+ }
104
+
105
+ private func demoButton(_ title: String, action: @escaping () -> Void) -> some View {
106
+ MoMoUIKits.Button(title: title, action: action, type: .secondary, size: .small)
107
+ }
108
+ }
109
+
110
+ private struct DuoGridScreen: View {
111
+ var body: some View {
112
+ DuoGrid().padding(.vertical, Spacing.M)
113
+ }
114
+ }
115
+
116
+ private struct DuoGrid: View {
117
+ var body: some View {
118
+ VStack(spacing: Spacing.M) {
119
+ ForEach(scrollRows.indices, id: \.self) { row in
120
+ SectionView {
121
+ ForEach(scrollRows[row].indices, id: \.self) { index in
122
+ let span = scrollRows[row][index]
123
+ ItemView(widthSpan: span) {
124
+ MomoText("span \(span)", typography: .descriptionDefaultRegular)
125
+ .frame(maxWidth: .infinity)
126
+ .frame(height: 48)
127
+ .background(Colors.black04)
128
+ .clipShape(RoundedRectangle(cornerRadius: Radius.S))
129
+ }
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+ }
136
+
137
+ /// Markers on the content edges show the side safe area inside the sheet.
138
+ private struct BottomSheetSafeArea: View {
139
+ @Environment(\.screenLayout) private var layout
140
+
141
+ var body: some View {
142
+ VStack(alignment: .leading, spacing: Spacing.XS) {
143
+ HStack {
144
+ marker("← content edge")
145
+ Spacer()
146
+ marker("content edge →")
147
+ }
148
+ .padding(.bottom, Spacing.S)
149
+ MomoText("Window: \(Int(layout.width)) × \(Int(layout.height))", typography: .bodyDefaultRegular)
150
+ MomoText(
151
+ "Insets: top \(Int(layout.insets.top)) · right \(Int(layout.insets.trailing)) · bottom \(Int(layout.insets.bottom)) · left \(Int(layout.insets.leading))",
152
+ typography: .bodyDefaultRegular
153
+ )
154
+ MomoText(
155
+ "On iPhone Duo: the outer display keeps a full-width sheet with content inside the side safe area; the inner display centers the sheet, still attached to the bottom edge. Other devices are unchanged.",
156
+ typography: .descriptionDefaultRegular,
157
+ color: Colors.black12
158
+ )
159
+ }
160
+ .padding(.vertical, Spacing.M)
161
+ }
162
+
163
+ private func marker(_ text: String) -> some View {
164
+ MomoText(text, typography: .labelSMedium, color: Colors.pink03)
165
+ .padding(.vertical, Spacing.XS)
166
+ .padding(.horizontal, Spacing.S)
167
+ .background(Colors.black04)
168
+ .clipShape(RoundedRectangle(cornerRadius: Radius.XS))
169
+ }
170
+ }
@@ -0,0 +1,8 @@
1
+ ## This file must *NOT* be checked into Version Control Systems,
2
+ # as it contains information specific to your local configuration.
3
+ #
4
+ # Location of the SDK. This is only used by Gradle.
5
+ # For customization when using a Version Control System, please read the
6
+ # header note.
7
+ #Tue Jun 02 17:05:32 ICT 2026
8
+ sdk.dir=/Users/sophia/Library/Android/sdk
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.167.1-duo.2-debug",
3
+ "version": "0.167.1-duo.3-debug",
4
4
  "private": false,
5
5
  "dependeNavigationncies": {},
6
6
  "devDependencies": {},