@momo-kits/native-kits 0.0.1-beta.4 → 0.89.1-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/README.md +1 -0
- package/android/.gradle/8.0/checksums/checksums.lock +0 -0
- package/android/.gradle/8.0/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/8.0/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.0/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.0/gc.properties +0 -0
- package/android/.gradle/config.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/gradle.xml +12 -0
- package/android/.idea/migrations.xml +10 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/.idea/workspace.xml +50 -0
- package/android/build.gradle +35 -69
- package/android/local.properties +8 -0
- package/android/proguard-rules.pro +21 -0
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/java/com/momoplatform/nativekits/foundations/Button.kt +16 -0
- package/android/src/main/java/com/momoplatform/nativekits/libs/Logo.kt +63 -0
- package/android/src/main/java/com/momoplatform/nativekits/libs/TrustBanner.kt +246 -0
- package/android/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/android/src/main/res/drawable-v24/ic_launcher_foreground.xml +30 -0
- package/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +6 -0
- package/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +6 -0
- package/android/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/values/colors.xml +10 -0
- package/android/src/main/res/values/strings.xml +3 -0
- package/android/src/main/res/values/themes.xml +3 -0
- package/android/src/main/res/values-night/themes.xml +3 -0
- package/android/src/main/res/xml/backup_rules.xml +13 -0
- package/android/src/main/res/xml/data_extraction_rules.xml +19 -0
- package/build.gradle.kts +18 -0
- package/compose/build.gradle.kts +82 -0
- package/compose/src/androidMain/AndroidManifest.xml +2 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/utils/Platform.kt +3 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/utils/SetMaskFilter.kt +8 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/utils/Utils.android.kt +14 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Components.kt +194 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +197 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +133 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +62 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +27 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +288 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +80 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +23 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +42 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +126 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +51 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +299 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +246 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +223 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +244 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +281 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PromotionPopup.kt +72 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +65 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +64 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +63 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +73 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +42 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +150 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +13 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +173 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +242 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +50 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1321 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Platform.kt +3 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/SetMaskFilter.kt +5 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +97 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/utils/Platform.kt +3 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/utils/SetMaskFilter.kt +9 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/utils/Utils.ios.kt +18 -0
- package/gradle.properties +19 -0
- package/gradlew +240 -0
- package/gradlew.bat +91 -0
- package/ios/Button/Button.swift +9 -2
- package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +126 -0
- package/ios/Checkbox/Checkbox.swift +38 -0
- package/ios/{Colors+Spacing → Colors+Radius+Spacing}/Colors.swift +21 -19
- package/ios/Colors+Radius+Spacing/Radius.swift +22 -0
- package/ios/Image/Image.swift +60 -0
- package/ios/Input/Input.swift +88 -37
- package/ios/OTPKeyboard/KeyboardButton.swift +12 -4
- package/ios/OTPKeyboard/OTPKeyboard.swift +1 -1
- package/ios/Popup/PopupDisplay.swift +169 -0
- package/ios/Popup/PopupInput.swift +96 -0
- package/ios/Popup/PopupPromotion.swift +52 -0
- package/ios/PopupView/FullscreenPopup.swift +251 -0
- package/ios/{Popup → PopupView}/Modifiers.swift +6 -20
- package/ios/{Popup → PopupView}/PopupView.swift +38 -146
- package/ios/PopupView/Utils++.swift +281 -0
- package/ios/ScrollIndicator/ScrollIndicator.swift +79 -0
- package/ios/Switch/Switch.swift +44 -0
- package/ios/Template/Logo/Logo.swift +75 -0
- package/ios/Template/TrustBanner/TrustBanner.swift +189 -0
- package/ios/native-kits.podspec +2 -0
- package/local.properties +8 -0
- package/package.json +6 -6
- package/publish.sh +1 -10
- package/settings.gradle.kts +41 -0
- package/android/gradle.properties +0 -5
- package/android/src/main/java/com/momoplatform/nativekits/NativeKitsPackage.kt +0 -17
- package/android/src/main/java/com/momoplatform/nativekits/NativeKitsViewManager.kt +0 -20
- package/example/ios/Example/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -63
- package/example/ios/Example/Assets.xcassets/Background.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Border.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Card.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Contents.json +0 -6
- package/example/ios/Example/Assets.xcassets/Error.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Primary.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/PrimaryDark.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/PrimaryLight.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Secondary.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Success.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Text.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/TextSecondary.colorset/Contents.json +0 -38
- package/example/ios/Example/Assets.xcassets/Warning.colorset/Contents.json +0 -38
- package/example/ios/Example/ComponentDetail.swift +0 -35
- package/example/ios/Example/ComponentItem.swift +0 -24
- package/example/ios/Example/ComponentModel.swift +0 -33
- package/example/ios/Example/ContentView.swift +0 -53
- package/example/ios/Example/Example.entitlements +0 -10
- package/example/ios/Example/Foundation/ButtonDemo.swift +0 -80
- package/example/ios/Example/Foundation/Popup/ActionSheets.swift +0 -136
- package/example/ios/Example/Foundation/Popup/Floats.swift +0 -127
- package/example/ios/Example/Foundation/Popup/Popups.swift +0 -101
- package/example/ios/Example/Foundation/PopupDemo.swift +0 -366
- package/example/ios/Example/Foundation/TextInputDemo.swift +0 -31
- package/example/ios/Example/Foundation/TypographyDemo.swift +0 -53
- package/example/ios/Example/Foundation.swift +0 -26
- package/example/ios/Example/Info.plist +0 -18
- package/example/ios/Example/Library/SwipeableDemo.swift +0 -105
- package/example/ios/Example/Library.swift +0 -26
- package/example/ios/Example/Main.swift +0 -11
- package/example/ios/Example/Overview.swift +0 -20
- package/example/ios/Example/Preview Content/Preview Assets.xcassets/Contents.json +0 -6
- package/example/ios/Example/Resource/SFProText-Black.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Bold.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Heavy.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Light.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Medium.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Regular.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Semibold.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Thin.ttf +0 -0
- package/example/ios/Example/Resource/SFProText-Ultralight.ttf +0 -0
- package/example/ios/Example/Resource/foundation.json +0 -33
- package/example/ios/Example/Resource/library.json +0 -8
- package/example/ios/Example/Utils.swift +0 -30
- package/example/ios/Example/ViewModifier/DarkViewModifier.swift +0 -22
- package/example/ios/Example.xcodeproj/project.pbxproj +0 -570
- package/example/ios/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/example/ios/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/example/ios/Example.xcodeproj/project.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/example/ios/Example.xcworkspace/contents.xcworkspacedata +0 -10
- package/example/ios/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
- package/example/ios/Podfile +0 -6
- package/example/ios/Podfile.lock +0 -16
- package/example/ios/Pods/Local Podspecs/MoMoUIKits.podspec.json +0 -29
- package/example/ios/Pods/Manifest.lock +0 -16
- package/example/ios/Pods/Pods.xcodeproj/project.pbxproj +0 -661
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +0 -25
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-dummy.m +0 -5
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-prefix.pch +0 -12
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-umbrella.h +0 -16
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.debug.xcconfig +0 -12
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.modulemap +0 -6
- package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.release.xcconfig +0 -12
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown +0 -3
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist +0 -29
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m +0 -5
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h +0 -16
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig +0 -14
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap +0 -6
- package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig +0 -14
- package/ios/Colors+Spacing/Radius.swift +0 -11
- package/ios/Popup/Utils++.swift +0 -163
- /package/ios/{Colors+Spacing → Colors+Radius+Spacing}/Spacing.swift +0 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
package vn.momo.kits.const
|
|
2
|
+
|
|
3
|
+
import androidx.compose.runtime.Composable
|
|
4
|
+
import androidx.compose.runtime.Immutable
|
|
5
|
+
import androidx.compose.ui.text.TextStyle
|
|
6
|
+
import androidx.compose.ui.text.font.FontFamily
|
|
7
|
+
import androidx.compose.ui.text.font.FontStyle
|
|
8
|
+
import androidx.compose.ui.text.font.FontWeight
|
|
9
|
+
import androidx.compose.ui.unit.sp
|
|
10
|
+
import org.jetbrains.compose.resources.ExperimentalResourceApi
|
|
11
|
+
import org.jetbrains.compose.resources.Font
|
|
12
|
+
import org.jetbrains.compose.resources.FontResource
|
|
13
|
+
import org.jetbrains.compose.resources.InternalResourceApi
|
|
14
|
+
import org.jetbrains.compose.resources.ResourceItem
|
|
15
|
+
import vn.momo.kits.utils.getPlatformName
|
|
16
|
+
import vn.momo.kits.utils.getScreenDimensions
|
|
17
|
+
|
|
18
|
+
const val DEFAULT_SCREEN_SIZE = 375f
|
|
19
|
+
|
|
20
|
+
@Composable
|
|
21
|
+
fun scaleSize(size: Float): Float {
|
|
22
|
+
val deviceWidth = getScreenDimensions().screenWidth
|
|
23
|
+
val scaleRate = deviceWidth / DEFAULT_SCREEN_SIZE
|
|
24
|
+
if (scaleRate > 1) {
|
|
25
|
+
return if ((scaleRate * size) > (size + 5)) size + 5 else scaleRate * size
|
|
26
|
+
}
|
|
27
|
+
return size
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@OptIn(ExperimentalResourceApi::class, InternalResourceApi::class)
|
|
31
|
+
@Composable
|
|
32
|
+
fun getFont(font: String): FontFamily {
|
|
33
|
+
val fontResource = FontResource(
|
|
34
|
+
"font:${font}",
|
|
35
|
+
setOf(ResourceItem(setOf(), "font/${font}.ttf"))
|
|
36
|
+
)
|
|
37
|
+
if (getPlatformName() == "iOS") {
|
|
38
|
+
return FontFamily.Default
|
|
39
|
+
}
|
|
40
|
+
return FontFamily(Font(fontResource))
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@Composable
|
|
44
|
+
fun getFontFamily(fontFamily: String, fontWeight: FontWeight? = FontWeight.Normal): FontFamily {
|
|
45
|
+
val key = "$fontFamily-${fontWeight?.weight}"
|
|
46
|
+
val fontMap = mapOf(
|
|
47
|
+
"SFProText-100" to getFont("SFProText-thin"),
|
|
48
|
+
"SFProText-200" to getFont("SFProText-ultralight"),
|
|
49
|
+
"SFProText-300" to getFont("SFProText-light"),
|
|
50
|
+
"SFProText-400" to getFont("SFProText-regular"),
|
|
51
|
+
"SFProText-500" to getFont("SFProText-medium"),
|
|
52
|
+
"SFProText-600" to getFont("SFProText-semibold"),
|
|
53
|
+
"SFProText-700" to getFont("SFProText-bold"),
|
|
54
|
+
"SFProText-800" to getFont("SFProText-heavy"),
|
|
55
|
+
"SFProText-900" to getFont("SFProText-black"),
|
|
56
|
+
)
|
|
57
|
+
return fontMap[key] ?: getFont("SFProText-regular")
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@Immutable
|
|
61
|
+
class AppTypography internal constructor(
|
|
62
|
+
val headlineDefault: TextStyle,
|
|
63
|
+
val headlineS: TextStyle,
|
|
64
|
+
val headlineL: TextStyle,
|
|
65
|
+
val headlineXl: TextStyle,
|
|
66
|
+
val titleDefault: TextStyle,
|
|
67
|
+
val titleXs: TextStyle,
|
|
68
|
+
val titleS: TextStyle,
|
|
69
|
+
val headerDefault: TextStyle,
|
|
70
|
+
val headerXs: TextStyle,
|
|
71
|
+
val headerS: TextStyle,
|
|
72
|
+
val paragraphDefault: TextStyle,
|
|
73
|
+
val paragraphBold: TextStyle,
|
|
74
|
+
val paragraphItalic: TextStyle,
|
|
75
|
+
val descriptionDefault: TextStyle,
|
|
76
|
+
val descriptionXs: TextStyle,
|
|
77
|
+
val descriptionS: TextStyle,
|
|
78
|
+
val labelDefault: TextStyle,
|
|
79
|
+
val labelXxs: TextStyle,
|
|
80
|
+
val labelXs: TextStyle,
|
|
81
|
+
val labelS: TextStyle,
|
|
82
|
+
val actionDefault: TextStyle,
|
|
83
|
+
val actionXxs: TextStyle,
|
|
84
|
+
val actionXs: TextStyle,
|
|
85
|
+
val actionS: TextStyle,
|
|
86
|
+
) {
|
|
87
|
+
constructor(
|
|
88
|
+
default: TextStyle = TextStyle(
|
|
89
|
+
fontSize = 15.sp,
|
|
90
|
+
lineHeight = 22.sp,
|
|
91
|
+
fontWeight = FontWeight.Normal
|
|
92
|
+
),
|
|
93
|
+
headlineDefault: TextStyle = TextStyle(
|
|
94
|
+
fontSize = 28.sp,
|
|
95
|
+
lineHeight = 34.sp,
|
|
96
|
+
fontWeight = FontWeight.SemiBold
|
|
97
|
+
),
|
|
98
|
+
headlineS: TextStyle = TextStyle(
|
|
99
|
+
fontSize = 24.sp,
|
|
100
|
+
lineHeight = 32.sp,
|
|
101
|
+
fontWeight = FontWeight.SemiBold
|
|
102
|
+
),
|
|
103
|
+
headlineL: TextStyle = TextStyle(
|
|
104
|
+
fontSize = 32.sp,
|
|
105
|
+
lineHeight = 36.sp,
|
|
106
|
+
fontWeight = FontWeight.SemiBold
|
|
107
|
+
),
|
|
108
|
+
headlineXl: TextStyle = TextStyle(
|
|
109
|
+
fontSize = 36.sp,
|
|
110
|
+
lineHeight = 44.sp,
|
|
111
|
+
fontWeight = FontWeight.SemiBold
|
|
112
|
+
),
|
|
113
|
+
titleDefault: TextStyle = TextStyle(
|
|
114
|
+
fontSize = 20.sp,
|
|
115
|
+
lineHeight = 28.sp,
|
|
116
|
+
fontWeight = FontWeight.Bold
|
|
117
|
+
),
|
|
118
|
+
titleXs: TextStyle = TextStyle(
|
|
119
|
+
fontSize = 16.sp,
|
|
120
|
+
lineHeight = 22.sp,
|
|
121
|
+
fontWeight = FontWeight.Bold
|
|
122
|
+
),
|
|
123
|
+
titleS: TextStyle = TextStyle(
|
|
124
|
+
fontSize = 18.sp,
|
|
125
|
+
lineHeight = 28.sp,
|
|
126
|
+
fontWeight = FontWeight.Bold
|
|
127
|
+
),
|
|
128
|
+
headerDefault: TextStyle = TextStyle(
|
|
129
|
+
fontSize = 15.sp,
|
|
130
|
+
lineHeight = 22.sp,
|
|
131
|
+
fontWeight = FontWeight.SemiBold
|
|
132
|
+
),
|
|
133
|
+
headerXs: TextStyle = TextStyle(
|
|
134
|
+
fontSize = 12.sp,
|
|
135
|
+
lineHeight = 16.sp,
|
|
136
|
+
fontWeight = FontWeight.SemiBold
|
|
137
|
+
),
|
|
138
|
+
headerS: TextStyle = TextStyle(
|
|
139
|
+
fontSize = 14.sp,
|
|
140
|
+
lineHeight = 20.sp,
|
|
141
|
+
fontWeight = FontWeight.SemiBold
|
|
142
|
+
),
|
|
143
|
+
paragraphDefault: TextStyle = TextStyle(
|
|
144
|
+
fontSize = 15.sp,
|
|
145
|
+
lineHeight = 22.sp,
|
|
146
|
+
fontWeight = FontWeight.Normal
|
|
147
|
+
),
|
|
148
|
+
paragraphBold: TextStyle = TextStyle(
|
|
149
|
+
fontSize = 15.sp,
|
|
150
|
+
lineHeight = 22.sp,
|
|
151
|
+
fontWeight = FontWeight.Bold
|
|
152
|
+
),
|
|
153
|
+
paragraphItalic: TextStyle = TextStyle(
|
|
154
|
+
fontSize = 15.sp,
|
|
155
|
+
lineHeight = 22.sp,
|
|
156
|
+
fontWeight = FontWeight.Normal,
|
|
157
|
+
fontStyle = FontStyle.Italic
|
|
158
|
+
),
|
|
159
|
+
descriptionDefault: TextStyle = TextStyle(
|
|
160
|
+
fontSize = 14.sp,
|
|
161
|
+
lineHeight = 20.sp,
|
|
162
|
+
fontWeight = FontWeight.Normal
|
|
163
|
+
),
|
|
164
|
+
descriptionXs: TextStyle = TextStyle(
|
|
165
|
+
fontSize = 10.sp,
|
|
166
|
+
lineHeight = 14.sp,
|
|
167
|
+
fontWeight = FontWeight.Normal
|
|
168
|
+
),
|
|
169
|
+
descriptionS: TextStyle = TextStyle(
|
|
170
|
+
fontSize = 12.sp,
|
|
171
|
+
lineHeight = 16.sp,
|
|
172
|
+
fontWeight = FontWeight.Normal,
|
|
173
|
+
),
|
|
174
|
+
labelDefault: TextStyle = TextStyle(
|
|
175
|
+
fontSize = 14.sp,
|
|
176
|
+
lineHeight = 20.sp,
|
|
177
|
+
fontWeight = FontWeight.Medium
|
|
178
|
+
),
|
|
179
|
+
labelXxs: TextStyle = TextStyle(
|
|
180
|
+
fontSize = 8.sp,
|
|
181
|
+
lineHeight = 12.sp,
|
|
182
|
+
fontWeight = FontWeight.Medium
|
|
183
|
+
),
|
|
184
|
+
labelXs: TextStyle = TextStyle(
|
|
185
|
+
fontSize = 10.sp,
|
|
186
|
+
lineHeight = 14.sp,
|
|
187
|
+
fontWeight = FontWeight.Medium
|
|
188
|
+
),
|
|
189
|
+
labelS: TextStyle = TextStyle(
|
|
190
|
+
fontSize = 12.sp,
|
|
191
|
+
lineHeight = 16.sp,
|
|
192
|
+
fontWeight = FontWeight.Medium
|
|
193
|
+
),
|
|
194
|
+
actionDefault: TextStyle = TextStyle(
|
|
195
|
+
fontSize = 16.sp,
|
|
196
|
+
lineHeight = 22.sp,
|
|
197
|
+
fontWeight = FontWeight.Bold
|
|
198
|
+
),
|
|
199
|
+
actionXxs: TextStyle = TextStyle(
|
|
200
|
+
fontSize = 10.sp,
|
|
201
|
+
lineHeight = 14.sp,
|
|
202
|
+
fontWeight = FontWeight.Bold
|
|
203
|
+
),
|
|
204
|
+
actionXs: TextStyle = TextStyle(
|
|
205
|
+
fontSize = 12.sp,
|
|
206
|
+
lineHeight = 16.sp,
|
|
207
|
+
fontWeight = FontWeight.Bold
|
|
208
|
+
),
|
|
209
|
+
actionS: TextStyle = TextStyle(
|
|
210
|
+
fontSize = 15.sp,
|
|
211
|
+
lineHeight = 22.sp,
|
|
212
|
+
fontWeight = FontWeight.Bold
|
|
213
|
+
),
|
|
214
|
+
) : this(
|
|
215
|
+
headlineDefault = headlineDefault,
|
|
216
|
+
headlineS = headlineS,
|
|
217
|
+
headlineL = headlineL,
|
|
218
|
+
headlineXl = headlineXl,
|
|
219
|
+
titleDefault = titleDefault,
|
|
220
|
+
titleXs = titleXs,
|
|
221
|
+
titleS = titleS,
|
|
222
|
+
headerDefault = headerDefault,
|
|
223
|
+
headerXs = headerXs,
|
|
224
|
+
headerS = headerS,
|
|
225
|
+
paragraphDefault = paragraphDefault,
|
|
226
|
+
paragraphBold = paragraphBold,
|
|
227
|
+
paragraphItalic = paragraphItalic,
|
|
228
|
+
descriptionDefault = descriptionDefault,
|
|
229
|
+
descriptionXs = descriptionXs,
|
|
230
|
+
descriptionS = descriptionS,
|
|
231
|
+
labelDefault = labelDefault,
|
|
232
|
+
labelXxs = labelXxs,
|
|
233
|
+
labelXs = labelXs,
|
|
234
|
+
labelS = labelS,
|
|
235
|
+
actionDefault = actionDefault,
|
|
236
|
+
actionXxs = actionXxs,
|
|
237
|
+
actionXs = actionXs,
|
|
238
|
+
actionS = actionS
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
val Typography = AppTypography()
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
package vn.momo.kits.modifier
|
|
2
|
+
|
|
3
|
+
import androidx.compose.ui.Modifier
|
|
4
|
+
import androidx.compose.ui.draw.drawBehind
|
|
5
|
+
import androidx.compose.ui.graphics.Color
|
|
6
|
+
import androidx.compose.ui.graphics.Paint
|
|
7
|
+
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
|
|
8
|
+
import androidx.compose.ui.graphics.toArgb
|
|
9
|
+
import androidx.compose.ui.unit.Dp
|
|
10
|
+
import androidx.compose.ui.unit.dp
|
|
11
|
+
import vn.momo.kits.utils.setMaskFilter
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
fun Modifier.shadow(
|
|
15
|
+
color: Color = Color.Black,
|
|
16
|
+
borderRadius: Dp = 0.dp,
|
|
17
|
+
blurRadius: Float = 0f,
|
|
18
|
+
offsetY: Dp = 0.dp,
|
|
19
|
+
offsetX: Dp = 0.dp,
|
|
20
|
+
spread: Dp = 0f.dp,
|
|
21
|
+
modifier: Modifier = Modifier
|
|
22
|
+
) = this.then(
|
|
23
|
+
modifier.drawBehind {
|
|
24
|
+
this.drawIntoCanvas {
|
|
25
|
+
val paint = Paint()
|
|
26
|
+
val frameworkPaint = paint.asFrameworkPaint()
|
|
27
|
+
val spreadPixel = spread.toPx()
|
|
28
|
+
val leftPixel = (0f - spreadPixel) + offsetX.toPx()
|
|
29
|
+
val topPixel = (0f - spreadPixel) + offsetY.toPx()
|
|
30
|
+
val rightPixel = (this.size.width + spreadPixel)
|
|
31
|
+
val bottomPixel = (0f + spreadPixel) - offsetY.toPx()
|
|
32
|
+
// val bottomPixel = if (offsetY < 0.dp) 0f else this.size.height + spreadPixel
|
|
33
|
+
|
|
34
|
+
if (blurRadius != 0f) {
|
|
35
|
+
frameworkPaint.setMaskFilter(blurRadius)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
frameworkPaint.color = color.toArgb()
|
|
39
|
+
it.drawRoundRect(
|
|
40
|
+
left = leftPixel,
|
|
41
|
+
top = topPixel,
|
|
42
|
+
right = rightPixel,
|
|
43
|
+
bottom = bottomPixel,
|
|
44
|
+
radiusX = borderRadius.toPx(),
|
|
45
|
+
radiusY = borderRadius.toPx(),
|
|
46
|
+
paint
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
)
|