@momo-kits/native-kits 0.300.7 → 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 (256) hide show
  1. package/CLAUDE.md +12 -8
  2. package/README.md +8 -7
  3. package/build.gradle.kts +13 -0
  4. package/compose/build.gradle.kts +195 -0
  5. package/compose/build.gradle.kts.backup +195 -0
  6. package/compose/compose.podspec +47 -0
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +19 -0
  8. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
  9. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +12 -0
  10. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +7 -0
  11. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +154 -0
  12. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReduceMotion.android.kt +17 -0
  13. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +6 -0
  14. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +110 -0
  15. package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +61 -0
  16. package/compose/src/commonMain/kotlin/vn/momo/kits/application/KitsBinding.kt +60 -0
  17. package/compose/src/commonMain/kotlin/vn/momo/kits/application/KitsHost.kt +32 -0
  18. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +1067 -0
  19. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +268 -0
  20. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +55 -0
  21. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +81 -0
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +338 -0
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +175 -0
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +354 -0
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +115 -0
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +89 -0
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +130 -0
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +209 -0
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +482 -0
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +49 -0
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +86 -0
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +125 -0
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +224 -0
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +137 -0
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +473 -0
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +113 -0
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +262 -0
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +237 -0
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +228 -0
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +280 -0
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +183 -0
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +342 -0
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +40 -0
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +82 -0
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +39 -0
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +362 -0
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +108 -0
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +304 -0
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +59 -0
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +21 -0
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +88 -0
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +308 -0
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +218 -0
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +456 -0
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +122 -0
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +205 -0
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +89 -0
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +542 -0
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +86 -0
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +175 -0
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +201 -0
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +498 -0
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +176 -0
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +182 -0
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +193 -0
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +208 -0
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +180 -0
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +325 -0
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +12 -0
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +194 -0
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +291 -0
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +54 -0
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/HeaderLayout.kt +71 -0
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +50 -0
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ModalLayout.kt +184 -0
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +315 -0
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +41 -0
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +54 -0
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +66 -0
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +104 -0
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +48 -0
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +397 -0
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +58 -0
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +153 -0
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +118 -0
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +212 -0
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +422 -0
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +750 -0
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +152 -0
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +35 -0
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +244 -0
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +398 -0
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +103 -0
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +93 -0
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +208 -0
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +133 -0
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +167 -0
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +446 -0
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +105 -0
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +106 -0
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +74 -0
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +387 -0
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +39 -0
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +363 -0
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HelpCenterRequest.kt +33 -0
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +197 -0
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +133 -0
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/ToolkitRequests.kt +38 -0
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +135 -0
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +12 -0
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +114 -0
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +7 -0
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +76 -0
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReduceMotion.kt +7 -0
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +21 -0
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
  128. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +55 -0
  129. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
  130. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +117 -0
  131. package/compose/src/commonTest/kotlin/vn/momo/kits/application/KitsHostTest.kt +44 -0
  132. package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/HelpCenterRequestTest.kt +39 -0
  133. package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/ToolkitRequestsTest.kt +53 -0
  134. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +42 -0
  135. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +45 -0
  136. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +31 -0
  137. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +38 -0
  138. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +65 -0
  139. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +217 -0
  140. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReduceMotion.ios.kt +48 -0
  141. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +143 -0
  142. package/gradle/libs.versions.toml +66 -0
  143. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  144. package/gradle/wrapper/gradle-wrapper.properties +8 -0
  145. package/gradle.properties +24 -0
  146. package/gradlew +252 -0
  147. package/gradlew.bat +94 -0
  148. package/ios/Application/ApplicationEnvironment.swift +6 -4
  149. package/ios/Application/DesignSystemKits.swift +59 -13
  150. package/ios/Application/DesignSystemKitsPayload.swift +0 -8
  151. package/ios/Application/LanguageSource.swift +2 -11
  152. package/ios/Application/Localize.swift +8 -35
  153. package/ios/Application/LocalizeModifier.swift +2 -11
  154. package/ios/Application/MaxApi.swift +3 -11
  155. package/ios/Avatar/Avatar.swift +0 -1
  156. package/ios/Badge/Badge.swift +5 -8
  157. package/ios/Badge/BadgeRibbon.swift +2 -5
  158. package/ios/Button/Button.swift +4 -8
  159. package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +5 -7
  160. package/ios/Carousel/Carousel.swift +4 -17
  161. package/ios/Checkbox/Checkbox.swift +0 -2
  162. package/ios/Collapse/Collapse.swift +17 -11
  163. package/ios/Colors+Radius+Spacing/Theme.swift +0 -7
  164. package/ios/DateTimePicker/DateTimePicker.swift +4 -10
  165. package/ios/DateTimePicker/DateTimePickerTypes.swift +1 -3
  166. package/ios/DateTimePicker/DateTimePickerUtils.swift +0 -3
  167. package/ios/DateTimePicker/WheelPicker.swift +2 -4
  168. package/ios/Extensions/ActiveOpacityButtonStyle.swift +2 -3
  169. package/ios/Extensions/Color++.swift +2 -4
  170. package/ios/Extensions/SkeletonUICompat.swift +0 -8
  171. package/ios/Icon/Icon.swift +3 -6
  172. package/ios/IconButton/IconButton.swift +2 -5
  173. package/ios/Input/ErrorView.swift +0 -7
  174. package/ios/Input/Input.swift +9 -20
  175. package/ios/Input/InputPhoneNumber.swift +37 -20
  176. package/ios/Input/InputSearch.swift +23 -12
  177. package/ios/Input/InputTextArea.swift +4 -13
  178. package/ios/InputDropDown/InputDropDown.swift +1 -11
  179. package/ios/InputMoney/InputMoney.swift +9 -28
  180. package/ios/InputOTP/InputOTP.swift +2 -9
  181. package/ios/Layout/HeaderLayout.swift +72 -0
  182. package/ios/Layout/Item.swift +1 -2
  183. package/ios/Layout/ModalLayout.swift +144 -0
  184. package/ios/Layout/ScreenLayout.swift +48 -31
  185. package/ios/Layout/Section.swift +2 -3
  186. package/ios/Loader/Loader.swift +3 -12
  187. package/ios/Lottie/LottieView.swift +0 -11
  188. package/ios/Navigation/BottomSheet.swift +73 -94
  189. package/ios/Navigation/BottomTab/BottomTab.swift +58 -73
  190. package/ios/Navigation/BottomTab/BottomTabBar.swift +286 -121
  191. package/ios/Navigation/BottomTab/CurvedContainer.swift +52 -54
  192. package/ios/Navigation/BottomTab/DuoBarCompression.swift +5 -12
  193. package/ios/Navigation/BottomTab/DuoTabBar.swift +67 -202
  194. package/ios/Navigation/BottomTab/TabBarMetrics.swift +97 -0
  195. package/ios/Navigation/Component/FloatingButton.swift +4 -11
  196. package/ios/Navigation/Component/Header.swift +35 -54
  197. package/ios/Navigation/Component/HeaderBackground.swift +2 -8
  198. package/ios/Navigation/Component/HeaderJourney.swift +4 -8
  199. package/ios/Navigation/Component/HeaderLocation.swift +4 -8
  200. package/ios/Navigation/Component/HeaderRight.swift +20 -22
  201. package/ios/Navigation/Component/HeaderTitle.swift +1 -6
  202. package/ios/Navigation/Component/HeaderUser.swift +4 -10
  203. package/ios/Navigation/Component/SideBar.swift +6 -21
  204. package/ios/Navigation/Component/SnackBar.swift +9 -13
  205. package/ios/Navigation/HostBackGestureBridge.swift +2 -9
  206. package/ios/Navigation/ModalScreen.swift +24 -13
  207. package/ios/Navigation/Navigation.swift +35 -19
  208. package/ios/Navigation/NavigationContainer.swift +4 -15
  209. package/ios/Navigation/Navigator.swift +21 -39
  210. package/ios/Navigation/StackScreen.swift +64 -51
  211. package/ios/Navigation/StackTransition.swift +7 -14
  212. package/ios/Navigation/SwipeBackHaptic.swift +2 -7
  213. package/ios/Navigation/Tracking/ScreenTracker.swift +2 -7
  214. package/ios/Pagination/PaginationDot.swift +0 -9
  215. package/ios/Pagination/PaginationNumber.swift +1 -9
  216. package/ios/Pagination/PaginationScroll.swift +2 -14
  217. package/ios/Pagination/PaginationWhiteDot.swift +1 -10
  218. package/ios/Popup/PopupDisplay.swift +7 -5
  219. package/ios/Popup/PopupInput.swift +6 -4
  220. package/ios/Popup/PopupLayout.swift +17 -9
  221. package/ios/Popup/PopupNotify.swift +32 -25
  222. package/ios/PopupView/FullscreenPopup.swift +3 -4
  223. package/ios/PopupView/PopupView.swift +2 -2
  224. package/ios/PopupView/Utils++.swift +1 -2
  225. package/ios/ProgressInfo/ProgressInfo.swift +2 -13
  226. package/ios/Skeleton/Skeleton.swift +5 -16
  227. package/ios/Slider/Slider.swift +5 -12
  228. package/ios/StatusBarTap/StatusBarTap.h +2 -3
  229. package/ios/StatusBarTap/StatusBarTap.m +3 -16
  230. package/ios/Stepper/Stepper.swift +8 -27
  231. package/ios/Steps/Steps.swift +29 -26
  232. package/ios/Swipeable/SwipeCell.swift +2 -2
  233. package/ios/Swipeable/SwipeCellModel.swift +3 -6
  234. package/ios/TabView/TabView.swift +14 -28
  235. package/ios/Template/TrustBanner/TrustBanner.swift +2 -9
  236. package/ios/Title/Title.swift +1 -3
  237. package/ios/Tooltip/Tooltip.swift +4 -9
  238. package/ios/Typography/FontScale.swift +79 -24
  239. package/ios/Typography/Text.swift +6 -12
  240. package/ios/Typography/Typography.swift +8 -11
  241. package/ios/Uploader/Uploader.swift +2 -17
  242. package/ios-demo/README.md +120 -0
  243. package/ios-demo/Resources/tabbar_scan_qr_button.json +1 -0
  244. package/ios-demo/Resources/tabbar_scan_qr_label.json +1 -0
  245. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +11 -2
  246. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +296 -59
  247. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +15 -4
  248. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LocalizeDemo.swift +0 -8
  249. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +114 -0
  250. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +29 -1
  251. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +16 -0
  252. package/package.json +1 -1
  253. package/publish.sh +8 -2
  254. package/scripts/ci/build-swiftui.sh +22 -0
  255. package/scripts/ci/resolve-version.mjs +144 -0
  256. package/settings.gradle.kts +63 -0
