@momo-kits/native-kits 0.162.40-debug → 0.162.41-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.162.40-debug"
43
+ version = "0.162.41-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -44,7 +44,7 @@ import vn.momo.kits.const.getFontFamily
44
44
  import vn.momo.kits.modifier.kitsAutomationId
45
45
  import vn.momo.kits.modifier.noFeedbackClickable
46
46
  import vn.momo.kits.modifier.setAutomationId
47
- import vn.momo.kits.navigation.component.HEADER_FONT_FAMILY
47
+ import vn.momo.kits.navigation.component.headerFontFamily
48
48
  import vn.momo.kits.navigation.component.HEADER_HEIGHT
49
49
  import vn.momo.kits.utils.getAppStatusBarHeight
50
50
  import kotlin.math.max
@@ -362,7 +362,7 @@ private fun LiteScreenLayout(
362
362
  text = title,
363
363
  color = headerColor.tintIconColor,
364
364
  style = titleStyle,
365
- fontFamily = HEADER_FONT_FAMILY,
365
+ fontFamily = headerFontFamily,
366
366
  modifier = titleModifier,
367
367
  maxLines = 1,
368
368
  overflow = TextOverflow.Ellipsis
@@ -67,7 +67,7 @@ data class Theme(
67
67
  return !assets.headerBackground.isNullOrEmpty()
68
68
  }
69
69
  }
70
- val defaultTheme = Theme(
70
+ private val lightBaseTheme = Theme(
71
71
  dark = false,
72
72
  colors = ColorScheme(
73
73
  primary = Colors.pink_03,
@@ -117,14 +117,14 @@ val defaultTheme = Theme(
117
117
  container = Colors.blue_08
118
118
  )
119
119
  ),
120
- font = "MomoTrustSans",
120
+ font = "SFProText",
121
121
  assets = ThemeAssets(
122
122
  headerBackground = null
123
123
  )
124
124
  )
125
125
 
126
126
 
127
- val darkTheme = Theme(
127
+ private val darkBaseTheme = Theme(
128
128
  dark = true,
129
129
  colors = ColorScheme(
130
130
  primary = Colors.pink_04,
@@ -174,13 +174,19 @@ val darkTheme = Theme(
174
174
  container = Colors.blue_08
175
175
  )
176
176
  ),
177
- font = "MomoTrustSans",
177
+ font = "SFProText",
178
178
  assets = ThemeAssets(
179
179
  headerBackground = null
180
180
  )
181
181
  )
182
182
 
183
183
 
184
+ val defaultTheme: Theme
185
+ get() = lightBaseTheme.copy(font = defaultFontFamily)
186
+
187
+ val darkTheme: Theme
188
+ get() = darkBaseTheme.copy(font = defaultFontFamily)
189
+
184
190
  val AppTheme = staticCompositionLocalOf { defaultTheme }
185
191
 
186
192
  val AppStatusBar = staticCompositionLocalOf { 0.dp }
@@ -120,31 +120,17 @@ private val hostFontFiles: Map<String, String> = mapOf(
120
120
  )
121
121
  }
122
122
 
123
- /**
124
- * Font mặc định mới, chỉ áp cho user nằm trong whitelist design system ([KitDesignSystem]).
125
- * Ngoài whitelist thì quay về [LEGACY_DEFAULT_FONT_FAMILY] như trước.
126
- */
127
123
  private const val NEW_DEFAULT_FONT_FAMILY = "MomoTrustSans"
128
124
  private const val LEGACY_DEFAULT_FONT_FAMILY = "SFProText"
129
125
 
130
- /**
131
- * Font thuoc bo design system moi. MoMoTrustDisplay chi duoc header dung tu DS-791
132
- * (commit header title 5bfde6251); truoc do header lay font theo theme, nen ngoai
133
- * whitelist ca hai deu ha ve [LEGACY_DEFAULT_FONT_FAMILY].
134
- */
135
- private val newFontFamilies = setOf(NEW_DEFAULT_FONT_FAMILY, "MoMoTrustDisplay")
126
+ internal val defaultFontFamily: String
127
+ get() = if (KitDesignSystem.isWhiteList) NEW_DEFAULT_FONT_FAMILY else LEGACY_DEFAULT_FONT_FAMILY
136
128
 
137
129
  @Composable
138
130
  fun getFontFamily(fontFamily: String, fontWeight: FontWeight? = FontWeight.Normal): FontFamily {
139
131
  val isWhiteList = KitDesignSystem.isWhiteList
140
- val resolvedFamily =
141
- if (fontFamily in newFontFamilies && !isWhiteList) {
142
- LEGACY_DEFAULT_FONT_FAMILY
143
- } else {
144
- fontFamily
145
- }
146
132
  val defaultFile = if (isWhiteList) NEW_DEFAULT_FONT_FILE else LEGACY_DEFAULT_FONT_FILE
147
- val key = "$resolvedFamily-${fontWeight?.weight}"
133
+ val key = "$fontFamily-${fontWeight?.weight}"
148
134
  val fileName = hostFontFiles[key] ?: defaultFile
149
135
  return hostFontFamily(fileName)
150
136
  ?: hostFontFamily(defaultFile)
@@ -9,10 +9,12 @@ import androidx.compose.ui.text.style.TextOverflow
9
9
  import androidx.compose.ui.unit.sp
10
10
  import androidx.compose.ui.zIndex
11
11
  import vn.momo.kits.components.Text
12
+ import vn.momo.kits.const.KitDesignSystem
12
13
  import vn.momo.kits.const.Typography
13
14
  import vn.momo.kits.modifier.setAutomationId
14
15
 
15
- internal const val HEADER_FONT_FAMILY = "MoMoTrustDisplay"
16
+ internal val headerFontFamily: String?
17
+ get() = if (KitDesignSystem.isWhiteList) "MoMoTrustDisplay" else null
16
18
 
17
19
  @Composable
18
20
  internal fun HeaderTitle(
@@ -29,7 +31,7 @@ internal fun HeaderTitle(
29
31
  fontSize = 15.sp,
30
32
  lineHeight = 22.sp,
31
33
  ),
32
- fontFamily = HEADER_FONT_FAMILY,
34
+ fontFamily = headerFontFamily,
33
35
  color = color,
34
36
  maxLines = 1,
35
37
  overflow = TextOverflow.Ellipsis
@@ -79,7 +79,7 @@ internal fun HeaderUser(
79
79
  text = data.title,
80
80
  color = data.tintColor,
81
81
  style = Typography.actionXsBold,
82
- fontFamily = HEADER_FONT_FAMILY,
82
+ fontFamily = headerFontFamily,
83
83
  maxLines = 1,
84
84
  overflow = TextOverflow.Ellipsis
85
85
  )
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.162.40
21
+ version=0.162.41
22
22
 
23
23
  repo=GitLab
24
24
  url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.162.40-debug",
3
+ "version": "0.162.41-debug",
4
4
  "private": false,
5
5
  "dependeNavigationncies": {},
6
6
  "devDependencies": {},