@momo-kits/native-kits 0.113.1-beta.0 → 0.113.1-beta.2
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/InputOTP.kt +3 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +2 -2
- package/ios/Button/Button.swift +1 -2
- package/ios/Popup/PopupDisplay.swift +9 -8
- package/local.properties +2 -2
- package/package.json +1 -1
|
@@ -75,7 +75,6 @@ fun OTPCaret() {
|
|
|
75
75
|
|
|
76
76
|
@Composable
|
|
77
77
|
fun InputOTP(
|
|
78
|
-
value: String = "",
|
|
79
78
|
length: Int? = null,
|
|
80
79
|
errorMessage: String = "",
|
|
81
80
|
errorSpacing: Boolean = false,
|
|
@@ -86,9 +85,9 @@ fun InputOTP(
|
|
|
86
85
|
onBlur: () -> Unit = {},
|
|
87
86
|
dataType: String = "number",
|
|
88
87
|
accessibilityLabel: String? = null,
|
|
89
|
-
modifier: Modifier = Modifier
|
|
90
88
|
) {
|
|
91
89
|
val MAX_LENGTH = 10
|
|
90
|
+
var value by remember { mutableStateOf("") }
|
|
92
91
|
var isFocused by remember { mutableStateOf(false) }
|
|
93
92
|
var isBlurred = false
|
|
94
93
|
|
|
@@ -97,6 +96,7 @@ fun InputOTP(
|
|
|
97
96
|
(dataType != "number" || !text.any { !it.isDigit() }) &&
|
|
98
97
|
(text.length < value.length || value.length < text.length)
|
|
99
98
|
) {
|
|
99
|
+
value = text
|
|
100
100
|
onChangeText(text)
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -108,7 +108,7 @@ fun InputOTP(
|
|
|
108
108
|
onValueChange = handleChangeText,
|
|
109
109
|
singleLine = true,
|
|
110
110
|
keyboardOptions = KeyboardOptions.Default.copy(keyboardType = if (dataType == "number") KeyboardType.Number else KeyboardType.Ascii),
|
|
111
|
-
modifier =
|
|
111
|
+
modifier = Modifier.height(56.dp).onFocusChanged {
|
|
112
112
|
isFocused = it.isFocused
|
|
113
113
|
if (it.isFocused) {
|
|
114
114
|
onFocus()
|
|
@@ -115,14 +115,14 @@ fun PopupNotify(
|
|
|
115
115
|
)
|
|
116
116
|
|
|
117
117
|
Column(modifier = Modifier.padding(Spacing.XL)) {
|
|
118
|
-
Text(style = Typography.titleXs, maxLines =
|
|
118
|
+
Text(style = Typography.titleXs, maxLines = 2, text = title)
|
|
119
119
|
content(Modifier.padding(top = Spacing.S))
|
|
120
120
|
if (error.isNotEmpty()) {
|
|
121
121
|
Text(
|
|
122
122
|
text = error,
|
|
123
123
|
style = Typography.descriptionXs,
|
|
124
124
|
color = AppTheme.current.colors.text.hint,
|
|
125
|
-
maxLines =
|
|
125
|
+
maxLines = 2,
|
|
126
126
|
modifier = Modifier.padding(top = Spacing.S)
|
|
127
127
|
)
|
|
128
128
|
}
|
package/ios/Button/Button.swift
CHANGED
|
@@ -98,9 +98,8 @@ private extension View {
|
|
|
98
98
|
case .secondary:
|
|
99
99
|
return AnyView(self
|
|
100
100
|
.background(Colors.card)
|
|
101
|
-
.foregroundColor(Colors.
|
|
101
|
+
.foregroundColor(Colors.primary)
|
|
102
102
|
.cornerRadius(8)
|
|
103
|
-
.overlay(RoundedRectangle(cornerRadius: Radius.S).stroke(Colors.black06, lineWidth: 1))
|
|
104
103
|
.padding(2)
|
|
105
104
|
)
|
|
106
105
|
case .outline:
|
|
@@ -43,6 +43,7 @@ public struct PopupDisplay: View {
|
|
|
43
43
|
Image(systemName: "xmark.circle.fill")
|
|
44
44
|
.resizable()
|
|
45
45
|
.frame(width: 16, height: 16)
|
|
46
|
+
.overlay(RoundedRectangle(cornerRadius: Radius.S).stroke(Colors.black01, lineWidth: 1))
|
|
46
47
|
}.foregroundColor(Colors.black20)
|
|
47
48
|
.background(Colors.black01.cornerRadius(8))
|
|
48
49
|
.offset(x: 6, y: -6)
|
|
@@ -52,15 +53,17 @@ public struct PopupDisplay: View {
|
|
|
52
53
|
WebImage(url: URL(string: url), isAnimating: .constant(true))
|
|
53
54
|
.resizable()
|
|
54
55
|
.scaledToFill()
|
|
55
|
-
.frame(maxWidth: .infinity
|
|
56
|
+
.frame(maxWidth: .infinity)
|
|
56
57
|
.clipShape(RoundedCorner(radius: 8, corners: [.topLeft, .topRight]))
|
|
58
|
+
.aspectRatio(2, contentMode: .fit)
|
|
57
59
|
|
|
58
60
|
VStack(alignment: .leading) {
|
|
59
61
|
Text(title)
|
|
60
62
|
.foregroundColor(.black)
|
|
61
|
-
.font(.
|
|
62
|
-
.padding(.top,
|
|
63
|
-
.padding(.bottom,
|
|
63
|
+
.font(.title3)
|
|
64
|
+
.padding(.top, 16)
|
|
65
|
+
.padding(.bottom, 8)
|
|
66
|
+
.lineLimit(2)
|
|
64
67
|
|
|
65
68
|
Text(description)
|
|
66
69
|
.foregroundColor(.black)
|
|
@@ -87,10 +90,8 @@ public struct PopupDisplay: View {
|
|
|
87
90
|
}.clipped()
|
|
88
91
|
}
|
|
89
92
|
}
|
|
90
|
-
.background(Color.white.cornerRadius(
|
|
91
|
-
.
|
|
92
|
-
.shadow(color: .black.opacity(0.16), radius: 24, x: 0, y: 0)
|
|
93
|
-
.padding(.horizontal, 40)
|
|
93
|
+
.background(Color.white.cornerRadius(15))
|
|
94
|
+
.padding(.horizontal, 24)
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
// MARK: Internal
|
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
|
+
#Thu Jan 09 10:43:10 ICT 2025
|
|
8
|
+
sdk.dir=/Users/sophia/Library/Android/sdk
|