@momo-kits/native-kits 0.162.3-debug → 0.162.3-fontscale.1

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.
Files changed (168) hide show
  1. package/.codegraph/.gitignore +5 -0
  2. package/CLAUDE.md +78 -0
  3. package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Example.xcscheme +32 -0
  4. package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  5. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  6. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/WorkspaceSettings.xcsettings +16 -0
  7. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +6 -0
  8. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +5 -0
  9. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +58 -0
  10. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Pods-Example.xcscheme +58 -0
  11. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImage.xcscheme +58 -0
  12. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +58 -0
  13. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SkeletonUI.xcscheme +58 -0
  14. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios-LottiePrivacyInfo.xcscheme +58 -0
  15. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios.xcscheme +58 -0
  16. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +60 -0
  17. package/ios/Application/Components.swift +1 -0
  18. package/ios/Application/FloatingButton.swift +1 -0
  19. package/ios/Badge/Badge.swift +1 -0
  20. package/ios/Badge/BadgeRibbon.swift +2 -0
  21. package/ios/Button/Button.swift +1 -1
  22. package/ios/Checkbox/Checkbox.swift +1 -0
  23. package/ios/Information/Information.swift +151 -0
  24. package/ios/Input/Input.swift +1 -0
  25. package/ios/Input/InputPhoneNumber.swift +1 -0
  26. package/ios/Input/InputSearch.swift +3 -0
  27. package/ios/Input/InputTextArea.swift +1 -0
  28. package/ios/OTPKeyboard/KeyboardButton.swift +1 -1
  29. package/ios/Popup/PopupDisplay.swift +6 -0
  30. package/ios/Popup/PopupInput.swift +2 -0
  31. package/ios/Template/TrustBanner/TrustBanner.swift +2 -0
  32. package/ios/Typography/Text.swift +1 -0
  33. package/ios/Typography/Typography.swift +14 -5
  34. package/package.json +1 -1
  35. package/build.gradle.kts +0 -11
  36. package/compose/build.gradle.kts +0 -186
  37. package/compose/build.gradle.kts.backup +0 -186
  38. package/compose/compose.podspec +0 -47
  39. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +0 -6
  40. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -123
  41. package/compose/src/commonMain/composeResources/font/momosignature.otf +0 -0
  42. package/compose/src/commonMain/composeResources/font/momotrustdisplay.otf +0 -0
  43. package/compose/src/commonMain/composeResources/font/sfprotext_black.otf +0 -0
  44. package/compose/src/commonMain/composeResources/font/sfprotext_black.ttf +0 -0
  45. package/compose/src/commonMain/composeResources/font/sfprotext_bold.ttf +0 -0
  46. package/compose/src/commonMain/composeResources/font/sfprotext_heavy.ttf +0 -0
  47. package/compose/src/commonMain/composeResources/font/sfprotext_light.ttf +0 -0
  48. package/compose/src/commonMain/composeResources/font/sfprotext_medium.ttf +0 -0
  49. package/compose/src/commonMain/composeResources/font/sfprotext_regular.ttf +0 -0
  50. package/compose/src/commonMain/composeResources/font/sfprotext_semibold.ttf +0 -0
  51. package/compose/src/commonMain/composeResources/font/sfprotext_thin.otf +0 -0
  52. package/compose/src/commonMain/composeResources/font/sfprotext_thin.ttf +0 -0
  53. package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.otf +0 -0
  54. package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.ttf +0 -0
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +0 -57
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -109
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +0 -201
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +0 -222
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +0 -48
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +0 -86
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +0 -76
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +0 -76
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +0 -305
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +0 -33
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -921
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +0 -121
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +0 -403
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +0 -69
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +0 -157
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +0 -87
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +0 -32
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +0 -340
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -198
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +0 -357
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -123
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -94
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +0 -136
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +0 -224
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -543
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +0 -23
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +0 -76
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +0 -148
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +0 -188
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +0 -116
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -452
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +0 -172
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +0 -255
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -235
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +0 -233
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +0 -259
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +0 -241
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +0 -364
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +0 -108
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +0 -56
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +0 -41
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -92
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +0 -40
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +0 -352
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +0 -103
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -338
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +0 -70
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +0 -87
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -17
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -96
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +0 -348
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +0 -256
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +0 -494
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +0 -131
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -215
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -96
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -531
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -92
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +0 -135
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +0 -214
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +0 -590
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +0 -177
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +0 -192
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +0 -205
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +0 -29
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +0 -239
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -191
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +0 -306
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +0 -12
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +0 -16
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +0 -188
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -285
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +0 -2
  128. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +0 -35
  129. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +0 -2
  130. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -57
  131. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -68
  132. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +0 -11
  133. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -14
  134. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -50
  135. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +0 -51
  136. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +0 -253
  137. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +0 -133
  138. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -104
  139. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -145
  140. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +0 -345
  141. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +0 -8
  142. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +0 -556
  143. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +0 -161
  144. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -243
  145. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -86
  146. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -187
  147. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +0 -315
  148. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -80
  149. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +0 -306
  150. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -34
  151. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +0 -370
  152. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -131
  153. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -167
  154. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -72
  155. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -66
  156. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +0 -1329
  157. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +0 -70
  158. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +0 -15
  159. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +0 -105
  160. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +0 -33
  161. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -186
  162. package/gradle/libs.versions.toml +0 -67
  163. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  164. package/gradle/wrapper/gradle-wrapper.properties +0 -8
  165. package/gradle.properties +0 -26
  166. package/gradlew +0 -252
  167. package/gradlew.bat +0 -94
  168. package/settings.gradle.kts +0 -64