@@ -1,10 +1,3 @@
1
- // File: ios/Application/LocalizeModifier.swift
2
- // Created At: 2026-07-29 10:00:00 +07:00
3
- // Created By: AI
4
- // AI Agent: Claude Code
5
- // Model: claude-opus-5[1m]
6
-
7
- // AI-GENERATED START: inject a language-observing Localize into any SwiftUI subtree
8
1
  import SwiftUI
9
2
 
10
3
  public extension View {
@@ -15,9 +8,8 @@ public extension View {
15
8
  }
16
9
  }
17
10
 
18
- /// `@ObservedObject` is load-bearing: `@Environment(\.localize)` only invalidates when the boxed
19
- /// value changes, which requires *this* body to re-run on every publish. A plain helper that just
20
- /// set `\.localize` would inject a snapshot that never updates.
11
+ /// `@ObservedObject` is load-bearing: `@Environment(\.localize)` invalidates only when *this* body re-runs on a
12
+ /// publish; a helper that just set `\.localize` would inject a snapshot that never updates.
21
13
  private struct MomoLocalizeModifier: ViewModifier {
22
14
  @ObservedObject var localize: Localize
23
15
 
@@ -27,4 +19,3 @@ private struct MomoLocalizeModifier: ViewModifier {
27
19
  .environment(\.localize, localize)
28
20
  }
29
21
  }
