@momo-kits/native-kits 0.300.7-debug → 0.300.8-beta.1-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.
Files changed (202) hide show
  1. package/CLAUDE.md +12 -8
  2. package/README.md +8 -7
  3. package/compose/build.gradle.kts +2 -4
  4. package/compose/build.gradle.kts.backup +1 -3
  5. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +1 -2
  6. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +3 -2
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReduceMotion.android.kt +17 -0
  8. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +1 -1
  9. package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +2 -3
  10. package/compose/src/commonMain/kotlin/vn/momo/kits/application/KitsBinding.kt +60 -0
  11. package/compose/src/commonMain/kotlin/vn/momo/kits/application/KitsHost.kt +32 -0
  12. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +20 -24
  13. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +5 -6
  14. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +7 -17
  15. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +18 -18
  16. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +2 -2
  17. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +15 -18
  18. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +4 -2
  19. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +13 -73
  20. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +1 -1
  21. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +1 -8
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +1 -53
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +3 -8
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +2 -3
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +12 -15
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +11 -9
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +17 -12
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +20 -5
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +3 -5
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +7 -8
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +1 -2
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -2
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +1 -2
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +83 -82
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +3 -3
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +6 -10
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +9 -9
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -2
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +13 -35
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +2 -4
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +5 -22
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -2
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -3
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +6 -24
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +55 -5
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +1 -7
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +3 -6
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +1 -1
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +22 -50
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +2 -7
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +11 -7
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/HeaderLayout.kt +71 -0
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ModalLayout.kt +184 -0
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +18 -9
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +5 -3
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +123 -64
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +24 -8
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +11 -9
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +16 -19
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +59 -41
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +69 -51
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +14 -10
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +5 -10
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +43 -32
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +330 -149
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +87 -70
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +1 -5
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +92 -261
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +133 -0
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -2
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +31 -40
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +3 -1
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +46 -72
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HelpCenterRequest.kt +8 -12
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +29 -24
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/ToolkitRequests.kt +8 -11
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +9 -9
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +26 -3
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +1 -3
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +3 -1
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReduceMotion.kt +7 -0
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +4 -3
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +2 -3
  84. package/compose/src/commonTest/kotlin/vn/momo/kits/application/KitsHostTest.kt +44 -0
  85. package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/HelpCenterRequestTest.kt +2 -7
  86. package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/ToolkitRequestsTest.kt +9 -18
  87. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +1 -1
  88. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +3 -6
  89. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +5 -6
  90. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +12 -12
  91. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReduceMotion.ios.kt +48 -0
  92. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +11 -6
  93. package/gradle/libs.versions.toml +1 -3
  94. package/gradle.properties +1 -3
  95. package/ios/Application/ApplicationEnvironment.swift +6 -4
  96. package/ios/Application/DesignSystemKits.swift +59 -13
  97. package/ios/Application/DesignSystemKitsPayload.swift +0 -8
  98. package/ios/Application/LanguageSource.swift +2 -11
  99. package/ios/Application/Localize.swift +8 -35
  100. package/ios/Application/LocalizeModifier.swift +2 -11
  101. package/ios/Application/MaxApi.swift +3 -11
  102. package/ios/Avatar/Avatar.swift +0 -1
  103. package/ios/Badge/Badge.swift +5 -8
  104. package/ios/Badge/BadgeRibbon.swift +2 -5
  105. package/ios/Button/Button.swift +4 -8
  106. package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +5 -7
  107. package/ios/Carousel/Carousel.swift +4 -17
  108. package/ios/Checkbox/Checkbox.swift +0 -2
  109. package/ios/Collapse/Collapse.swift +17 -11
  110. package/ios/Colors+Radius+Spacing/Theme.swift +0 -7
  111. package/ios/DateTimePicker/DateTimePicker.swift +4 -10
  112. package/ios/DateTimePicker/DateTimePickerTypes.swift +1 -3
  113. package/ios/DateTimePicker/DateTimePickerUtils.swift +0 -3
  114. package/ios/DateTimePicker/WheelPicker.swift +2 -4
  115. package/ios/Extensions/ActiveOpacityButtonStyle.swift +2 -3
  116. package/ios/Extensions/Color++.swift +2 -4
  117. package/ios/Extensions/SkeletonUICompat.swift +0 -8
  118. package/ios/Icon/Icon.swift +3 -6
  119. package/ios/IconButton/IconButton.swift +2 -5
  120. package/ios/Input/ErrorView.swift +0 -7
  121. package/ios/Input/Input.swift +9 -20
  122. package/ios/Input/InputPhoneNumber.swift +37 -20
  123. package/ios/Input/InputSearch.swift +23 -12
  124. package/ios/Input/InputTextArea.swift +4 -13
  125. package/ios/InputDropDown/InputDropDown.swift +1 -11
  126. package/ios/InputMoney/InputMoney.swift +9 -28
  127. package/ios/InputOTP/InputOTP.swift +2 -9
  128. package/ios/Layout/HeaderLayout.swift +72 -0
  129. package/ios/Layout/Item.swift +1 -2
  130. package/ios/Layout/ModalLayout.swift +144 -0
  131. package/ios/Layout/ScreenLayout.swift +48 -31
  132. package/ios/Layout/Section.swift +2 -3
  133. package/ios/Loader/Loader.swift +3 -12
  134. package/ios/Lottie/LottieView.swift +0 -11
  135. package/ios/Navigation/BottomSheet.swift +73 -94
  136. package/ios/Navigation/BottomTab/BottomTab.swift +58 -73
  137. package/ios/Navigation/BottomTab/BottomTabBar.swift +286 -121
  138. package/ios/Navigation/BottomTab/CurvedContainer.swift +52 -54
  139. package/ios/Navigation/BottomTab/DuoBarCompression.swift +5 -12
  140. package/ios/Navigation/BottomTab/DuoTabBar.swift +67 -202
  141. package/ios/Navigation/BottomTab/TabBarMetrics.swift +97 -0
  142. package/ios/Navigation/Component/FloatingButton.swift +4 -11
  143. package/ios/Navigation/Component/Header.swift +35 -54
  144. package/ios/Navigation/Component/HeaderBackground.swift +2 -8
  145. package/ios/Navigation/Component/HeaderJourney.swift +4 -8
  146. package/ios/Navigation/Component/HeaderLocation.swift +4 -8
  147. package/ios/Navigation/Component/HeaderRight.swift +20 -22
  148. package/ios/Navigation/Component/HeaderTitle.swift +1 -6
  149. package/ios/Navigation/Component/HeaderUser.swift +4 -10
  150. package/ios/Navigation/Component/SideBar.swift +6 -21
  151. package/ios/Navigation/Component/SnackBar.swift +9 -13
  152. package/ios/Navigation/HostBackGestureBridge.swift +2 -9
  153. package/ios/Navigation/ModalScreen.swift +24 -13
  154. package/ios/Navigation/Navigation.swift +35 -19
  155. package/ios/Navigation/NavigationContainer.swift +4 -15
  156. package/ios/Navigation/Navigator.swift +21 -39
  157. package/ios/Navigation/StackScreen.swift +64 -51
  158. package/ios/Navigation/StackTransition.swift +7 -14
  159. package/ios/Navigation/SwipeBackHaptic.swift +2 -7
  160. package/ios/Navigation/Tracking/ScreenTracker.swift +2 -7
  161. package/ios/Pagination/PaginationDot.swift +0 -9
  162. package/ios/Pagination/PaginationNumber.swift +1 -9
  163. package/ios/Pagination/PaginationScroll.swift +2 -14
  164. package/ios/Pagination/PaginationWhiteDot.swift +1 -10
  165. package/ios/Popup/PopupDisplay.swift +7 -5
  166. package/ios/Popup/PopupInput.swift +6 -4
  167. package/ios/Popup/PopupLayout.swift +17 -9
  168. package/ios/Popup/PopupNotify.swift +32 -25
  169. package/ios/PopupView/FullscreenPopup.swift +3 -4
  170. package/ios/PopupView/PopupView.swift +2 -2
  171. package/ios/PopupView/Utils++.swift +1 -2
  172. package/ios/ProgressInfo/ProgressInfo.swift +2 -13
  173. package/ios/Skeleton/Skeleton.swift +5 -16
  174. package/ios/Slider/Slider.swift +5 -12
  175. package/ios/StatusBarTap/StatusBarTap.h +2 -3
  176. package/ios/StatusBarTap/StatusBarTap.m +3 -16
  177. package/ios/Stepper/Stepper.swift +8 -27
  178. package/ios/Steps/Steps.swift +29 -26
  179. package/ios/Swipeable/SwipeCell.swift +2 -2
  180. package/ios/Swipeable/SwipeCellModel.swift +3 -6
  181. package/ios/TabView/TabView.swift +14 -28
  182. package/ios/Template/TrustBanner/TrustBanner.swift +2 -9
  183. package/ios/Title/Title.swift +1 -3
  184. package/ios/Tooltip/Tooltip.swift +4 -9
  185. package/ios/Typography/FontScale.swift +79 -24
  186. package/ios/Typography/Text.swift +6 -12
  187. package/ios/Typography/Typography.swift +8 -11
  188. package/ios/Uploader/Uploader.swift +2 -17
  189. package/ios-demo/Resources/tabbar_scan_qr_button.json +1 -0
  190. package/ios-demo/Resources/tabbar_scan_qr_label.json +1 -0
  191. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +11 -2
  192. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +296 -59
  193. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +15 -4
  194. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LocalizeDemo.swift +0 -8
  195. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +114 -0
  196. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +29 -1
  197. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +16 -0
  198. package/package.json +1 -1
  199. package/publish.sh +8 -2
  200. package/scripts/ci/build-swiftui.sh +22 -0
  201. package/scripts/ci/resolve-version.mjs +144 -0
  202. package/settings.gradle.kts +0 -1