@@ -54,6 +54,7 @@ public struct Badge: View {
54
54
  public var body: some View {
55
55
  Text(formatTitle(label))
56
56
  .font(.system(size: scaleSize(10), weight: .bold))
57
+ .ignoreBoldTextSetting()
57
58
  .foregroundColor(Colors.black01)
58
59
  .padding(.horizontal, Spacing.XS)
59
60
  .frame(minWidth: scaleSize(16), minHeight: scaleSize(16))
@@ -138,6 +138,7 @@ public struct BadgeRibbon: View {
138
138
  HStack(spacing: 0) {
139
139
  Text(label)
140
140
  .font(.system(size: scaleSize(12), weight: .medium))
141
+ .ignoreBoldTextSetting()
141
142
  .foregroundColor(Colors.black01)
142
143
  .lineLimit(1)
143
144
  .rotationEffect(rotation)
@@ -159,6 +160,7 @@ public struct BadgeRibbon: View {
159
160
  HStack(spacing: 0) {
160
161
  Text(label)
161
162
  .font(.system(size: scaleSize(12), weight: .medium))
163
+ .ignoreBoldTextSetting()
162
164
  .foregroundColor(Colors.black01)
163
165
  .lineLimit(1)
164
166
  .rotationEffect(rotation)
@@ -200,7 +200,7 @@ public struct Button: View {
200
200
  .background(bg)
201
201
  .overlay(
202
202
  RoundedRectangle(cornerRadius: size.radius)
203
- .stroke(border ?? .clear, lineWidth: border != nil ? borderWidth : 0)
203
+ .strokeBorder(border ?? .clear, lineWidth: border != nil ? borderWidth : 0)
204
204
  )
205
205
  .clipShape(RoundedRectangle(cornerRadius: size.radius))
206
206
  .opacity(loading ? 0.75 : 1)
@@ -55,6 +55,7 @@ public struct Checkbox: View{
55
55
  if !title.isEmpty {
56
56
  Text(title)
57
57
  .font(.description1)
58
+ .ignoreBoldTextSetting()
58
59
  }
59
60
  }
60
61
  }
@@ -0,0 +1,151 @@
1
+ import SwiftUI
2
+
3
+ public enum InformationState {
4
+ case `default`
5
+ case warning
6
+ case error
7
+ }
8
+
9
+ public struct Information: View {
10
+ private let title: String?
11
+ private let description: String
12
+ private let state: InformationState
13
+ private let image: String?
14
+ private let onPressAction: (() -> Void)?
15
+ private let showIcon: Bool
16
+ private let action: String?
17
+ private let showIconClose: Bool
18
+ private let onPressClose: (() -> Void)?
19
+
20
+ public init(
21
+ title: String? = nil,
22
+ description: String = "Description",
23
+ state: InformationState = .default,
24
+ image: String? = nil,
25
+ onPressAction: (() -> Void)? = nil,
26
+ showIcon: Bool = true,
27
+ action: String? = nil,
28
+ showIconClose: Bool = true,
29
+ onPressClose: (() -> Void)? = nil
30
+ ) {
31
+ self.title = title
32
+ self.description = description
33
+ self.state = state
34
+ self.image = image
35
+ self.onPressAction = onPressAction
36
+ self.showIcon = showIcon
37
+ self.action = action
38
+ self.showIconClose = showIconClose
39
+ self.onPressClose = onPressClose
40
+ }
41
+
42
+ private var borderColor: Color {
43
+ switch state {
44
+ case .default: return Colors.blue07
45
+ case .warning: return Colors.yellow06
46
+ case .error: return Colors.red07
47
+ }
48
+ }
49
+
50
+ private var backgroundColor: Color {
51
+ switch state {
52
+ case .default: return Colors.blue10
53
+ case .warning: return Colors.yellow09
54
+ case .error: return Colors.red10
55
+ }
56
+ }
57
+
58
+ private var accentColor: Color {
59
+ switch state {
60
+ case .default: return Colors.blue03
61
+ case .warning: return Colors.orange03
62
+ case .error: return Colors.red03
63
+ }
64
+ }
65
+
66
+ private var iconSource: String {
67
+ switch state {
68
+ case .default: return "notifications_info"
69
+ case .warning: return "24_notifications_alert_triangle"
70
+ case .error: return "24_notifications_alert_octagon"
71
+ }
72
+ }
73
+
74
+ public var body: some View {
75
+ VStack(alignment: .leading, spacing: 0) {
76
+ HStack(alignment: .top, spacing: 0) {
77
+ if let image {
78
+ ImageView(image)
79
+ .frame(width: 40, height: 40)
80
+ .clipShape(RoundedRectangle(cornerRadius: Radius.S))
81
+ .padding(.trailing, Spacing.S)
82
+ } else if showIcon {
83
+ Icon(source: iconSource, size: 16, color: accentColor)
84
+ .padding(.trailing, Spacing.S)
85
+ }
86
+
87
+ VStack(alignment: .leading, spacing: 0) {
88
+ if let title {
89
+ MomoText(title, typography: .labelDefaultMedium)
90
+ }
91
+ MomoText(description, typography: .descriptionDefaultRegular)
92
+ }
93
+ .frame(maxWidth: .infinity, alignment: .leading)
94
+
95
+ if let onPressClose, showIconClose {
96
+ Icon(source: "navigation_close", size: 16, color: Colors.black17)
97
+ .contentShape(Rectangle())
98
+ .onTapGesture(perform: onPressClose)
99
+ }
100
+ }
101
+
102
+ if let action, let onPressAction {
103
+ MomoText(action, typography: .actionXsBold, color: accentColor)
104
+ .frame(maxWidth: .infinity, alignment: .trailing)
105
+ .contentShape(Rectangle())
106
+ .onTapGesture(perform: onPressAction)
107
+ .padding(.top, Spacing.S)
108
+ }
109
+ }
110
+ .padding(Spacing.M)
111
+ .background(
112
+ RoundedRectangle(cornerRadius: Radius.S)
113
+ .fill(backgroundColor)
114
+ )
115
+ .overlay(
116
+ RoundedRectangle(cornerRadius: Radius.S)
117
+ .stroke(borderColor, lineWidth: 0.5)
118
+ )
119
+ }
120
+ }
121
+
122
+ // MARK: - Preview
123
+ #if DEBUG
124
+ struct Information_Previews: PreviewProvider {
125
+ static var previews: some View {
126
+ VStack(spacing: 16) {
127
+ Information(
128
+ title: "Information",
129
+ description: "This is a default information message."
130
+ )
131
+ Information(
132
+ title: "Warning",
133
+ description: "This is a warning message.",
134
+ state: .warning
135
+ )
136
+ Information(
137
+ title: "Error",
138
+ description: "This is an error message.",
139
+ state: .error,
140
+ onPressAction: {}, action: "Retry"
141
+ )
142
+ Information(
143
+ description: "Dismissible information.",
144
+ onPressClose: {}
145
+ )
146
+ }
147
+ .padding()
148
+ .previewLayout(.sizeThatFits)
149
+ }
150
+ }
151
+ #endif
@@ -157,6 +157,7 @@ public struct Input: View {
157
157
  })
158
158
  .keyboardType(keyboardType)
159
159
  .font(fontWeight == .bold ? .action_s_bold : .body_default_regular)
160
+ .ignoreBoldTextSetting()
160
161
  .foregroundColor(getTextColor())
161
162
  .disabled(disabled || readOnly)
162
163
  .applyPrimaryCursorColor()
@@ -94,6 +94,7 @@ public struct InputPhoneNumber: View {
94
94
  })
95
95
  .keyboardType(.numberPad)
96
96
  .font(size == .small ? .header_s_semibold : .header_m_bold)
97
+ .ignoreBoldTextSetting()
97
98
  .foregroundColor(Colors.black17)
98
99
  .applyPrimaryCursorColor()
99
100
  .lineLimit(1)
@@ -168,6 +168,7 @@ public struct InputSearch: View {
168
168
  Text(placeholder)
169
169
  .foregroundColor(disabled ? Colors.black08 : Colors.black12)
170
170
  .font(.system(size: 16, weight: fontWeight))
171
+ .ignoreBoldTextSetting()
171
172
  }
172
173
  TextField("", text: $text, onEditingChanged: { editing in
173
174
  isFocused = editing
@@ -183,6 +184,7 @@ public struct InputSearch: View {
183
184
  .disabled(disabled)
184
185
  .foregroundColor(disabled ? Colors.black08 : Colors.black17)
185
186
  .font(.system(size: 15, weight: fontWeight))
187
+ .ignoreBoldTextSetting()
186
188
  .keyboardType(keyboardType)
187
189
  }
188
190
 
@@ -212,6 +214,7 @@ public struct InputSearch: View {
212
214
  Text(buttonText)
213
215
  .foregroundColor(Colors.black17)
214
216
  .font(.system(size: 14, weight: .medium))
217
+ .ignoreBoldTextSetting()
215
218
  }
216
219
  .padding(.leading, Spacing.L)
217
220
  }
@@ -223,6 +223,7 @@ public struct InputTextArea: View {
223
223
  onBlur()
224
224
  }
225
225
  }
226
+ .ignoreBoldTextSetting()
226
227
  }
227
228
 
228
229
  private var borderColor: Color {
@@ -22,7 +22,7 @@ public struct KeyboardButton: View {
22
22
  public var body: some View {
23
23
  SwiftUI.Button(action: { self.action(key) }) {
24
24
  HStack {
25
- Text(key).font(.system(size: 24, weight: .bold))
25
+ Text(key).font(.system(size: 24, weight: .bold)).ignoreBoldTextSetting()
26
26
  }.frame(maxWidth: CGFloat(width), minHeight: height)
27
27
  .background(color)
28
28
  .foregroundColor(textColor)
@@ -24,6 +24,7 @@ extension View {
24
24
  VStack(spacing: 0) {
25
25
  Text("A")
26
26
  .font(font)
27
+ .ignoreBoldTextSetting()
27
28
  .lineLimit(1)
28
29
  .fixedSize()
29
30
  .background(
@@ -35,6 +36,7 @@ extension View {
35
36
 
36
37
  Text("A\nA")
37
38
  .font(font)
39
+ .ignoreBoldTextSetting()
38
40
  .lineLimit(2)
39
41
  .fixedSize(horizontal: false, vertical: true)
40
42
  .background(
@@ -221,12 +223,14 @@ public struct PopupDisplay: View {
221
223
  SwiftUI.Button(action: onPressCloseButton) {
222
224
  Text(closeButtonTitle)
223
225
  .font(.action2)
226
+ .ignoreBoldTextSetting()
224
227
  }.foregroundColor(Colors.black09)
225
228
  .padding(.trailing, 12)
226
229
 
227
230
  SwiftUI.Button(action: onPressAction) {
228
231
  Text(actionButtonTitle)
229
232
  .font(.action2)
233
+ .ignoreBoldTextSetting()
230
234
  }.foregroundColor(Colors.primary)
231
235
  }
232
236
  .frame(maxWidth: .infinity, alignment: .trailing)
@@ -238,12 +242,14 @@ public struct PopupDisplay: View {
238
242
  SwiftUI.Button(action: onPressAction) {
239
243
  Text(actionButtonTitle)
240
244
  .font(.action2)
245
+ .ignoreBoldTextSetting()
241
246
  }.foregroundColor(Colors.primary)
242
247
  .padding(.bottom, 6)
243
248
 
244
249
  SwiftUI.Button(action: onPressCloseButton) {
245
250
  Text(closeButtonTitle)
246
251
  .font(.action2)
252
+ .ignoreBoldTextSetting()
247
253
  }.foregroundColor(Colors.black09)
248
254
  }
249
255
  .frame(maxWidth: .infinity, alignment: .trailing)
@@ -38,12 +38,14 @@ public struct PopupInput: View {
38
38
  Text(title)
39
39
  .foregroundColor(.black)
40
40
  .font(.headerText1)
41
+ .ignoreBoldTextSetting()
41
42
  .padding(.top, 12)
42
43
  .padding(.bottom, 24)
43
44
 
44
45
  Text(description)
45
46
  .foregroundColor(.black)
46
47
  .font(.paragraph)
48
+ .ignoreBoldTextSetting()
47
49
  .opacity(0.6)
48
50
  .multilineTextAlignment(.leading)
49
51
  .padding(.bottom, 20)
@@ -79,6 +79,7 @@ public struct TrustBanner: View {
79
79
  .foregroundColor(Color(hex: "484848"))
80
80
  .lineLimit(2)
81
81
  .font(.system(size: 13, weight: Font.Weight.regular))
82
+ .ignoreBoldTextSetting()
82
83
  .lineSpacing(3)
83
84
  .padding(.bottom, 8)
84
85
  HStack {
@@ -86,6 +87,7 @@ public struct TrustBanner: View {
86
87
  Text(applicationEnvironment.config?.trustBanner?.subContent[language ?? "vi"] as? String ?? defaultBanner.subContent[language ?? "vi"])
87
88
  .foregroundColor(Colors.pink03)
88
89
  .font(.system(size: 13, weight: .bold))
90
+ .ignoreBoldTextSetting()
89
91
  .padding(.trailing, 4)
90
92
 
91
93
  Icon(source: "arrow_chevron_right_small", color: Colors.pink03)
@@ -136,5 +136,6 @@ public struct MomoText: View {
136
136
  .lineSpacing(scaleSize(typography.lineHeight) - scaleSize(typography.fontSize))
137
137
 
138
138
  return text
139
+ .ignoreBoldTextSetting()
139
140
  }
140
141
  }
@@ -1,14 +1,23 @@
1
1
  import SwiftUI
2
2
 
3
+ public extension View {
4
+ /// Forces SwiftUI to ignore the OS "Bold Text" accessibility setting so the
5
+ /// kit's typography weight stays fixed and matches the Compose implementation
6
+ /// (which does not honor that OS setting). Apply it wherever a `.font(...)` is set.
7
+ func ignoreBoldTextSetting() -> some View {
8
+ environment(\.legibilityWeight, .regular)
9
+ }
10
+ }
11
+
3
12
  public extension Font {
4
13
  static func appFont(size: CGFloat) -> Font {
5
14
  let defaultScreenSize: CGFloat = 375
6
15
  let maxFontScale: CGFloat = 1.5
7
16
  let maxDeviceScale: CGFloat = 5
8
-
17
+
9
18
  let deviceWidth = UIScreen.main.bounds.width
10
19
  let deviceScale = deviceWidth / defaultScreenSize
11
-
20
+
12
21
  let defaultFont = UIFont.systemFont(ofSize: UIFont.labelFontSize)
13
22
  let scaledFont = UIFontMetrics.default.scaledFont(for: defaultFont)
14
23
  let fontScale = scaledFont.pointSize / defaultFont.pointSize
@@ -25,7 +34,7 @@ public extension Font {
25
34
 
26
35
  return Font.system(size: fontSize)
27
36
  }
28
-
37
+
29
38
  // New supported typography styles
30
39
  static let headline_default_bold = appFont(size: 24).weight(.bold)
31
40
  static let header_m_bold = appFont(size: 18).weight(.bold)
@@ -43,7 +52,7 @@ public extension Font {
43
52
  static let action_s_bold = appFont(size: 14).weight(.bold)
44
53
  static let action_xs_bold = appFont(size: 12).weight(.bold)
45
54
  static let action_xxs_bold = appFont(size: 10).weight(.bold)
46
-
55
+
47
56
  // Legacy styles
48
57
  static let headline_default = appFont(size: 28).weight(.semibold)
49
58
  static let headline_s = appFont(size: 24).weight(.semibold)
@@ -68,7 +77,7 @@ public extension Font {
68
77
  static let action_xxs = appFont(size: 10).weight(.bold)
69
78
  static let action_xs = appFont(size: 12).weight(.bold)
70
79
  static let action_s = appFont(size: 15).weight(.bold)
71
-
80
+
72
81
  // deprecated
73
82
  static let h1 = appFont(size: 36).weight(.semibold) //headline_xl
74
83
  static let h2 = appFont(size: 32).weight(.semibold)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.162.3-debug",
3
+ "version": "0.162.3-fontscale.1",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},
package/build.gradle.kts DELETED
@@ -1,11 +0,0 @@
1
- plugins {
2
- // this is necessary to avoid the plugins to be loaded multiple times
3
- // in each subproject's classloader
4
- alias(libs.plugins.android.application) apply false
5
- alias(libs.plugins.android.library) apply false
6
- alias(libs.plugins.compose) apply false
7
- alias(libs.plugins.kotlin.compose.compiler) apply false
8
- alias(libs.plugins.jetbrains.kotlin.multiplatform) apply false
9
- alias(libs.plugins.jetbrains.kotlin.serialization) apply false
10
- alias(libs.plugins.vanniktech.mavenPublish) apply false
11
- }
@@ -1,186 +0,0 @@
1
- // import com.vanniktech.maven.publish.JavadocJar
2
- // import com.vanniktech.maven.publish.KotlinMultiplatform
3
- import org.jetbrains.kotlin.gradle.dsl.JvmTarget
4
-
5
- plugins {
6
- alias(libs.plugins.jetbrains.kotlin.multiplatform)
7
- alias(libs.plugins.android.library)
8
- alias(libs.plugins.compose)
9
- alias(libs.plugins.kotlin.compose.compiler)
10
- // alias(libs.plugins.vanniktech.mavenPublish)
11
- id(libs.plugins.jetbrains.kotlin.cocoapods.get().pluginId)
12
- kotlin("plugin.serialization")
13
- }
14
-
15
- val gitlabName: String? = findProperty("name") as String? ?: ""
16
- val gitlabRepo: String? = findProperty("repo") as String? ?: ""
17
- val gitlabUrl: String? = findProperty("url") as String? ?: ""
18
- val gitlabGroup: String? = findProperty("group") as String? ?: ""
19
- val gitlabArtifactId: String = findProperty("artifact.id") as String? ?: ""
20
- val gitlabVersion: String? = findProperty("version") as String? ?: ""
21
- val gitlabUser: String? = findProperty("gitlab.user") as String? ?: ""
22
- val gitlabKey: String? = findProperty("gitlab.password") as String? ?: ""
23
-
24
- kotlin {
25
- androidTarget {
26
- compilerOptions {
27
- jvmTarget.set(JvmTarget.JVM_17)
28
- }
29
- publishLibraryVariants("release")
30
- }
31
-
32
- val fwName = gitlabArtifactId
33
- val iosTargets = listOf(iosArm64(), iosSimulatorArm64())
34
- iosTargets.forEach {
35
- it.binaries.framework {
36
- baseName = fwName
37
- binaryOption("bundleId", "$gitlabGroup.$fwName")
38
- isStatic = true
39
- }
40
- }
41
-
42
- cocoapods {
43
- version = "0.162.3-debug"
44
- summary = "IOS Shared module"
45
- homepage = "https://momo.vn"
46
- ios.deploymentTarget = "15.0"
47
-
48
- framework {
49
- baseName = fwName
50
- isStatic = true
51
- }
52
-
53
- pod("lottie-ios") {
54
- moduleName = "Lottie"
55
- version = "4.4.3"
56
- extraOpts += listOf("-compiler-option", "-fmodules")
57
- }
58
- }
59
-
60
- sourceSets {
61
- commonMain.dependencies {
62
- implementation(compose.runtime)
63
- implementation(compose.material)
64
- implementation(compose.material3)
65
- implementation(compose.components.resources)
66
- implementation(libs.compose.ui.backhandler)
67
- implementation(libs.ktor.client.core)
68
- implementation(libs.jetbrains.coroutines.core)
69
- implementation(libs.navigation.multiplatform)
70
- implementation(libs.coil.multiplatform.compose)
71
- implementation(libs.coil.multiplatform.core)
72
- implementation(libs.coil.multiplatform.network.ktor)
73
- implementation(libs.jetbrains.serialization.json)
74
- implementation(libs.kotlinx.datetime)
75
- api(libs.native.max.api)
76
- implementation(libs.compottie)
77
- }
78
- androidMain.dependencies {
79
- implementation(libs.ktor.client.okhttp)
80
- implementation(libs.airbnb.lottie)
81
- }
82
- iosMain.dependencies {
83
- implementation(libs.ktor.client.darwin)
84
- }
85
- }
86
- }
87
-
88
- android {
89
- namespace = "vn.momo.kits.kits"
90
- compileSdk = 35
91
- compileOptions {
92
- sourceCompatibility = JavaVersion.VERSION_17
93
- targetCompatibility = JavaVersion.VERSION_17
94
- }
95
- defaultConfig {
96
- minSdk = 24
97
- }
98
- }
99
-
100
- dependencies {
101
- }
102
-
103
- repositories {
104
- google {
105
- mavenContent {
106
- includeGroupAndSubgroups("androidx")
107
- includeGroupAndSubgroups("com.android")
108
- includeGroupAndSubgroups("com.google")
109
- }
110
- }
111
- mavenCentral()
112
- maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
113
- maven {
114
- url = uri("https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven")
115
- credentials {username = "download_packages"; password = "gldt-bjDqLpU_sPcHDuXau2ws" }
116
- }
117
- maven {
118
- url = uri("https://artifacts.mservice.com.vn/repository/maven-momo-app/")
119
- credentials {
120
- username = "viewer"
121
- password = "viewer"
122
- }
123
- isAllowInsecureProtocol = true
124
- }
125
- }
126
-
127
- compose {
128
- resources {
129
- publicResClass = true
130
- packageOfResClass = "vn.momo.uikits.resources"
131
- generateResClass = always
132
- }
133
- }
134
-
135
- // publishing {
136
- // repositories {
137
- // maven {
138
- // name = "${gitlabRepo}Packages"
139
- // credentials {
140
- // username = gitlabUser
141
- // password = gitlabKey
142
- // }
143
- // url = uri("$gitlabUrl")
144
- // }
145
- // }
146
- // }
147
-
148
- // mavenPublishing {
149
- // configure(
150
- // KotlinMultiplatform(
151
- // javadocJar = JavadocJar.Empty(),
152
- // sourcesJar = true,
153
- // androidVariantsToPublish = listOf("release")
154
- // )
155
- // )
156
- //
157
- // repositories {
158
- // maven {
159
- // name = "${gitlabRepo}Packages"
160
- // credentials { username = gitlabUser; password = gitlabKey }
161
- // url = uri("$gitlabUrl")
162
- // }
163
- // }
164
- //
165
- // coordinates(gitlabGroup.toString(), gitlabArtifactId, gitlabVersion.toString())
166
- //
167
- // pom {
168
- // name = "$gitlabName Klib"
169
- // description = "$gitlabName"
170
- // url = "https://gitlab.mservice.com.vn"
171
- // licenses {
172
- // license {
173
- // name = "The Apache License, Version 2.0"
174
- // url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
175
- // distribution = "https://www.apache.org/licenses/LICENSE-2.0.txt"
176
- // }
177
- // }
178
- // developers {
179
- // developer {
180
- // id = "kotlin-hands-on"
181
- // name = "Kotlin Developer Advocate"
182
- // url = "https://github.com/kotlin-hands-on/"
183
- // }
184
- // }
185
- // }
186
- // }