@momo-kits/native-kits 0.114.2-beta.14 → 0.114.2-beta.20
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/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +4 -3
- package/ios/Application/Components.swift +14 -12
- package/ios/Application/Screen.swift +14 -20
- package/ios/Checkbox/Checkbox.swift +1 -1
- package/ios/Popup/PopupDisplay.swift +1 -1
- package/local.properties +2 -2
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
11
11
|
import androidx.compose.runtime.Composable
|
|
12
12
|
import androidx.compose.ui.Alignment
|
|
13
13
|
import androidx.compose.ui.Modifier
|
|
14
|
+
import androidx.compose.ui.graphics.Color
|
|
14
15
|
import androidx.compose.ui.unit.dp
|
|
15
16
|
import vn.momo.kits.const.AppTheme
|
|
16
17
|
import vn.momo.kits.const.Colors
|
|
@@ -27,8 +28,8 @@ fun CheckBox(
|
|
|
27
28
|
title: String = "",
|
|
28
29
|
) {
|
|
29
30
|
var borderColor = AppTheme.current.colors.text.default
|
|
30
|
-
var backgroundColor =
|
|
31
|
-
val iconSource = if (indeterminate) "
|
|
31
|
+
var backgroundColor = Color.Transparent
|
|
32
|
+
val iconSource = if (indeterminate) "navigation_minus" else "ic_checked"
|
|
32
33
|
|
|
33
34
|
if (checked) {
|
|
34
35
|
borderColor = AppTheme.current.colors.primary
|
|
@@ -36,7 +37,7 @@ fun CheckBox(
|
|
|
36
37
|
}
|
|
37
38
|
if (disabled) {
|
|
38
39
|
borderColor = AppTheme.current.colors.border.disable
|
|
39
|
-
backgroundColor =
|
|
40
|
+
backgroundColor = Color.Transparent
|
|
40
41
|
if (checked) {
|
|
41
42
|
borderColor = AppTheme.current.colors.background.tonal
|
|
42
43
|
backgroundColor = AppTheme.current.colors.background.tonal
|
|
@@ -138,12 +138,12 @@ public struct Header: View {
|
|
|
138
138
|
|
|
139
139
|
public var body: some View {
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
let statusBarHeight = safeAreaTopInset()
|
|
142
142
|
let tintIconColor = Colors.black17
|
|
143
143
|
let backgroundButton = Colors.black01.opacity(0.6)
|
|
144
144
|
|
|
145
145
|
if headerType != .none {
|
|
146
|
-
|
|
146
|
+
VStack(spacing: 0) {
|
|
147
147
|
ZStack {
|
|
148
148
|
HStack {
|
|
149
149
|
if let goBack = goBack {
|
|
@@ -153,7 +153,8 @@ public struct Header: View {
|
|
|
153
153
|
.background(Circle().fill(backgroundButton))
|
|
154
154
|
.frame(width: 28, height: 28)
|
|
155
155
|
.overlay(
|
|
156
|
-
|
|
156
|
+
Image(systemName: "arrow.backward")
|
|
157
|
+
.foregroundColor(.black)
|
|
157
158
|
)
|
|
158
159
|
}
|
|
159
160
|
|
|
@@ -166,11 +167,14 @@ public struct Header: View {
|
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
}
|
|
169
|
-
.
|
|
170
|
+
.frame(height: 52)
|
|
171
|
+
.padding(.horizontal)
|
|
172
|
+
|
|
173
|
+
|
|
170
174
|
|
|
171
175
|
HStack {
|
|
172
176
|
if titlePosition == .left, goBack != nil {
|
|
173
|
-
Spacer().frame(width:
|
|
177
|
+
Spacer().frame(width: 40)
|
|
174
178
|
}
|
|
175
179
|
|
|
176
180
|
if inputSearchProps != nil {
|
|
@@ -197,22 +201,20 @@ public struct Header: View {
|
|
|
197
201
|
}
|
|
198
202
|
} else {
|
|
199
203
|
Text(title)
|
|
200
|
-
.font(
|
|
204
|
+
.font(.headline)
|
|
201
205
|
.foregroundColor(tintIconColor)
|
|
202
|
-
.frame(maxWidth: titlePosition == .center ?
|
|
203
|
-
.frame(maxWidth: titlePosition == .center ? .infinity : UIScreen.main.bounds.width - 172, alignment: titlePosition == .center ? .center : .leading)
|
|
204
|
-
.lineLimit(1)
|
|
205
|
-
|
|
206
|
+
.frame(maxWidth: titlePosition == .center ? .infinity : nil, alignment: titlePosition == .center ? .center : .leading)
|
|
206
207
|
}
|
|
207
208
|
Spacer()
|
|
208
209
|
}
|
|
210
|
+
.frame(height: 52)
|
|
209
211
|
.padding(.horizontal)
|
|
210
212
|
}
|
|
211
213
|
.background(Color.clear)
|
|
212
214
|
}
|
|
213
|
-
|
|
215
|
+
}
|
|
214
216
|
}
|
|
215
|
-
|
|
217
|
+
|
|
216
218
|
}
|
|
217
219
|
|
|
218
220
|
|
|
@@ -34,7 +34,7 @@ public struct Screen<Content: View>: View {
|
|
|
34
34
|
verticalAlignment: VerticalAlignment = .top,
|
|
35
35
|
horizontalAlignment: HorizontalAlignment = .leading,
|
|
36
36
|
title: String = "Stack",
|
|
37
|
-
titlePosition: TitlePosition = .
|
|
37
|
+
titlePosition: TitlePosition = .center,
|
|
38
38
|
goBack: (() -> Void)? = nil,
|
|
39
39
|
scrollable: Bool = true,
|
|
40
40
|
onContentLayout: ((CGRect) -> Void)? = nil,
|
|
@@ -71,25 +71,23 @@ public struct Screen<Content: View>: View {
|
|
|
71
71
|
|
|
72
72
|
public var body: some View {
|
|
73
73
|
GeometryReader { geometry in
|
|
74
|
-
let
|
|
74
|
+
let safeAreaInsets = geometry.safeAreaInsets
|
|
75
|
+
let statusBarHeight = safeAreaInsets.top
|
|
75
76
|
let keyboardHeight: CGFloat = 0
|
|
76
77
|
let keyboardSize: CGFloat = useAvoidKeyboard ? max(keyboardHeight, 0) : 0
|
|
77
|
-
let height = geometry.size.height
|
|
78
|
-
let bottomInset = geometry.safeAreaInsets.bottom
|
|
79
|
-
let screenHeight = height + topInset + bottomInset
|
|
80
78
|
|
|
81
79
|
ZStack {
|
|
82
80
|
(backgroundColor ?? Color.white).edgesIgnoringSafeArea(.all)
|
|
83
81
|
|
|
84
82
|
VStack(spacing: 0) {
|
|
85
|
-
ZStack
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
ZStack {
|
|
84
|
+
if animatedHeader == nil {
|
|
85
|
+
HeaderBackground(headerType: headerType, scrollState: scrollOffset)
|
|
86
|
+
} else {
|
|
87
|
+
Color.white.opacity(Double(min(scrollOffset / 114, 1)))
|
|
88
|
+
.overlay(HeaderBackground(headerType: headerType, scrollState: scrollOffset))
|
|
89
|
+
|
|
90
|
+
}
|
|
93
91
|
|
|
94
92
|
Header(
|
|
95
93
|
headerType: headerType,
|
|
@@ -101,17 +99,13 @@ public struct Screen<Content: View>: View {
|
|
|
101
99
|
animatedHeader: animatedHeader,
|
|
102
100
|
scrollState: scrollOffset,
|
|
103
101
|
inputSearchProps: inputSearchProps
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
.offset(y: topInset)
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
.offset(y: -topInset)
|
|
102
|
+
).padding(.bottom, headerType == .extended ? 0 : -safeAreaTopInset())
|
|
103
|
+
}.padding(.top, -safeAreaTopInset())
|
|
110
104
|
|
|
111
105
|
|
|
112
106
|
VStack(alignment: horizontalAlignment, spacing: 0) {
|
|
113
107
|
if animatedHeader != nil {
|
|
114
|
-
Spacer().frame(height:
|
|
108
|
+
Spacer().frame(height: statusBarHeight + 52 + layoutOffset)
|
|
115
109
|
}
|
|
116
110
|
|
|
117
111
|
if scrollable {
|
|
@@ -62,7 +62,7 @@ public struct PopupDisplay: View {
|
|
|
62
62
|
}
|
|
63
63
|
.scaledToFill()
|
|
64
64
|
.frame(maxWidth: .infinity)
|
|
65
|
-
.clipShape(RoundedCorner(radius:
|
|
65
|
+
.clipShape(RoundedCorner(radius: 8, corners: [.topLeft, .topRight]))
|
|
66
66
|
.aspectRatio(2, contentMode: .fit)
|
|
67
67
|
}
|
|
68
68
|
VStack(alignment: .leading) {
|
package/local.properties
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
# Location of the SDK. This is only used by Gradle.
|
|
5
5
|
# For customization when using a Version Control System, please read the
|
|
6
6
|
# header note.
|
|
7
|
-
#
|
|
8
|
-
sdk.dir=/Users/
|
|
7
|
+
#Tue Apr 08 11:13:31 ICT 2025
|
|
8
|
+
sdk.dir=/Users/sonnguyen/Library/Android/sdk
|