30
- // AI-GENERATED END: inject a language-observing Localize into any SwiftUI subtree
@@ -1,13 +1,5 @@
1
- //
2
- // MaxApi.swift
3
- // MoMoUIKits
4
- //
5
- // Swift mirror of the host-app bridge exposed on Kotlin as `vn.momo.maxapi.IMaxApi`
6
- // (`LocalMaxApi`). `IMaxApi` itself is an external compiled dependency with no
7
- // source in this repo, so this protocol intentionally exposes only the methods
8
- // this kit's Kotlin source actually calls — not a full guess at IMaxApi's real surface.
9
- // Callbacks carry IMaxApi's `["response": …]` payload.
10
- //
1
+ // Swift mirror of the host bridge `vn.momo.maxapi.IMaxApi` (`LocalMaxApi`). IMaxApi is an external
2
+ // binary, so only the methods the kit calls are declared; callbacks carry its `["response": …]` payload.
11
3
 
12
4
  import UIKit
13
5
 
@@ -32,7 +24,7 @@ public extension MaxApi {
32
24
  UIImpactFeedbackGenerator(style: .light).impactOccurred()
33
25
  }
34
26
 
35
- // Hosts that don't bridge the toolkit keep it inert, as before these joined the protocol.
27
+ // Hosts that don't bridge the toolkit keep it inert.
36
28
  func isFavoriteApp(_ params: [String: Any?], callback: @escaping ([String: Any?]?) -> Void) {}
37
29
  func onToolAction(_ params: [String: Any?], callback: @escaping ([String: Any?]?) -> Void) {}
38
30
  func showTools(_ params: [String: Any?], callback: @escaping ([String: Any?]?) -> Void) {}