@@ -1,8 +1,6 @@
1
1
  import SwiftUI
2
2
 
3
- // ---------------------------------------------------------------------------
4
- // Size variant
5
- // ---------------------------------------------------------------------------
3
+ // MARK: - Size
6
4
 
7
5
  public enum StepperSize {
8
6
  case large
@@ -25,10 +23,9 @@ private func stepperSizeSpec(_ size: StepperSize) -> StepperSizeSpec {
25
23
  }
26
24
  }
27
25
 
28
- // ---------------------------------------------------------------------------
29
- // Disabled spec — mirrors Compose `disabled: Any` (Bool or per-part array)
30
- // ---------------------------------------------------------------------------
26
+ // MARK: - Disabled
31
27
 
28
+ /// Compose's `disabled: Any`: one Bool for every part, or per part.
32
29
  public struct StepperDisabled {
33
30
  let minus: Bool
34
31
  let plus: Bool
@@ -40,7 +37,6 @@ public struct StepperDisabled {
40
37
  self.plus = plus
41
38
  }
42
39
 
43
- /// All parts share the same disabled state.
44
40
  public init(_ all: Bool) {
45
41
  self.minus = all
46
42
  self.plus = all
@@ -53,9 +49,7 @@ extension StepperDisabled: ExpressibleByBooleanLiteral {
53
49
  }
54
50
  }
55
51
 
56
- // ---------------------------------------------------------------------------
57
- // Private sub-views
58
- // ---------------------------------------------------------------------------
52
+ // MARK: - Sub-views
59
53
 
60
54
  private struct StepperButton: View {
61
55
  @Environment(\.appTheme) private var theme
@@ -119,23 +113,10 @@ private struct StepperNumberView: View {
119
113
  }
120
114
  }
121
115
 
122
- // ---------------------------------------------------------------------------
123
- // Public API — MomoStepper
124
- // ---------------------------------------------------------------------------
125
-
126
- /// MomoStepper — quantity +/- control. Layout: [- button] [value] [+ button].
127
- ///
128
- /// Named `MomoStepper` to avoid shadowing SwiftUI's built-in `Stepper`.
129
- ///
130
- /// - Parameters:
131
- /// - value: Binding to the current value. Clamped to `min...max`.
132
- /// - min: Minimum allowed value (default 0). Minus auto-disables at this bound.
133
- /// - max: Maximum allowed value (default 100). Plus auto-disables at this bound.
134
- /// - step: Amount added/subtracted per press (default 1).
135
- /// - size: Visual size variant (default `.large`).
136
- /// - disabled: Disable state — `true` for everything, or `StepperDisabled(minus:plus:)`.
137
- /// - editable: When `true` the number display becomes a keyboard input (default false).
138
- /// - onValueChange: Callback invoked with the new value on every change.
116
+ // MARK: - MomoStepper
117
+
118
+ /// Quantity +/- control, named `MomoStepper` to avoid shadowing SwiftUI's `Stepper`.
119
+ /// `value` is clamped to `min...max`; each button disables itself at its bound.
139
120
  public struct MomoStepper: View {
140
121
  @Binding private var value: Int
141
122
  private let min: Int
@@ -1,6 +1,6 @@
1
1
  import SwiftUI
2
2
 
3
- // ─── Data model ────────────────────────────────────────────────────────────────
3
+ // MARK: - Data model
4
4
 
5
5
  /// A single step rendered inside a ``Steps`` indicator.
6
6
  public struct StepItem: Identifiable {
@@ -23,7 +23,7 @@ public struct StepItem: Identifiable {
23
23
  }
24
24
  }
25
25
 
26
- // ─── Enumerations ──────────────────────────────────────────────────────────────
26
+ // MARK: - Enumerations
27
27
 
28
28
  public enum StepsSize {
29
29
  case small
@@ -37,7 +37,7 @@ public enum StepsAlign {
37
37
  case stretch
38
38
  }
39
39
 
40
- // ─── Internal status ───────────────────────────────────────────────────────────
40
+ // MARK: - Internal status
41
41
 
42
42
  private enum StepStatus {
43
43
  case incomplete
@@ -60,7 +60,7 @@ private func resolveStatus(
60
60
  return .incomplete
61
61
  }
62
62
 
63
- // ─── Color helpers ─────────────────────────────────────────────────────────────
63
+ // MARK: - Color helpers
64
64
 
65
65
  private func resolveIconBgAndBorder(_ status: StepStatus, theme: Theme) -> (bg: Color, border: Color) {
66
66
  switch status {
@@ -88,7 +88,7 @@ private func resolveTitleColor(_ status: StepStatus, theme: Theme) -> Color {
88
88
  }
89
89
  }
90
90
 
91
- // ─── Step bubble ───────────────────────────────────────────────────────────────
91
+ // MARK: - Step bubble
92
92
 
93
93
  private struct StepBubble: View {
94
94
  @Environment(\.appTheme) private var theme
@@ -143,7 +143,7 @@ private struct StepBubble: View {
143
143
  }
144
144
  }
145
145
 
146
- // ─── Horizontal layout ─────────────────────────────────────────────────────────
146
+ // MARK: - Horizontal layout
147
147
 
148
148
  private struct StepsHorizontal: View {
149
149
  @Environment(\.appTheme) private var theme
@@ -180,10 +180,8 @@ private struct StepsHorizontal: View {
180
180
  disabled: disabled
181
181
  )
182
182
  let isActiveOrError = status == .current || status == .error
183
- let titleStyle: TypographyStyle = isActiveOrError
184
- ? .headerXsSemibold : .descriptionDefaultRegular
185
- let descStyle: TypographyStyle = size == .small
186
- ? .descriptionXsRegular : .descriptionDefaultRegular
183
+ let titleStyle: TypographyStyle = isActiveOrError ? .headerXsSemibold : .descriptionDefaultRegular
184
+ let descStyle: TypographyStyle = size == .small ? .descriptionXsRegular : .descriptionDefaultRegular
187
185
  let titleColor = resolveTitleColor(status, theme: theme)
188
186
  let subColor = disabled ? theme.colors.text.disable : theme.colors.text.hint
189
187
 
@@ -193,12 +191,8 @@ private struct StepsHorizontal: View {
193
191
  let hideLineLeft = align == .left || (align == .stretch && index == 0)
194
192
  let hideLineRight = align == .right || (align == .stretch && index == steps.count - 1)
195
193
 
196
- let lineLeft: Color = index == 0
197
- ? Color.clear
198
- : (activeIndex >= index ? completedLine : defaultLine)
199
- let lineRight: Color = index == steps.count - 1
200
- ? Color.clear
201
- : (activeIndex > index ? completedLine : defaultLine)
194
+ let lineLeft = lineColor(isOuterEnd: index == 0, isCompleted: activeIndex >= index)
195
+ let lineRight = lineColor(isOuterEnd: index == steps.count - 1, isCompleted: activeIndex > index)
202
196
 
203
197
  let clickable = status == .completed && onPress != nil && !disabled
204
198
 
@@ -264,6 +258,13 @@ private struct StepsHorizontal: View {
264
258
  }
265
259
  }
266
260
 
261
+ private func lineColor(isOuterEnd: Bool, isCompleted: Bool) -> Color {
262
+ if isOuterEnd {
263
+ return .clear
264
+ }
265
+ return isCompleted ? completedLine : defaultLine
266
+ }
267
+
267
268
  private func horizontalAlignment(for index: Int) -> HorizontalAlignment {
268
269
  switch align {
269
270
  case .left: return .leading
@@ -297,7 +298,7 @@ private struct StepsHorizontal: View {
297
298
  }
298
299
  }
299
300
 
300
- // ─── Vertical layout ───────────────────────────────────────────────────────────
301
+ // MARK: - Vertical layout
301
302
 
302
303
  private struct StepsVertical: View {
303
304
  @Environment(\.appTheme) private var theme
@@ -335,11 +336,8 @@ private struct StepsVertical: View {
335
336
  let isActiveOrError = status == .current || status == .error
336
337
  let isLast = index == steps.count - 1
337
338
 
338
- let titleStyle: TypographyStyle = isActiveOrError
339
- ? (useSmall ? .headerXsSemibold : .headerSSemibold)
340
- : (useSmall ? .descriptionDefaultRegular : .bodyDefaultRegular)
341
- let descStyle: TypographyStyle = useSmall
342
- ? .descriptionXsRegular : .descriptionDefaultRegular
339
+ let titleStyle = resolveTitleStyle(isActiveOrError: isActiveOrError)
340
+ let descStyle: TypographyStyle = useSmall ? .descriptionXsRegular : .descriptionDefaultRegular
343
341
 
344
342
  let titleColor = resolveTitleColor(status, theme: theme)
345
343
  let subColor = disabled ? theme.colors.text.disable : theme.colors.text.hint
@@ -402,13 +400,18 @@ private struct StepsVertical: View {
402
400
  rowBody
403
401
  }
404
402
  }
403
+
404
+ private func resolveTitleStyle(isActiveOrError: Bool) -> TypographyStyle {
405
+ if isActiveOrError {
406
+ return useSmall ? .headerXsSemibold : .headerSSemibold
407
+ }
408
+ return useSmall ? .descriptionDefaultRegular : .bodyDefaultRegular
409
+ }
405
410
  }
406
411
 
407
- // ─── Public API ────────────────────────────────────────────────────────────────
412
+ // MARK: - Public API
408
413
 
409
- /// Steps — guided progress indicator through a sequence of procedural steps.
410
- ///
411
- /// Mirrors the Compose `Steps` component.
414
+ /// Guided progress through a sequence of steps; mirrors Compose `Steps`.
412
415
  public struct Steps: View {
413
416
  private let steps: [StepItem]
414
417
  private let activeIndex: Int
@@ -340,7 +340,7 @@ public struct SwipeCellModifier: ViewModifier {
340
340
  }
341
341
 
342
342
  } else {
343
- // leading group emtpy
343
+ // leading group empty
344
344
  self.setOffsetX(value: 0)
345
345
  }
346
346
  } else if self.offsetX < 0 {
@@ -354,7 +354,7 @@ public struct SwipeCellModifier: ViewModifier {
354
354
  }
355
355
 
356
356
  } else {
357
- // trailing group emtpy
357
+ // trailing group empty
358
358
  self.setOffsetX(value: 0)
359
359
  }
360
360
  }
@@ -1,5 +1,3 @@
1
-
2
-
3
1
  import Foundation
4
2
  import SwiftUI
5
3
 
@@ -49,11 +47,11 @@ public struct SwipeCellActionItem: Identifiable {
49
47
  // MARK: Lifecycle
50
48
 
51
49
  /// Initializer
52
- /// - Parameter id: Required to identify each buttin in the side menu. Default is a random uuid string.
50
+ /// - Parameter id: Required to identify each button in the side menu. Default is a random uuid string.
53
51
  /// - Parameter buttonView: The view in the foreground of the menu button. Make sure to set a maximum frame height less than the cell height!
54
52
  /// - Parameter swipeOutButtonView: Alternative button view that is displayed only when the offset during swipe is beyond the swipe out trigger value.
55
- /// - Parameter buttonWidth: Width of the button. The the open side menu width is calculated from the sum of all button widths. Default is 75.
56
- /// - Parameter backgroundColor: The background colour of the the menu button.
53
+ /// - Parameter buttonWidth: Width of the button. The open side menu width is calculated from the sum of all button widths. Default is 75.
54
+ /// - Parameter backgroundColor: The background colour of the menu button.
57
55
  /// - Parameter swipeOutAction: A Boolean that determines if a swipe out action is activated or not. Default is false.
58
56
  /// - Parameter swipeOutHapticFeedbackType: If a swipeOutAction is activated, a haptic feedback will occur after the swipe out threshold is passed. Default is nil.
59
57
  /// - Parameter swipeOutIsDestructive: A Boolean that determines if the swipe out is destructive. If true, the content cell view will be "move out of sight" once the swipe out is triggered.
@@ -79,7 +77,6 @@ public struct SwipeCellActionItem: Identifiable {
79
77
  public var swipeOutAction: Bool
80
78
  public var swipeOutHapticFeedbackType: UINotificationFeedbackGenerator.FeedbackType?
81
79
  public var swipeOutIsDestructive: Bool
82
- /// public var swipeOutButtonViewScaleFactor: CGFloat
83
80
  public var actionCallback: ()->()
84
81
  }
85
82
 
@@ -1,9 +1,8 @@
1
1
  import SwiftUI
2
2
 
3
- // ---------------------------------------------------------------------------
4
- // Style enums (prefixed with `Tab` to avoid collisions with existing public
5
- // types like ButtonSize / InputSize / TagColor)
6
- // ---------------------------------------------------------------------------
3
+ // MARK: - Style enums
4
+
5
+ // Prefixed to avoid colliding with other public kit types (ButtonSize, InputSize, TagColor).
7
6
 
8
7
  public enum TabViewType {
9
8
  case `default`
@@ -15,10 +14,9 @@ public enum TabViewDirection {
15
14
  case column
16
15
  }
17
16
 
18
- // ---------------------------------------------------------------------------
19
- // Data model — mirrors Compose `TabViewItem`
20
- // ---------------------------------------------------------------------------
17
+ // MARK: - Data model
21
18
 
19
+ /// Mirrors Compose `TabViewItem`.
22
20
  public struct TabViewItem {
23
21
  public let title: String
24
22
  public let icon: String?
@@ -72,10 +70,9 @@ public struct TabViewItem {
72
70
  }
73
71
  }
74
72
 
75
- // ---------------------------------------------------------------------------
76
- // Public component — named `MomoTabView` to avoid shadowing SwiftUI.TabView
77
- // ---------------------------------------------------------------------------
73
+ // MARK: - MomoTabView
78
74
 
75
+ /// Named `MomoTabView` to avoid shadowing SwiftUI's `TabView`.
79
76
  public struct MomoTabView: View {
80
77
  @Environment(\.appTheme) private var theme
81
78
 
@@ -213,9 +210,7 @@ public struct MomoTabView: View {
213
210
  }
214
211
  }
215
212
 
216
- // ---------------------------------------------------------------------------
217
- // Default fixed-width tab bar (equal-width items + animated underline)
218
- // ---------------------------------------------------------------------------
213
+ // MARK: - Default tab bar (equal-width items)
219
214
 
220
215
  private struct DefaultTabBar: View {
221
216
  @Environment(\.appTheme) private var theme
@@ -266,9 +261,7 @@ private struct DefaultTabBar: View {
266
261
  }
267
262
  }
268
263
 
269
- // ---------------------------------------------------------------------------
270
- // Scrollable tab bar (wrap-width items, horizontal scroll, animated underline)
271
- // ---------------------------------------------------------------------------
264
+ // MARK: - Scrollable tab bar (wrap-width items)
272
265
 
273
266
  private struct ScrollableTabBar: View {
274
267
  @Environment(\.appTheme) private var theme
@@ -347,9 +340,7 @@ private struct TabFramePreferenceKey: PreferenceKey {
347
340
  }
348
341
  }
349
342
 
350
- // ---------------------------------------------------------------------------
351
- // Card tab bar
352
- // ---------------------------------------------------------------------------
343
+ // MARK: - Card tab bar
353
344
 
354
345
  private let cardTabHeight: CGFloat = 40
355
346
  private let cardTabActiveHeight: CGFloat = 44
@@ -474,15 +465,12 @@ private struct CardTabEarShape: Shape {
474
465
  )
475
466
  path.addLine(to: CGPoint(x: 0, y: 44))
476
467
  path.closeSubpath()
477
- return mirrored
478
- ? path.applying(CGAffineTransform(a: -1, b: 0, c: 0, d: 1, tx: rect.width, ty: 0))
479
- : path
468
+ guard mirrored else { return path }
469
+ return path.applying(CGAffineTransform(a: -1, b: 0, c: 0, d: 1, tx: rect.width, ty: 0))
480
470
  }
481
471
  }
482
472
 
483
- // ---------------------------------------------------------------------------
484
- // Shared tab item (Default + Scrollable bars)
485
- // ---------------------------------------------------------------------------
473
+ // MARK: - Shared tab item (default + scrollable bars)
486
474
 
487
475
  private struct TabItemView: View {
488
476
  let tab: TabViewItem
@@ -563,9 +551,7 @@ private struct TabItemView: View {
563
551
  }
564
552
  }
565
553
 
566
- // ---------------------------------------------------------------------------
567
- // Shared helpers
568
- // ---------------------------------------------------------------------------
554
+ // MARK: - Shared helpers
569
555
 
570
556
  private func barHeight(_ direction: TabViewDirection) -> CGFloat {
571
557
  direction == .column ? 68 : 48
@@ -1,10 +1,3 @@
1
- //
2
- // TrustBanner.swift
3
- // MoMoUIKits
4
- //
5
- // Created by Nguyễn Hoàng Sơn on 14/12/2023.
6
- //
7
-
8
1
  import Foundation
9
2
  import SwiftUI
10
3
  import SDWebImageSwiftUI
@@ -131,7 +124,7 @@ public struct TrustBanner: View {
131
124
  MomoText(
132
125
  localize.translateData(banner.content),
133
126
  typography: .descriptionDefaultRegular,
134
- color: Color(hex: "484848"),
127
+ color: Colors.black15,
135
128
  maxLines: 2
136
129
  )
137
130
  .padding(.bottom, 8)
@@ -166,7 +159,7 @@ public struct TrustBanner: View {
166
159
  }
167
160
  }
168
161
  .padding(.all, 12)
169
- .background(Color(hex: "F2F8FF"))
162
+ .background(Colors.blue10)
170
163
  .cornerRadius(12)
171
164
  .contentShape(Rectangle())
172
165
  .onTapGesture {
@@ -129,9 +129,7 @@ public struct Title: View {
129
129
  }
130
130
 
131
131
  private var trailingBackground: Color {
132
- type == .section
133
- ? Colors.black06.opacity(0.6)
134
- : Colors.black06.opacity(0.3)
132
+ Colors.black06.opacity(type == .section ? 0.6 : 0.3)
135
133
  }
136
134
 
137
135
  // MARK: - Body
@@ -41,17 +41,14 @@ public final class TooltipState: ObservableObject {
41
41
 
42
42
  public init() {}
43
43
 
44
- /// Shows the tooltip.
45
44
  public func show() {
46
45
  isVisible = true
47
46
  }
48
47
 
49
- /// Hides the tooltip.
50
48
  public func hide() {
51
49
  isVisible = false
52
50
  }
53
51
 
54
- /// Toggles the tooltip visibility.
55
52
  public func toggle() {
56
53
  isVisible.toggle()
57
54
  }
@@ -126,10 +123,8 @@ private struct TooltipAnchorBoundsKey: PreferenceKey {
126
123
 
127
124
  // MARK: - Tooltip
128
125
 
129
- /// A tooltip component that wraps `content` (the anchor) and shows a positioned
130
- /// tooltip popup with title, description, close button, and action buttons.
131
- ///
132
- /// Port of the Compose / React Native `Tooltip` component.
126
+ /// Port of the Compose / RN `Tooltip`: wraps `content` (the anchor) and shows a positioned popup
127
+ /// with title, description, close button and action buttons.
133
128
  public struct Tooltip<Content: View>: View {
134
129
  @ObservedObject private var state: TooltipState
135
130
  private let title: String?
@@ -314,7 +309,7 @@ private struct TooltipPopupContent: View {
314
309
  }
315
310
  .padding(Spacing.M)
316
311
  .frame(maxWidth: TooltipConst.maxWidth, alignment: .leading)
317
- .background(Colors.black17)
312
+ .background(Colors.blue03)
318
313
  .clipShape(RoundedRectangle(cornerRadius: TooltipConst.cornerRadius))
319
314
  }
320
315
  .overlay(arrow, alignment: arrowAlignment)
@@ -328,7 +323,7 @@ private struct TooltipPopupContent: View {
328
323
  let arrowHeight = TooltipConst.arrowSize
329
324
  let isVertical = placement == .top || placement == .bottom
330
325
  TooltipArrowShape(placement: placement)
331
- .fill(Colors.black17)
326
+ .fill(Colors.blue03)
332
327
  .frame(
333
328
  width: isVertical ? arrowWidth : arrowHeight,
334
329
  height: isVertical ? arrowHeight : arrowWidth
@@ -1,15 +1,7 @@
1
- // File: ios/Typography/FontScale.swift
2
- // Created At: 2026-08-06 10:00:00 +07:00
3
- // Created By: AI
4
- // AI Agent: Claude Code
5
- // Model: claude-opus-5
6
-
7
- // AI-GENERATED START: reactive font-scale snapshot injected through the environment
8
1
  import SwiftUI
9
2
 
10
- /// Immutable snapshot of the kit's font-scale inputs. The formula is a 1:1 port of Compose's
11
- /// `scaleSize()` (`const/Typography.kt`): the device-width scale and the OS Dynamic Type scale are
12
- /// computed independently and the larger one wins.
3
+ /// Immutable snapshot of the font-scale inputs; formula 1:1 with Compose's `scaleSize()` (`const/Typography.kt`):
4
+ /// the device-width and OS Dynamic Type scales are computed independently and the larger wins.
13
5
  public struct FontScale: Equatable {
14
6
  private static let defaultScreenSize: CGFloat = 375
15
7
  private static let maxFontScale: CGFloat = 1.5
@@ -19,20 +11,36 @@ public struct FontScale: Equatable {
19
11
  public let useOSScaleRate: Bool
20
12
  /// OS Dynamic Type factor at the time the snapshot was taken.
21
13
  public let osFontScale: CGFloat
14
+ /// From the app window, not UIScreen.main (which stays on one display on iPhone Duo).
15
+ public let windowShortSide: CGFloat
16
+ /// Caps the result at size × maxScaleRate on both the userScaleRate and OS paths, nil = no cap. Set it with
17
+ /// `ScaleSizeScope` or `MiniAppContext.scaleSizeMaxRate` (Compose parity).
18
+ public let maxScaleRate: CGFloat?
22
19
 
23
- public init(userScaleRate: CGFloat = 1, useOSScaleRate: Bool = true, osFontScale: CGFloat = 1) {
20
+ public init(
21
+ userScaleRate: CGFloat = 1,
22
+ useOSScaleRate: Bool = true,
23
+ osFontScale: CGFloat = 1,
24
+ windowShortSide: CGFloat? = nil,
25
+ maxScaleRate: CGFloat? = nil
26
+ ) {
24
27
  self.userScaleRate = userScaleRate
25
28
  self.useOSScaleRate = useOSScaleRate
26
29
  self.osFontScale = osFontScale
30
+ self.windowShortSide = windowShortSide ?? DesignSystemKits.currentWindowShortSide()
31
+ self.maxScaleRate = maxScaleRate
27
32
  }
28
33
 
29
34
  /// `callAsFunction` so call sites keep reading like Compose's `scaleSize(16)`.
30
35
  public func callAsFunction(_ size: CGFloat) -> CGFloat {
31
- guard useOSScaleRate else { return size * userScaleRate }
36
+ func cap(_ scaled: CGFloat) -> CGFloat {
37
+ guard let maxScaleRate else { return scaled }
38
+ return min(scaled, size * maxScaleRate)
39
+ }
40
+ guard useOSScaleRate else { return cap(size * userScaleRate) }
32
41
 
33
42
  // Short side, not width: landscape must not inflate every font (and so every popup's height).
34
- let bounds = UIScreen.main.bounds.size
35
- let deviceScale = min(bounds.width, bounds.height) / Self.defaultScreenSize
43
+ let deviceScale = windowShortSide / Self.defaultScreenSize
36
44
 
37
45
  var deviceScaled = size
38
46
  var osScaled = size
@@ -40,9 +48,20 @@ public struct FontScale: Equatable {
40
48
  deviceScaled = min(size * deviceScale, size + Self.maxDeviceScale)
41
49
  }
42
50
  if osFontScale > 1 {
43
- osScaled = min(size * osFontScale, size * Self.maxFontScale)
51
+ osScaled = min(size * osFontScale, size * (maxScaleRate ?? Self.maxFontScale))
44
52
  }
45
- return max(deviceScaled, osScaled)
53
+ return cap(max(deviceScaled, osScaled))
54
+ }
55
+
56
+ /// A copy that caps the scale at `rate` (nil lifts the cap) while keeping the host/OS inputs.
57
+ public func cappedAt(_ rate: CGFloat?) -> FontScale {
58
+ FontScale(
59
+ userScaleRate: userScaleRate,
60
+ useOSScaleRate: useOSScaleRate,
61
+ osFontScale: osFontScale,
62
+ windowShortSide: windowShortSide,
63
+ maxScaleRate: rate
64
+ )
46
65
  }
47
66
 
48
67
  /// `.system(size:)` is a fixed-size font — SwiftUI does not Dynamic-Type it — so the scale has to
@@ -53,12 +72,15 @@ public struct FontScale: Equatable {
53
72
 
54
73
  /// A host-pushed mini-app context wins per field, matching Compose's
55
74
  /// `context?.useOSScaleRate ?: DesignSystemKits.getConfigs().useOSScaleRate`.
56
- public func overriding(userScaleRate: CGFloat?, useOSScaleRate: Bool?) -> FontScale {
57
- guard userScaleRate != nil || useOSScaleRate != nil else { return self }
75
+ public func overriding(userScaleRate: CGFloat?, useOSScaleRate: Bool?, maxScaleRate: CGFloat? = nil) -> FontScale {
76
+ let overridesAny = userScaleRate != nil || useOSScaleRate != nil || maxScaleRate != nil
77
+ guard overridesAny else { return self }
58
78
  return FontScale(
59
79
  userScaleRate: userScaleRate ?? self.userScaleRate,
60
80
  useOSScaleRate: useOSScaleRate ?? self.useOSScaleRate,
61
- osFontScale: osFontScale
81
+ osFontScale: osFontScale,
82
+ windowShortSide: windowShortSide,
83
+ maxScaleRate: maxScaleRate ?? self.maxScaleRate
62
84
  )
63
85
  }
64
86
  }
@@ -77,9 +99,8 @@ public extension EnvironmentValues {
77
99
  }
78
100
 
79
101
  public extension View {
80
- /// Injects a Dynamic-Type-observing font scale plus `\.designSystemKitsConfigs` (whitelist, remote config)
81
- /// and re-renders this subtree on change.
82
- /// Use at every `UIHostingController` root that is not inside a `NavigationContainer`.
102
+ /// Injects a live font scale plus `\.designSystemKitsConfigs` (whitelist, remote config). Needed at every
103
+ /// `UIHostingController` root outside a `NavigationContainer`.
83
104
  func momoFontScale(_ store: DesignSystemKits = .shared, context: MiniAppContext? = nil) -> some View {
84
105
  modifier(MomoFontScaleModifier(store: store, context: context))
85
106
  }
@@ -97,10 +118,44 @@ private struct MomoFontScaleModifier: ViewModifier {
97
118
  \.momoFontScale,
98
119
  store.fontScale.overriding(
99
120
  userScaleRate: context?.userScaleRate,
100
- useOSScaleRate: context?.useOSScaleRate
121
+ useOSScaleRate: context?.useOSScaleRate,
122
+ maxScaleRate: context?.scaleSizeMaxRate
101
123
  )
102
124
  )
103
125
  .environment(\.designSystemKitsConfigs, store.getConfigs())
104
126
  }
105
127
  }
106
- // AI-GENERATED END: reactive font-scale snapshot injected through the environment
128
+
129
+ /// Compose's `ScaleSizeScope` (RN `ScaleSizeProvider`): caps the font scale of `content` at
130
+ /// size × `scaleSizeMaxRate`; the nearest scope wins and nil lifts the cap.
131
+ public struct ScaleSizeScope<Content: View>: View {
132
+ private let scaleSizeMaxRate: CGFloat?
133
+ private let content: Content
134
+
135
+ public init(scaleSizeMaxRate: CGFloat? = nil, @ViewBuilder content: () -> Content) {
136
+ self.scaleSizeMaxRate = scaleSizeMaxRate
137
+ self.content = content()
138
+ }
139
+
140
+ public var body: some View {
141
+ content.scaleSizeMaxRate(scaleSizeMaxRate)
142
+ }
143
+ }
144
+
145
+ public extension View {
146
+ /// Modifier form of `ScaleSizeScope`.
147
+ func scaleSizeMaxRate(_ rate: CGFloat?) -> some View {
148
+ modifier(ScaleSizeMaxRateModifier(rate: rate))
149
+ }
150
+ }
151
+
152
+ /// Derives from the injected snapshot, so it stays live under `.momoFontScale()`.
153
+ private struct ScaleSizeMaxRateModifier: ViewModifier {
154
+ let rate: CGFloat?
155
+
156
+ @Environment(\.momoFontScale) private var fontScale
157
+
158
+ func body(content: Content) -> some View {
159
+ content.environment(\.momoFontScale, fontScale.cappedAt(rate))
160
+ }
161
+ }
@@ -1,8 +1,7 @@
1
1
  import SwiftUI
2
2
 
3
- /// Non-reactive entry point, for call sites that cannot read the environment (UIKit bridges,
4
- /// free functions). Inside a SwiftUI view prefer `@Environment(\.momoFontScale)` so the view
5
- /// re-renders when Dynamic Type or the host preference changes.
3
+ /// Non-reactive, for call sites that can't read the environment (UIKit bridges, free functions). In a view use
4
+ /// `@Environment(\.momoFontScale)` so it re-renders when Dynamic Type or the host preference changes.
6
5
  public func scaleSize(_ size: CGFloat) -> CGFloat {
7
6
  DesignSystemKits.shared.fontScale(size)
8
7
  }
@@ -107,7 +106,7 @@ private enum MomoFontFace {
107
106
  /// Port of Compose `getFontFamily`; SF Pro Text is the iOS system font, so the legacy family is `.system`.
108
107
  private func momoFontFace(family: String, weight: Font.Weight, isWhiteList: Bool) -> MomoFontFace? {
109
108
  let isNewFamily = family == "MomoTrustSans" || family == headerFontFamily
110
- // Outside the whitelist the new DS families drop to the legacy font, as before DS-791.
109
+ // Outside the whitelist the DS-791 families fall back to the legacy font.
111
110
  if family == "SFProText" || (isNewFamily && !isWhiteList) { return .system }
112
111
  // single-file families (Compose maps every weight to the same .otf)
113
112
  if family == headerFontFamily || family == "MoMoSignature" { return .named(family) }
@@ -264,8 +263,6 @@ public struct MomoText: View {
264
263
  self.textAlign = textAlign
265
264
  self.maxLines = maxLines
266
265
  self.minLines = minLines
267
- // SwiftUI's range-based `lineLimit` is iOS 16+ only; keep the range for
268
- // newer OS versions and fall back to the legacy single-value overload.
269
266
  if maxLines == Int.max && minLines <= 1 {
270
267
  self.lineLimitRange = nil
271
268
  } else {
@@ -281,8 +278,8 @@ public struct MomoText: View {
281
278
  self.fontFamily = fontFamily
282
279
  }
283
280
 
284
- init(_ content: String, typography: TypographyStyle, highlightText: [String]) {
285
- self.init(content, typography: typography)
281
+ init(_ content: String, typography: TypographyStyle, accessibilityId: String? = nil, highlightText: [String]) {
282
+ self.init(content, typography: typography, accessibilityId: accessibilityId)
286
283
  self.highlightText = highlightText
287
284
  }
288
285
 
@@ -345,8 +342,6 @@ public struct MomoText: View {
345
342
 
346
343
  public var body: some View {
347
344
  let textColor = color ?? theme.colors.text.default
348
- // Strikethrough is driven either by the typography variant (mirrors Compose
349
- // *Strikethrough styles) or the explicit `strikethrough` flag.
350
345
  let isStrikethrough = strikethrough || typography.isStrikethrough
351
346
 
352
347
  // lineSpacing is added on top of the font's natural line height, not on top of fontSize.
@@ -379,8 +374,7 @@ public struct MomoText: View {
379
374
  }
380
375
  }
381
376
 
382
- // Applies a line-limit range only on iOS 16+. Older targets use the legacy
383
- // single-value overload so the file still compiles for iOS 15.
377
+ // Range-based `lineLimit` is iOS 16+; iOS 15 gets the upper bound only.
384
378
  private struct LineLimitModifier: ViewModifier {
385
379
  let range: ClosedRange<Int>?
386
380