@momo-kits/native-kits 0.169.12-beta.3-debug → 0.169.12-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.12-beta.3-debug"
43
+ version = "0.169.12-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.12-beta.3-debug'
3
+ spec.version = '0.169.12-debug'
4
4
  spec.homepage = 'https://momo.vn'
5
5
  spec.source = { :http=> ''}
6
6
  spec.authors = ''
@@ -246,11 +246,7 @@ internal fun ColumnScope.TabItemContent(
246
246
  }
247
247
  }
248
248
 
249
- // text badges keep 5 characters, then "..." ("Khám phá" -> "Khám...")
250
- private const val BADGE_MAX_CHARS = 5
251
-
252
- // Badge value shown on a tab: null hides it, "" is a dot, numbers cap at 99+ ("0" hides it, RN parity),
253
- // text keeps its first 5 characters.
249
+ // Badge value shown on a tab: null hides it, "" is a dot, numbers cap at 99+ ("0" hides it, RN parity).
254
250
  internal fun tabBadgeLabel(item: BottomTabItem): String? {
255
251
  val label = item.badgeLabel ?: return if (item.showDot) "" else null
256
252
  if (label.isEmpty()) return ""
@@ -259,7 +255,7 @@ internal fun tabBadgeLabel(item: BottomTabItem): String? {
259
255
  if (value == 0L) return if (item.showDot) "" else null
260
256
  return if (value > 99) "99+" else label
261
257
  }
262
- return if (label.length > BADGE_MAX_CHARS) label.take(BADGE_MAX_CHARS).trimEnd() + "..." else label
258
+ return label
263
259
  }
264
260
 
265
261
  // 24 icon; badges hang off it unclipped: dot at 16/-2, label badge at 12/-7 growing right, or
@@ -291,8 +287,6 @@ internal fun TabIcon(item: BottomTabItem, tint: androidx.compose.ui.graphics.Col
291
287
  }
292
288
  }
293
289
 
294
- private val BADGE_BORDER = 1.dp
295
-
296
290
  // Numbers use the error color, text the warning color (Figma Badge round numeric / text); the text keeps
297
291
  // its design size so it fits the 16 height on the Duo displays too.
298
292
  @Composable
@@ -303,11 +297,9 @@ private fun TabBadge(label: String, modifier: Modifier) {
303
297
  modifier = modifier
304
298
  .height(16.dp)
305
299
  .widthIn(min = 16.dp, max = TabBarMetrics.badgeMaxWidth)
306
- // the 1 ring is drawn under the label: Modifier.border would paint over the text
307
- .background(colors.background.surface, CircleShape)
308
- .padding(BADGE_BORDER)
309
300
  .background(if (isNumber) colors.error.primary else colors.warning.primary, CircleShape)
310
- .padding(horizontal = Spacing.XS - BADGE_BORDER),
301
+ .border(1.dp, colors.background.surface, CircleShape)
302
+ .padding(horizontal = Spacing.XS),
311
303
  contentAlignment = Alignment.Center,
312
304
  ) {
313
305
  ScaleSizeScope(1f) {
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.12-beta.3
21
+ version=0.169.12
22
22
 
23
23
  repo=GitLab
24
24
  url=https://artifacts.mservice.com.vn/repository/maven-momo-app/
@@ -250,11 +250,7 @@ struct TabItemContent: View {
250
250
  }
251
251
  }
252
252
 
253
- /// Text badges keep 5 characters, then "..." ("Khám phá" -> "Khám...").
254
- private let badgeMaxChars = 5
255
-
256
- /// Badge value shown on a tab: nil hides it, "" is a dot, numbers cap at 99+ ("0" hides it, RN parity),
257
- /// text keeps its first 5 characters.
253
+ /// Badge value shown on a tab: nil hides it, "" is a dot, numbers cap at 99+ ("0" hides it, RN parity).
258
254
  func tabBadgeLabel(_ item: BottomTabItem) -> String? {
259
255
  guard let label = item.badgeLabel else { return item.showDot ? "" : nil }
260
256
  if label.isEmpty { return "" }
@@ -263,9 +259,7 @@ func tabBadgeLabel(_ item: BottomTabItem) -> String? {
263
259
  if value == 0 { return item.showDot ? "" : nil }
264
260
  return value > 99 ? "99+" : label
265
261
  }
266
- guard label.count > badgeMaxChars else { return label }
267
- let head = String(label.prefix(badgeMaxChars))
268
- return head.trimmingCharacters(in: .whitespaces) + "..."
262
+ return label
269
263
  }
270
264
 
271
265
  /// 24 icon, active and inactive tints cross-faded; badges hang off it: dot at 16/-2, label badge at
@@ -320,12 +314,8 @@ private struct TabBadge: View {
320
314
  .scaleSizeMaxRate(1)
321
315
  .padding(.horizontal, Spacing.XS)
322
316
  .frame(minWidth: 16, maxWidth: TabBarMetrics.badgeMaxWidth, minHeight: 16, maxHeight: 16)
323
- // the ring sits under the label: an overlay stroke would paint over the text
324
- .background(
325
- Capsule()
326
- .fill(isNumber ? theme.colors.error.primary : theme.colors.warning.primary)
327
- .overlay(Capsule().strokeBorder(theme.colors.background.surface, lineWidth: 1))
328
- )
317
+ .background(Capsule().fill(isNumber ? theme.colors.error.primary : theme.colors.warning.primary))
318
+ .overlay(Capsule().strokeBorder(theme.colors.background.surface, lineWidth: 1))
329
319
  }
330
320
  }
