@momo-kits/native-kits 0.169.5-beta.4-debug → 0.169.5-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.
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.169.5-beta.4-debug"
43
+ version = "0.169.5-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |spec|
2
2
  spec.name = 'compose'
3
- spec.version = '0.169.5-beta.4-debug'
3
+ spec.version = '0.169.5-debug'
4
4
  spec.homepage = 'https://momo.vn'
5
5
  spec.source = { :http=> ''}
6
6
  spec.authors = ''
@@ -66,14 +66,6 @@ private fun getBorderColor(isFocused: Boolean, error: String): Color {
66
66
  }
67
67
  }
68
68
 
69
- /**
70
- * @param icon Deprecated: use [trailing].
71
- * @param iconColor Deprecated: use [trailingColor].
72
- * @param onRightIconPressed Deprecated: use [onPressTrailing].
73
- * @param trailing Icon key or URL; wins over [icon] when not empty.
74
- * @param trailingColor Wins over [iconColor] when set.
75
- * @param onPressTrailing Wins over [onRightIconPressed] when set.
76
- */
77
69
  @Composable
78
70
  fun InputPhoneNumber(
79
71
  text: MutableState<String> = remember { mutableStateOf("") },
@@ -89,9 +81,6 @@ fun InputPhoneNumber(
89
81
  onFocus: () -> Unit = {},
90
82
  onBlur: () -> Unit = {},
91
83
  loading: Boolean = false,
92
- trailing: String = "",
93
- trailingColor: Color? = null,
94
- onPressTrailing: (() -> Unit)? = null,
95
84
  modifier: Modifier = Modifier,
96
85
  inputModifier: Modifier = Modifier,
97
86
  ) {
@@ -100,11 +89,11 @@ fun InputPhoneNumber(
100
89
 
101
90
  // Memoized color calculations
102
91
  val theme = AppTheme.current
103
- val colors = remember(theme, iconColor, trailingColor) {
92
+ val colors = remember(theme, iconColor) {
104
93
  Triple(
105
94
  theme.colors.text.default, // textColor
106
95
  theme.colors.text.hint, // placeholderColor
107
- trailingColor ?: iconColor // iconTintColor
96
+ iconColor // iconTintColor
108
97
  )
109
98
  }
110
99
 
@@ -222,10 +211,8 @@ fun InputPhoneNumber(
222
211
  }
223
212
  }
224
213
 
225
- // Spinner replaces the trailing icon while loading (RN RenderTrailing)
226
- val trailingIcon = if (loading) "" else trailing.ifEmpty { icon }
227
- val onTrailingPress = onPressTrailing ?: onRightIconPressed
228
- RenderRightIcon(loading, trailingIcon, iconTintColor, onTrailingPress)
214
+ // Right icon (password toggle or custom icon)
215
+ RenderRightIcon(loading, icon, iconTintColor, onRightIconPressed)
229
216
  }
230
217
  }
231
218
  },
package/gradle.properties CHANGED
@@ -18,7 +18,7 @@ kotlin.apple.xcodeCompatibility.nowarn=true
18
18
  name="ComposeKits"
19
19
  group=vn.momo.kits
20
20
  artifact.id=kits
21
- version=0.169.5-beta.4
21
+ version=0.169.5
22
22
 
23
23
  repo=GitLab
24
24
  url=https://artifacts.mservice.com.vn/repository/maven-momo-app/