@@ -65,7 +65,6 @@ public struct Avatar: View {
65
65
 
66
66
  public var body: some View {
67
67
  ZStack {
68
- // Inner content clipped by shape with border
69
68
  ZStack {
70
69
  content
71
70
  }
@@ -41,17 +41,14 @@ public struct Badge: View {
41
41
  }
42
42
 
43
43
  private var badgeColor: Color {
44
- // Default colors based on label type
45
- let defaultColor: Color = isNumber(label)
46
- ? theme.colors.error.primary
47
- : theme.colors.warning.primary
48
-
49
- // Mirror Compose: only apply backgroundColor when it is one of the
50
- // allowed primaryColors; otherwise fall back to the label-based default.
44
+ // Mirrors Compose: backgroundColor applies only when it is one of primaryColors.
51
45
  if let bgColor = backgroundColor, primaryColors.contains(bgColor) {
52
46
  return bgColor
53
47
  }
54
- return defaultColor
48
+ if isNumber(label) {
49
+ return theme.colors.error.primary
50
+ }
51
+ return theme.colors.warning.primary
55
52
  }
56
53
 
57
54
  public var body: some View {
@@ -198,10 +198,8 @@ public struct BadgeRibbon: View {
198
198
  }
199
199
  }
200
200
 
201
- /// Ported from Compose's `RoundedBadgeRibbon` (BadgeRibbon.kt:164-326): a canvas-drawn
202
- /// ribbon shape sized to its text, mirrored per corner via scaleX/scaleY (never an actual
203
- /// rotation) — the label gets the same scale applied a second time so it stays right-reading
204
- /// while only the ribbon shape flips.
201
+ /// Compose's `RoundedBadgeRibbon`: a ribbon sized to its text, mirrored per corner with
202
+ /// scaleX/scaleY (never rotated); the label is scaled again so only the shape flips.
205
203
  public struct RoundedBadgeRibbon: View {
206
204
  @Environment(\.appTheme) private var theme
207
205
  @Environment(\.momoFontScale) private var fontScale
@@ -312,7 +310,6 @@ extension String {
312
310
  struct BadgeRibbon_Previews: PreviewProvider {
313
311
  static var previews: some View {
314
312
  VStack(spacing: 30) {
315
- // Basic ribbon examples
316
313
  BadgeRibbon(position: .topRight, label: "New")
317
314
  BadgeRibbon(position: .topLeft, label: "Hot", isRound: true)
318
315
  BadgeRibbon(position: .bottomLeft, label: "Sale")
@@ -229,9 +229,8 @@ public struct Button: View {
229
229
  }
230
230
  }
231
231
 
232
- /// Mirrors Compose's press feedback: the background shrinks via an animated
233
- /// horizontal inset and the whole button (background included) fades to 0.5,
234
- /// matching `animatedPadding`/`alpha` in Button.kt.
232
+ /// Compose's press feedback (`animatedPadding` / `alpha` in Button.kt): the background shrinks by an animated
233
+ /// horizontal inset and the whole button fades to 0.5.
235
234
  private struct ButtonPressFeedbackStyle: ButtonStyle {
236
235
  let isEnabled: Bool
237
236
  let background: Color
@@ -264,11 +263,8 @@ private struct ButtonPressFeedbackStyle: ButtonStyle {
264
263
  }
265
264
  }
266
265
 
267
- /// `ButtonStyleConfiguration.Label` is greedy on iOS 16 and earlier — it accepts
268
- /// the full proposed width, so the background drawn in `makeBody` stretches past
269
- /// the content even when `isFull == false`. iOS 17 fixed the label to hug its
270
- /// content, so only legacy OSes need the `fixedSize` clamp (kept off on 17+ to
271
- /// preserve tail truncation of long titles).
266
+ /// The style label takes the full proposed width before iOS 17, stretching the background
267
+ /// past the content; `fixedSize` there only, as on 17+ it would stop long titles truncating.
272
268
  private struct HugContentOnLegacyOS: ViewModifier {
273
269
  let isFull: Bool
274
270
 
@@ -52,8 +52,8 @@ public struct CalculatorKeyboard: View {
52
52
  }
53
53
  }
54
54
 
55
- /// Integer `+ - * /` with the usual precedence, as NSExpression did, but nil instead of a
56
- /// crash when a number or result leaves `Int` range.
55
+ /// Integer `+ - * /` with the usual precedence. Not NSExpression: it crashes when a number or
56
+ /// result leaves `Int` range, where this returns nil.
57
57
  static func evaluate(_ expression: String) -> Int? {
58
58
  var numbers: [Int] = []
59
59
  var operators: [Character] = []
@@ -92,11 +92,9 @@ public struct CalculatorKeyboard: View {
92
92
 
93
93
  var result = terms[0]
94
94
  for (sign, term) in zip(signs, terms.dropFirst()) {
95
- let (next, overflow) = sign == "+"
96
- ? result.addingReportingOverflow(term)
97
- : result.subtractingReportingOverflow(term)
98
- if overflow { return nil }
99
- result = next
95
+ let step = sign == "+" ? result.addingReportingOverflow(term) : result.subtractingReportingOverflow(term)
96
+ if step.overflow { return nil }
97
+ result = step.partialValue
100
98
  }
101
99
  return result
102
100
  }
@@ -1,17 +1,7 @@
1
1
  import SwiftUI
2
2
 
3
- /// Native SwiftUI port of the Compose `Carousel` component.
4
- ///
5
- /// Mirrors the Compose API: a paging horizontal carousel driven by an
6
- /// `itemCount` and a `content` builder that receives the real (modulo) index.
7
- /// Supports infinite `loop`, `autoplay` with a configurable interval,
8
- /// inactive-slide `opacity`/`scale` effects, optional `contentPadding`,
9
- /// snap behavior, and scroll enable/disable. Snap / scroll-index callbacks
10
- /// report the real item index.
11
- ///
12
- /// Uses a custom drag-driven pager (not a ScrollView) so behavior is identical
13
- /// across versions and supports the loop virtualization + transform effects
14
- /// that `TabView(.page)` cannot express.
3
+ /// Compose `Carousel`; `content` and the snap / scroll-index callbacks get the real (modulo) index. A drag-driven
4
+ /// pager, as ScrollView and `TabView(.page)` can't express the loop virtualization or inactive-slide effects.
15
5
  public struct Carousel<Content: View>: View {
16
6
  // MARK: Lifecycle
17
7
 
@@ -93,11 +83,8 @@ public struct Carousel<Content: View>: View {
93
83
  // Offset so the current page is centered within the viewport padding.
94
84
  let baseOffset = -CGFloat(currentPage) * step + contentPadding
95
85
 
96
- // Windows the rendered range around `currentPage` instead of instantiating all
97
- // `virtualPageCount` slides up front — with `loop=true`, that's `itemCount * 1000`
98
- // eager views, a real memory/perf regression versus Compose's lazy `HorizontalPager`.
99
- // Clear spacers of the skipped width keep the HStack's total layout size (and thus
100
- // the existing `baseOffset` math) unchanged.
86
+ // Only a window around `currentPage` renders (`loop` means `itemCount * 1000` slides; Compose's
87
+ // pager is lazy); clear spacers of the skipped width keep the HStack size for `baseOffset`.
101
88
  let windowRadius = 3
102
89
  let windowStart = max(0, currentPage - windowRadius)
103
90
  let windowEnd = min(virtualPageCount - 1, currentPage + windowRadius)
@@ -29,7 +29,6 @@ public struct Checkbox: View{
29
29
 
30
30
  public var body: some View {
31
31
  HStack(spacing: Spacing.S) {
32
- // Checkbox
33
32
  SwiftUI.Button(action: onCheck) {
34
33
  ZStack {
35
34
  RoundedRectangle(cornerRadius: Radius.XS)
@@ -50,7 +49,6 @@ public struct Checkbox: View{
50
49
  .buttonStyle(ActiveOpacityButtonStyle(activeOpacity: 0.8))
51
50
  .disabled(disabled)
52
51
 
53
- // Title
54
52
  if !title.isEmpty {
55
53
  MomoText(title, typography: .descriptionDefaultRegular)
56
54
  }
@@ -94,11 +94,7 @@ public struct Collapse<Content: View>: View {
94
94
  content()
95
95
  }
96
96
  .frame(maxWidth: .infinity)
97
- .overlay(
98
- showBorder
99
- ? Rectangle().strokeBorder(theme.colors.border.default, lineWidth: 1)
100
- : nil
101
- )
97
+ .overlay(contentBorder)
102
98
  .transition(.move(edge: .top))
103
99
  }
104
100
  }
@@ -108,17 +104,27 @@ public struct Collapse<Content: View>: View {
108
104
  .frame(maxWidth: .infinity)
109
105
  .background(resolvedBackgroundColor)
110
106
  .clipShape(RoundedRectangle(cornerRadius: Radius.S, style: .continuous))
111
- .overlay(
112
- showBorder
113
- ? RoundedRectangle(cornerRadius: Radius.S, style: .continuous)
114
- .strokeBorder(theme.colors.border.default, lineWidth: 1)
115
- : nil
116
- )
107
+ .overlay(containerBorder)
117
108
  // `.contain` keeps the children's own identifiers instead of overriding them.
118
109
  .accessibilityElement(children: .contain)
119
110
  .accessibilityIdentifier(automationId)
120
111
  }
121
112
 
113
+ @ViewBuilder
114
+ private var contentBorder: some View {
115
+ if showBorder {
116
+ Rectangle().strokeBorder(theme.colors.border.default, lineWidth: 1)
117
+ }
118
+ }
119
+
120
+ @ViewBuilder
121
+ private var containerBorder: some View {
122
+ if showBorder {
123
+ RoundedRectangle(cornerRadius: Radius.S, style: .continuous)
124
+ .strokeBorder(theme.colors.border.default, lineWidth: 1)
125
+ }
126
+ }
127
+
122
128
  private var header: some View {
123
129
  SwiftUI.Button(action: {
124
130
  onPress?(expanded)
@@ -1,10 +1,3 @@
1
- //
2
- // Theme.swift
3
- // MoMoUIKits
4
- //
5
- // Created by sophia on 25/2/26.
6
- //
7
-
8
1
  import Foundation
9
2
  import SwiftUI
10
3
 
@@ -7,12 +7,8 @@ private let datePickerWithLabelsHeight: CGFloat = 238
7
7
 
8
8
  // MARK: - DateTimePicker
9
9
 
10
- /// A wheel-style date/time picker matching Compose `DateTimePicker`.
11
- ///
12
- /// The `format` string drives which columns are shown:
13
- /// - `DD` day, `MM` month, `YYYY` year, `HH` hour, `mm` minute.
14
- /// - `"HH:mm"` shows hour + minute; a lone `"HH"` switches the hour wheel to a
15
- /// 12-hour clock with an AM/PM column.
10
+ /// Wheel date/time picker matching Compose `DateTimePicker`. `format` picks the columns (`DD`, `MM`,
11
+ /// `YYYY`, `HH`, `mm`); a lone `"HH"` switches the hour wheel to a 12-hour clock with an AM/PM column.
16
12
  public struct DateTimePicker: View {
17
13
  @Environment(\.appTheme) private var theme
18
14
 
@@ -39,7 +35,6 @@ public struct DateTimePicker: View {
39
35
  let effectiveMin = minDate ?? DateTimePickerUtils.createRelativeDate(years: -10)
40
36
  let effectiveMax = maxDate ?? DateTimePickerUtils.createRelativeDate(years: 10)
41
37
 
42
- // needCheckRange is true only when the caller supplied no bounds.
43
38
  let needCheckRange = (minDate == nil && maxDate == nil)
44
39
 
45
40
  self._currentData = State(initialValue: Self.pickerData(
@@ -222,9 +217,8 @@ public struct DateTimePicker: View {
222
217
  emitIfValid()
223
218
  }
224
219
 
225
- /// Emit `onChange` only when the assembled date is valid and (when bounds were
226
- /// not supplied) within the effective min/max range. Mirrors the Compose
227
- /// `snapshotFlow.mapNotNull` filter.
220
+ /// Emits `onChange` only for a valid date, range-checked only when no bounds were supplied
221
+ /// (Compose's `snapshotFlow.mapNotNull` filter).
228
222
  private func emitIfValid() {
229
223
  guard let date = currentData.toDate() else { return }
230
224
  if !needCheckRange {
@@ -2,8 +2,7 @@ import Foundation
2
2
 
3
3
  // MARK: - PickerData
4
4
 
5
- /// Internal mutable representation of the picker's current selection.
6
- /// Mirrors Compose `PickerData`.
5
+ /// The picker's current selection (Compose `PickerData`).
7
6
  public struct DateTimePickerData: Equatable {
8
7
  public var day: Int
9
8
  public var month: Int
@@ -28,7 +27,6 @@ public struct DateTimePickerData: Equatable {
28
27
  self.timeMode = timeMode
29
28
  }
30
29
 
31
- /// Convert to a `DateComponents` based value. Returns `nil` if the date is invalid.
32
30
  public func toDate(calendar: Calendar = Calendar.current) -> Date? {
33
31
  var components = DateComponents()
34
32
  components.year = year
@@ -38,7 +38,6 @@ public enum DateTimePickerUtils {
38
38
  }
39
39
  }
40
40
 
41
- /// Number of days in a given month/year.
42
41
  private static func daysInMonth(year: Int, month: Int) -> Int {
43
42
  switch month {
44
43
  case 1, 3, 5, 7, 8, 10, 12: return 31
@@ -90,7 +89,6 @@ public enum DateTimePickerUtils {
90
89
  return (startMonth...endMonth).map { paddingNum($0) }
91
90
  }
92
91
 
93
- /// Get a list of year strings between min and max date.
94
92
  public static func getYears(minDate: DateComponents, maxDate: DateComponents) -> [String] {
95
93
  let startYear = minDate.year ?? 0
96
94
  let endYear = maxDate.year ?? 0
@@ -120,7 +118,6 @@ public enum DateTimePickerUtils {
120
118
  return minutes
121
119
  }
122
120
 
123
- /// Today's date.
124
121
  public static func getCurrentDateTime() -> Date {
125
122
  return Date()
126
123
  }
@@ -8,10 +8,8 @@ private let wheelPickerBorderWidth: CGFloat = 1
8
8
 
9
9
  // MARK: - WheelPicker
10
10
 
11
- /// A reusable single-column wheel picker, mirroring Compose `WheelPicker.kt`.
12
- ///
13
- /// Five rows tall with the selection in the middle row. A drag always settles on a row
14
- /// (Compose snaps once the scroll stops) and then reports it via `onChange(name, value)`.
11
+ /// Single-column wheel (Compose `WheelPicker.kt`), five rows tall with the selection in the middle.
12
+ /// A drag always settles on a row (Compose snaps once the scroll stops), then reports it via `onChange`.
15
13
  public struct WheelPicker: View {
16
14
  @Environment(\.appTheme) private var theme
17
15
 
@@ -1,8 +1,7 @@
1
1
  import SwiftUI
2
2
 
3
- /// Mirrors Compose's `Modifier.activeOpacityClickable(activeOpacity:)` (modifier/Clickable.kt):
4
- /// fades the whole tappable subtree to `activeOpacity` while pressed, animated, instead of
5
- /// relying on a platform-default press indication.
3
+ /// Compose's `Modifier.activeOpacityClickable(activeOpacity:)`: the whole tappable subtree fades to `activeOpacity`
4
+ /// while pressed, instead of a platform-default press indication.
6
5
  struct ActiveOpacityButtonStyle: ButtonStyle {
7
6
  var activeOpacity: Double = 0.2
8
7
 
@@ -4,16 +4,14 @@ import Foundation
4
4
  private final class MoMoUIKitsBundleToken {}
5
5
 
6
6
  enum MoMoUIKitsResources {
7
+
7
8
  static let bundle: Bundle = {
8
9
  let bundleName = "MoMoUIKitsResources"
9
10
  let tokenBundle = Bundle(for: MoMoUIKitsBundleToken.self)
10
- let frameworkBundle = Bundle(identifier: "org.cocoapods.MoMoUIKits")
11
11
  let candidates = [
12
12
  Bundle.main.resourceURL,
13
13
  tokenBundle.resourceURL,
14
- tokenBundle.bundleURL,
15
- frameworkBundle?.resourceURL,
16
- frameworkBundle?.bundleURL
14
+ tokenBundle.bundleURL
17
15
  ]
18
16
 
19
17
  for candidate in candidates {
@@ -1,11 +1,3 @@
1
- // File: ios/Extensions/SkeletonUICompat.swift
2
- // Created At: 2026-10-07 12:03:28 +07:00
3
- // Created By: AI
4
- // AI Agent: Claude Code
5
- // Model: claude-opus-5-5
6
-
7
- // AI-GENERATED START: keep SkeletonUI extensions visible to MoMoUIKits clients
8
1
  // Unused here on purpose: Swift 5 exposes extension members of every module a dependency imports, so clients
9
2
  // that only `import MoMoUIKits` rely on SkeletonUI's (e.g. `Text(String?)` in NativeWidget). Removing it breaks them.
10
3
  import SkeletonUI
11
- // AI-GENERATED END: keep SkeletonUI extensions visible to MoMoUIKits clients
@@ -16,12 +16,10 @@ let iconSources: [String: String] = {
16
16
  return kitIcons.merging(hostIcons.mapValues(\.uri)) { kit, _ in kit }
17
17
  }()
18
18
 
19
- // Compose defaults `color` to the theme text color while `color = null` means "no tint".
20
- // Swift can't tell an omitted argument from an explicit `nil`, so the default is this
21
- // unrepresentable sentinel: omitted -> theme text color, `nil` -> untinted.
19
+ // Compose defaults `color` to the theme text color, `null` meaning no tint. Swift can't tell an omitted argument
20
+ // from `nil`, so the default is this unrepresentable sentinel: omitted -> theme text color, `nil` -> untinted.
22
21
  public let iconThemeColor = Color(.sRGB, red: -1, green: -1, blue: -1, opacity: -1)
23
22
 
24
- // Icon ViewModel
25
23
  public struct Icon: View {
26
24
  @Environment(\.appTheme) private var theme
27
25
 
@@ -55,8 +53,7 @@ public struct Icon: View {
55
53
  .scaledToFit()
56
54
  .foregroundColor(resolvedColor)
57
55
  .frame(width: size, height: size)
58
- // Mirrors Compose's auto-generated `contentDescription = "img|$iconUrl"`
59
- // when no explicit label is provided.
56
+ // Compose's auto-generated `contentDescription = "img|$iconUrl"` when no label is given.
60
57
  .accessibilityLabel(accessibilityLabel ?? "img|\(uri)")
61
58
  } else {
62
59
  // Compose keeps the sized box for an unknown key, so layouts don't collapse.
@@ -8,7 +8,6 @@ public enum IconSize {
8
8
  case medium
9
9
  case small
10
10
 
11
- /// Container width/height of the button.
12
11
  var containerSize: CGFloat {
13
12
  switch self {
14
13
  case .large: return 48
@@ -17,7 +16,6 @@ public enum IconSize {
17
16
  }
18
17
  }
19
18
 
20
- /// Glyph size of the icon inside the button.
21
19
  var iconSize: CGFloat {
22
20
  switch self {
23
21
  case .large: return 24
@@ -120,9 +118,8 @@ public struct IconButton: View {
120
118
  }
121
119
  }
122
120
 
123
- /// Type-erased shape switch (`Circle` vs a fixed `Radius.S` rounded rect) — mirrors
124
- /// Compose's `IconShape.toShape()`. `AnyShape` needs iOS 17+, so this hand-rolls the same
125
- /// erasure at the deployment target's iOS 15 floor.
121
+ /// Compose's `IconShape.toShape()` (`Circle` or a `Radius.S` rounded rect), type-erased by hand: `AnyShape` needs
122
+ /// iOS 17+ and the pod supports iOS 15.
126
123
  private struct IconButtonShape: InsettableShape {
127
124
  let shape: IconShape
128
125
  var insetAmount: CGFloat = 0
@@ -1,10 +1,3 @@
1
- //
2
- // ErrorView.swift
3
- // Pods
4
- //
5
- // Created by sophia on 13/1/26.
6
- //
7
-
8
1
  import SwiftUI
9
2
 
10
3
  public struct ErrorView: View {
@@ -101,10 +101,8 @@ public struct Input: View {
101
101
  let textBinding = Binding<String>(
102
102
  get: { self.text },
103
103
  set: { newValue in
104
- // Trim atomically before publishing, mirroring Kotlin's `onValueChange`
105
- // (`newText.take(maxLength)` before the state ever updates) — avoids a
106
- // render with the untrimmed value that a separate `.onChange` correction
107
- // would otherwise briefly show.
104
+ // Trimmed before publishing, like Compose's `newText.take(maxLength)`: an `.onChange`
105
+ // correction would briefly render the untrimmed value.
108
106
  let limited = limitText(newValue)
109
107
  self.text = limited
110
108
  self.onChangeText?(limited)
@@ -112,15 +110,12 @@ public struct Input: View {
112
110
  )
113
111
 
114
112
  VStack(alignment: .leading, spacing: 0) {
115
- // Input container
116
113
  HStack(alignment: .center, spacing: 0) {
117
- // Leading icon
118
114
  if !leadingIcon.isEmpty {
119
115
  Icon(source: leadingIcon, size: size == .small ? 24 : 32, color: leadingIconColor ?? theme.colors.text.hint)
120
116
  .padding(.trailing, Spacing.M)
121
117
  }
122
118
 
123
- // Text input field
124
119
  ZStack(alignment: .leading) {
125
120
  if text.isEmpty {
126
121
  MomoText(
@@ -162,16 +157,12 @@ public struct Input: View {
162
157
  .onAppear {
163
158
  if autofocus { isFieldFocused = true }
164
159
  }
165
- // SwiftUI reads a TextField's UIKit input traits only when it
166
- // builds the backing UITextField, so a later `keyboardType`
167
- // change is silently dropped. The secure path can call
168
- // `reloadInputViews()` in `updateUIView`; here the only lever
169
- // is to force a rebuild.
160
+ // SwiftUI reads UIKit input traits only when it builds the UITextField, so a later
161
+ // `keyboardType` change is dropped; force a rebuild.
170
162
  .id(keyboardType.rawValue)
171
163
  }
172
164
  }
173
165
 
174
- // Clear button (only show when focused and has text)
175
166
  if isFocused && !text.isEmpty {
176
167
  SwiftUI.Button(action: {
177
168
  text = ""
@@ -183,7 +174,6 @@ public struct Input: View {
183
174
  .accessibilityIdentifier("ic_clear")
184
175
  }
185
176
 
186
- // Loading indicator
187
177
  if loading {
188
178
  ActivityIndicator(isAnimating: .constant(true), style: .medium, color: getRightIconColor())
189
179
  .frame(width: 16, height: 16)
@@ -220,7 +210,6 @@ public struct Input: View {
220
210
  )
221
211
  .overlay(alignment: .topLeading) { floatingLabel }
222
212
 
223
- // Error or hint
224
213
  ErrorView(
225
214
  errorMessage: error,
226
215
  errorSpacing: errorSpacing,
@@ -252,7 +241,9 @@ public struct Input: View {
252
241
  }
253
242
  .padding(.horizontal, Spacing.S)
254
243
  .background(theme.colors.background.surface)
255
- .alignmentGuide(.top) { $0[VerticalAlignment.center] }
244
+ // A zero-height frame on the top edge centers the label on the border, re-laid out with font scale.
245
+ .fixedSize(horizontal: false, vertical: true)
246
+ .frame(height: 0)
256
247
  .offset(x: Spacing.S)
257
248
  }
258
249
  }
@@ -407,10 +398,8 @@ private struct SecureInputField: UIViewRepresentable {
407
398
  self.parent = parent
408
399
  }
409
400
 
410
- // When a secure text field regains focus (or turns secure while editing),
411
- // iOS marks the existing text as "committed" and the next keystroke would
412
- // replace ALL of it. Re-inserting via insertText() puts it back into an
413
- // "active editing" state (and moves the caret to the end).
401
+ // A secure field regaining focus (or turning secure mid-edit) marks its text committed, so
402
+ // the next keystroke would replace all of it; re-inserting resumes editing, caret at the end.
414
403
  func reinsertText(in textField: UITextField) {
415
404
  let existingText = textField.text ?? ""
416
405
  guard !existingText.isEmpty else { return }