331
321
 
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKits'
3
- s.version = '0.169.12-beta.3'
3
+ s.version = '0.169.12'
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.12-beta.3'
3
+ s.version = '0.169.12'
4
4
  s.summary = 'Demo browser for MoMoUIKits SwiftUI components'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -89,18 +89,7 @@ private func ctaLottie(_ animation: LottieAnimation?, offset: CGFloat) -> some V
89
89
  }
90
90
  private let badges: [(String, String?)] = [
91
91
  ("Không", nil), ("Dot \"\"", ""), ("\"0\"", "0"), ("\"5\"", "5"),
92
- ("\"1999\"", "1999"), ("\"Mới\"", "Mới"),
93
- ]
94
-
95
- /// "Chữ dài" picks one of these at random on every tap.
96
- private let longBadges = [
97
- "Khuyến mãi lớn",
98
- "Khám phá ngay",
99
- "Ưu đãi cực sốc",
100
- "Quà tặng hấp dẫn",
101
- "Hoàn tiền mỗi ngày",
102
- "Siêu sale cuối tuần",
103
- "Thanh toán hóa đơn",
92
+ ("\"1999\"", "1999"), ("\"Mới\"", "Mới"), ("Chữ dài", "Khuyến mãi lớn"),
104
93
  ]
105
94
 
106
95
  struct BottomTabDemoContent: View {
@@ -186,12 +175,10 @@ private struct TabContent: View {
186
175
  Section(title: "Tab đang mở · \(name)") {
187
176
  IconOptions(title: "icon", icons: icons, value: tab.icon) { icon in updateTab { $0.icon = icon } }
188
177
  Options(title: "badgeLabel",
189
- hint: "\"\" là dot, \"0\" ẩn badge, số > 99 hiện 99+, chữ > 5 ký tự cắt thành 5 ký tự + \"...\"",
178
+ hint: "\"\" là dot, \"0\" ẩn badge, số > 99 hiện 99+, chữ dài bị cắt ở 58",
190
179
  options: badges.map { title, value in
191
180
  Option(title: title, selected: tab.badgeLabel == value) { updateTab { $0.badgeLabel = value } }
192
- } + [Option(title: "Chữ dài", selected: longBadges.contains(tab.badgeLabel ?? "")) {
193
- updateTab { $0.badgeLabel = longBadges.randomElement() }
194
- }])
181
+ })
195
182
  Options(title: "showDot",
196
183
  hint: "Hiện dot khi không có badgeLabel hoặc badgeLabel là \"0\"",
197
184
  options: yesNo(tab.showDot) { value in updateTab { $0.showDot = value } })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.169.12-beta.3-debug",
3
+ "version": "0.169.12-debug",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "publish:local": "bash publish.sh local"