@@ -18,22 +18,13 @@ public struct InputPhoneNumber: View {
18
18
  public var errorSpacing: Bool
19
19
  public var loading: Bool
20
20
  public var required: Bool
21
- /// Deprecated: use `trailing`.
22
21
  public var rightIcon: String
23
- /// Deprecated: use `trailingColor`.
24
22
  public var rightIconColor: Color?
25
- /// Icon key or URL; wins over `rightIcon` when not empty.
26
- public var trailing: String
27
- /// Wins over `rightIconColor` when set.
28
- public var trailingColor: Color?
29
23
  public var autofocus: Bool
30
24
  public var onChangeText: ((String) -> Void)?
31
25
  public var onFocus: (() -> Void)?
32
26
  public var onBlur: (() -> Void)?
33
- /// Deprecated: use `onPressTrailing`.
34
27
  public var onRightIconPressed: (() -> Void)?
35
- /// Wins over `onRightIconPressed` when set.
36
- public var onPressTrailing: (() -> Void)?
37
28
  public var accessibilityLabel: String?
38
29
 
39
30
  @State private var isFocused: Bool = false
@@ -50,14 +41,11 @@ public struct InputPhoneNumber: View {
50
41
  required: Bool = false,
51
42
  rightIcon: String = "",
52
43
  rightIconColor: Color? = nil,
53
- trailing: String = "",
54
- trailingColor: Color? = nil,
55
44
  autofocus: Bool = false,
56
45
  onChangeText: ((String) -> Void)? = nil,
57
46
  onFocus: (() -> Void)? = nil,
58
47
  onBlur: (() -> Void)? = nil,
59
48
  onRightIconPressed: (() -> Void)? = nil,
60
- onPressTrailing: (() -> Void)? = nil,
61
49
  accessibilityLabel: String? = nil
62
50
  ) {
63
51
  self._text = text
@@ -70,14 +58,11 @@ public struct InputPhoneNumber: View {
70
58
  self.required = required
71
59
  self.rightIcon = rightIcon
72
60
  self.rightIconColor = rightIconColor
73
- self.trailing = trailing
74
- self.trailingColor = trailingColor
75
61
  self.autofocus = autofocus
76
62
  self.onChangeText = onChangeText
77
63
  self.onFocus = onFocus
78
64
  self.onBlur = onBlur
79
65
  self.onRightIconPressed = onRightIconPressed
80
- self.onPressTrailing = onPressTrailing
81
66
  self.accessibilityLabel = accessibilityLabel
82
67
  }
83
68
 
@@ -144,13 +129,16 @@ public struct InputPhoneNumber: View {
144
129
  .accessibilityIdentifier("ic_clear")
145
130
  }
146
131
 
147
- // Spinner replaces the trailing icon while loading (RN RenderTrailing)
132
+ // Loading indicator
148
133
  if loading {
149
- ActivityIndicator(isAnimating: .constant(true), style: .medium, color: trailingTint)
134
+ ActivityIndicator(isAnimating: .constant(true), style: .medium, color: rightIconColor ?? theme.colors.text.default)
150
135
  .frame(width: 16, height: 16)
151
- } else if !trailingIcon.isEmpty {
152
- SwiftUI.Button(action: pressTrailing) {
153
- Icon(source: trailingIcon, size: 24, color: trailingTint)
136
+ }
137
+
138
+ // ✅ Right icon
139
+ if !rightIcon.isEmpty {
140
+ SwiftUI.Button(action: { onRightIconPressed?() }) {
141
+ Icon(source: rightIcon, size: 24, color: rightIconColor ?? theme.colors.text.default)
154
142
  .padding(.leading, Spacing.S)
155
143
  }
156
144
  }
@@ -176,23 +164,7 @@ public struct InputPhoneNumber: View {
176
164
  }
177
165
 
178
166
  // MARK: - Helpers
179
-
180
- private var trailingIcon: String {
181
- return trailing.isEmpty ? rightIcon : trailing
182
- }
183
-
184
- private var trailingTint: Color {
185
- return trailingColor ?? rightIconColor ?? theme.colors.text.default
186
- }
187
-
188
- private func pressTrailing() {
189
- if let onPressTrailing {
190
- onPressTrailing()
191
- return
192
- }
193
- onRightIconPressed?()
194
- }
195
-
167
+
196
168
  private func handleFocusChange(_ focused: Bool) {
197
169
  guard focused != isFocused else { return }
198
170
  isFocused = focused
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKits'
3
- s.version = '0.169.5-beta.4'
3
+ s.version = '0.169.5'
4
4
  s.summary = 'MoMoUIKits for iOS'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKitsDemo'
3
- s.version = '0.169.5-beta.4'
3
+ s.version = '0.169.5'
4
4
  s.summary = 'Demo browser for MoMoUIKits SwiftUI components'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -28,8 +28,6 @@ private struct InputPhoneNumberPreview: View {
28
28
  @State private var t3 = ""
29
29
  @State private var t4 = ""
30
30
  @State private var t5 = ""
31
- @State private var t6 = ""
32
- @State private var trailingPressCount = 0
33
31
 
34
32
  var body: some View {
35
33
  BasicColumnBox("Size", alignment: .leading) {
@@ -43,16 +41,7 @@ private struct InputPhoneNumberPreview: View {
43
41
  InputPhoneNumber(text: $t4, placeholder: "Enter here", error: "error message")
44
42
  }
45
43
  BasicColumnBox("Trailing Icon", alignment: .leading) {
46
- InputPhoneNumber(text: $t5, placeholder: "Phone", trailing: "24_ic_public", trailingColor: Colors.pink03)
47
- }
48
- BasicColumnBox("Trailing bấm được", alignment: .leading) {
49
- InputPhoneNumber(
50
- text: $t6,
51
- placeholder: "Phone",
52
- trailing: "Phonebook",
53
- onPressTrailing: { trailingPressCount += 1 }
54
- )
55
- MomoText("Đã bấm icon: \(trailingPressCount)")
44
+ InputPhoneNumber(text: $t5, placeholder: "Phone", rightIcon: "24_ic_public", rightIconColor: Colors.pink03)
56
45
  }
57
46
  }
58
47
  }
@@ -66,7 +55,7 @@ private struct InputPhoneNumberPlayground: View {
66
55
  @State private var hintText = ""
67
56
  @State private var error = ""
68
57
  @State private var size: PlaygroundOption? = inputSizeList.first { $0.key == "small" }
69
- @State private var trailing: PlaygroundOption?
58
+ @State private var rightIcon: PlaygroundOption?
70
59
  @State private var loading = false
71
60
  @State private var required = false
72
61
 
@@ -81,7 +70,7 @@ private struct InputPhoneNumberPlayground: View {
81
70
  error: error,
82
71
  loading: loading,
83
72
  required: required,
84
- trailing: (trailing?.value as? String) ?? ""
73
+ rightIcon: (rightIcon?.value as? String) ?? ""
85
74
  )
86
75
  },
87
76
  params: [
@@ -89,7 +78,7 @@ private struct InputPhoneNumberPlayground: View {
89
78
  .string("HintText", $hintText),
90
79
  .string("Error", $error),
91
80
  .radio("Size", inputSizeList, $size),
92
- .option("Trailing", playgroundIcons, $trailing),
81
+ .option("RightIcon", playgroundIcons, $rightIcon),
93
82
  .checkbox("Loading", $loading),
94
83
  .checkbox("Required", $required),
95
84
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.169.5-beta.4-debug",
3
+ "version": "0.169.5-debug",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "publish:local": "bash publish.sh local"