@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.
- package/compose/build.gradle.kts +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +10 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +3 -17
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +4 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +1 -1
- package/gradle.properties +1 -1
- package/package.json +1 -1
package/compose/build.gradle.kts
CHANGED
|
@@ -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.
|
|
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 =
|
|
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
|
|
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 = "
|
|
120
|
+
font = "SFProText",
|
|
121
121
|
assets = ThemeAssets(
|
|
122
122
|
headerBackground = null
|
|
123
123
|
)
|
|
124
124
|
)
|
|
125
125
|
|
|
126
126
|
|
|
127
|
-
val
|
|
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 = "
|
|
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
|
-
|
|
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 = "$
|
|
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
|
|
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 =
|
|
34
|
+
fontFamily = headerFontFamily,
|
|
33
35
|
color = color,
|
|
34
36
|
maxLines = 1,
|
|
35
37
|
overflow = TextOverflow.Ellipsis
|
package/gradle.properties
CHANGED