@momo-kits/native-kits 0.300.3 → 0.300.4-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 (272) hide show
  1. package/CLAUDE.md +51 -7
  2. package/README.md +2 -2
  3. package/build.gradle.kts +13 -0
  4. package/compose/build.gradle.kts +197 -0
  5. package/compose/build.gradle.kts.backup +197 -0
  6. package/compose/compose.podspec +47 -0
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +20 -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 +153 -0
  12. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +6 -0
  13. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +110 -0
  14. package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +62 -0
  15. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +1071 -0
  16. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +269 -0
  17. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +65 -0
  18. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
  19. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +81 -0
  20. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
  21. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +338 -0
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +175 -0
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +357 -0
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +115 -0
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +89 -0
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +128 -0
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +209 -0
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +542 -0
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +49 -0
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +86 -0
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +125 -0
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +231 -0
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +189 -0
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +478 -0
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +114 -0
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +265 -0
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +235 -0
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +223 -0
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +265 -0
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +185 -0
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +343 -0
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +41 -0
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +84 -0
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +40 -0
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +361 -0
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +108 -0
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +308 -0
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +59 -0
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +21 -0
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +90 -0
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +330 -0
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +220 -0
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +473 -0
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +122 -0
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +207 -0
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +92 -0
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +560 -0
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +86 -0
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +125 -0
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +207 -0
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +501 -0
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +176 -0
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +182 -0
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +193 -0
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +236 -0
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +180 -0
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +325 -0
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +17 -0
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +194 -0
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +287 -0
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +54 -0
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +50 -0
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +306 -0
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +41 -0
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +52 -0
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +66 -0
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +104 -0
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +48 -0
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +338 -0
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +58 -0
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +137 -0
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +116 -0
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +215 -0
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +404 -0
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +732 -0
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +148 -0
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +40 -0
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +233 -0
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +217 -0
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +86 -0
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +97 -0
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +377 -0
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +169 -0
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +455 -0
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +103 -0
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +106 -0
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +74 -0
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +413 -0
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +39 -0
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +363 -0
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HelpCenterRequest.kt +37 -0
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +192 -0
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +133 -0
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/ToolkitRequests.kt +41 -0
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +135 -0
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +12 -0
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +91 -0
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +9 -0
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +74 -0
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +20 -0
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +55 -0
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +118 -0
  124. package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/HelpCenterRequestTest.kt +44 -0
  125. package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/ToolkitRequestsTest.kt +62 -0
  126. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +42 -0
  127. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +45 -0
  128. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +36 -0
  129. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +38 -0
  130. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +66 -0
  131. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +217 -0
  132. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +138 -0
  133. package/gradle/libs.versions.toml +68 -0
  134. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  135. package/gradle/wrapper/gradle-wrapper.properties +8 -0
  136. package/gradle.properties +26 -0
  137. package/gradlew +252 -0
  138. package/gradlew.bat +94 -0
  139. package/ios/Application/ApplicationEnvironment.swift +24 -6
  140. package/ios/Application/DesignSystemKits.swift +100 -0
  141. package/ios/Application/DesignSystemKitsPayload.swift +68 -0
  142. package/ios/Application/MaxApi.swift +30 -3
  143. package/ios/Avatar/Avatar.swift +4 -3
  144. package/ios/Badge/Badge.swift +6 -4
  145. package/ios/Badge/BadgeDot.swift +1 -1
  146. package/ios/Badge/BadgeRibbon.swift +8 -2
  147. package/ios/Button/Button.swift +15 -12
  148. package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +64 -18
  149. package/ios/Carousel/Carousel.swift +29 -12
  150. package/ios/Checkbox/Checkbox.swift +7 -3
  151. package/ios/Chip/Chip.swift +5 -4
  152. package/ios/Collapse/Collapse.swift +70 -19
  153. package/ios/Colors+Radius+Spacing/Colors.swift +10 -1
  154. package/ios/Colors+Radius+Spacing/Radius.swift +6 -0
  155. package/ios/DateTimePicker/DateTimePicker.swift +54 -20
  156. package/ios/DateTimePicker/WheelPicker.swift +103 -105
  157. package/ios/Divider/Divider.swift +37 -4
  158. package/ios/Extensions/Color++.swift +38 -9
  159. package/ios/Extensions/OptionalEnvironmentObject.swift +12 -0
  160. package/ios/Extensions/SkeletonUICompat.swift +11 -0
  161. package/ios/Icon/Icon.swift +21 -23
  162. package/ios/Icon/Icons.swift +1329 -0
  163. package/ios/IconButton/IconButton.swift +15 -7
  164. package/ios/Image/Image.swift +7 -23
  165. package/ios/Information/Information.swift +27 -9
  166. package/ios/Input/ErrorView.swift +2 -2
  167. package/ios/Input/Input.swift +171 -148
  168. package/ios/Input/InputPhoneNumber.swift +10 -9
  169. package/ios/Input/InputSearch.swift +107 -78
  170. package/ios/Input/InputTextArea.swift +133 -148
  171. package/ios/InputDropDown/InputDropDown.swift +10 -7
  172. package/ios/InputMoney/InputMoney.swift +32 -11
  173. package/ios/InputOTP/InputOTP.swift +22 -12
  174. package/ios/Layout/Card.swift +50 -0
  175. package/ios/Layout/GridContext.swift +187 -3
  176. package/ios/Layout/Item.swift +5 -4
  177. package/ios/Layout/ScreenLayout.swift +415 -0
  178. package/ios/Layout/Section.swift +4 -100
  179. package/ios/Loader/Loader.swift +5 -9
  180. package/ios/Lottie/LottieView.swift +14 -2
  181. package/ios/{Application/Navigation/Overplay → Navigation}/BottomSheet.swift +169 -29
  182. package/ios/Navigation/BottomTab/BottomTab.swift +332 -0
  183. package/ios/{Application/Navigation → Navigation}/BottomTab/BottomTabBar.swift +18 -7
  184. package/ios/Navigation/BottomTab/DuoBarCompression.swift +104 -0
  185. package/ios/Navigation/BottomTab/DuoTabBar.swift +329 -0
  186. package/ios/{Application → Navigation/Component}/FloatingButton.swift +43 -54
  187. package/ios/Navigation/Component/Header.swift +545 -0
  188. package/ios/Navigation/Component/HeaderBackground.swift +154 -0
  189. package/ios/Navigation/Component/HeaderJourney.swift +73 -0
  190. package/ios/Navigation/Component/HeaderLocation.swift +48 -0
  191. package/ios/Navigation/Component/HeaderRight.swift +425 -0
  192. package/ios/Navigation/Component/HeaderTitle.swift +36 -0
  193. package/ios/{Application/Navigation → Navigation/Component}/HeaderUser.swift +21 -24
  194. package/ios/Navigation/Component/SideBar.swift +183 -0
  195. package/ios/{Application/Navigation/Overplay → Navigation/Component}/SnackBar.swift +8 -8
  196. package/ios/Navigation/HostBackGestureBridge.swift +78 -0
  197. package/ios/{Application/Navigation/Overplay → Navigation}/ModalScreen.swift +9 -2
  198. package/ios/Navigation/Navigation.swift +204 -0
  199. package/ios/Navigation/NavigationContainer.swift +195 -0
  200. package/ios/{Application/Navigation → Navigation}/Navigator.swift +207 -107
  201. package/ios/Navigation/StackScreen.swift +930 -0
  202. package/ios/Navigation/StackTransition.swift +400 -0
  203. package/ios/Navigation/SwipeBackHaptic.swift +33 -0
  204. package/ios/{Application/Navigation → Navigation}/Tracking/ScreenTracker.swift +12 -5
  205. package/ios/OTPKeyboard/OTPKeyboard.swift +8 -11
  206. package/ios/Pagination/PaginationScroll.swift +2 -2
  207. package/ios/Popup/PopupDisplay.swift +72 -135
  208. package/ios/Popup/PopupInput.swift +10 -13
  209. package/ios/Popup/PopupLayout.swift +138 -0
  210. package/ios/Popup/PopupNotify.swift +59 -69
  211. package/ios/Popup/PopupPromotion.swift +31 -47
  212. package/ios/PopupView/FullscreenPopup.swift +13 -19
  213. package/ios/PopupView/PopupView.swift +1 -1
  214. package/ios/PopupView/Utils++.swift +0 -8
  215. package/ios/ProgressInfo/ProgressInfo.swift +4 -2
  216. package/ios/Radio/Radio.swift +2 -1
  217. package/ios/Rating/Rating.swift +9 -1
  218. package/ios/Resources/dot_loading.json +558 -0
  219. package/ios/Resources/lottie_circle_loader.json +1 -0
  220. package/ios/ScrollIndicator/ScrollIndicator.swift +11 -10
  221. package/ios/Skeleton/Skeleton.swift +22 -27
  222. package/ios/Slider/Slider.swift +16 -18
  223. package/ios/Stepper/Stepper.swift +7 -3
  224. package/ios/Steps/Steps.swift +8 -6
  225. package/ios/SuggestAction/SuggestAction.swift +5 -0
  226. package/ios/Swipeable/SwipeCell.swift +10 -6
  227. package/ios/Switch/Switch.swift +22 -20
  228. package/ios/TabView/TabView.swift +102 -21
  229. package/ios/Tag/Tag.swift +15 -4
  230. package/ios/Template/Logo/Logo.swift +2 -1
  231. package/ios/Template/TrustBanner/TrustBanner.swift +109 -55
  232. package/ios/Title/Title.swift +6 -17
  233. package/ios/Tooltip/Tooltip.swift +29 -14
  234. package/ios/Typography/FontScale.swift +17 -14
  235. package/ios/Typography/Text.swift +156 -20
  236. package/ios/Typography/Typography.swift +2 -2
  237. package/ios/Uploader/Uploader.swift +3 -1
  238. package/ios/native-kits.podspec +2 -3
  239. package/ios-demo/MoMoUIKitsDemo.podspec +1 -3
  240. package/ios-demo/README.md +120 -0
  241. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +1 -1
  242. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DuoTabDemo.swift +80 -0
  243. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +2 -0
  244. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IPhoneDuoDemo.swift +173 -0
  245. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +77 -1
  246. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +1 -0
  247. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +2 -2
  248. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +2 -0
  249. package/package.json +1 -1
  250. package/publish.sh +19 -2
  251. package/scripts/gen-ios-icons.mjs +36 -0
  252. package/settings.gradle.kts +64 -0
  253. package/ios/Application/Components.swift +0 -270
  254. package/ios/Application/ComposeApi.swift +0 -22
  255. package/ios/Application/HeaderRight.swift +0 -306
  256. package/ios/Application/Navigation/BottomTab/BottomTab.swift +0 -104
  257. package/ios/Application/Navigation/HeaderBackProps.swift +0 -66
  258. package/ios/Application/Navigation/HeaderTitle.swift +0 -57
  259. package/ios/Application/Navigation/NavigationContainer.swift +0 -213
  260. package/ios/Application/Navigation/NavigationOptions.swift +0 -109
  261. package/ios/Application/Navigation/NavigatorManager.swift +0 -22
  262. package/ios/Application/Navigation/component/Header.swift +0 -178
  263. package/ios/Application/Navigation/component/HeaderBackground.swift +0 -83
  264. package/ios/Application/Navigation/component/HeaderColor.swift +0 -65
  265. package/ios/Application/Navigation/component/HeaderRightWidthKey.swift +0 -11
  266. package/ios/Application/Navigation/component/NavigationFooter.swift +0 -90
  267. package/ios/Application/Navigation/component/NavigationHeaderRight.swift +0 -196
  268. package/ios/Application/Screen.swift +0 -250
  269. package/ios/Application/StackScreen.swift +0 -492
  270. package/ios/Typography/FontScaleStore.swift +0 -58
  271. package/ios/Typography/KitDesignSystem.swift +0 -17
  272. /package/ios/{Application/Navigation → Navigation}/BottomTab/CurvedContainer.swift +0 -0
@@ -76,16 +76,15 @@ public struct InputPhoneNumber: View {
76
76
  }
77
77
  )
78
78
 
79
- VStack(alignment: .leading, spacing: 4) {
79
+ VStack(alignment: .leading, spacing: 0) {
80
80
  HStack(spacing: 0) {
81
81
  // 🇻🇳 Flag
82
82
  ImageView("https://static.momocdn.net/app/img/icon/ic-qrcode-package/ic_vn_flag.png")
83
83
  .frame(width: 24, height: 24)
84
84
  .padding(.trailing, Spacing.XS)
85
-
86
- MomoText("+84", typography: size == .small ? .headerSSemibold : .headerMBold)
87
- .foregroundColor(theme.colors.text.default)
88
-
85
+
86
+ MomoText("+84", typography: size == .small ? .headerSSemibold : .headerMBold, color: theme.colors.text.default)
87
+
89
88
  Rectangle()
90
89
  .fill(theme.colors.border.default)
91
90
  .frame(width: 1, height: size == .small ? 24 : 32)
@@ -105,7 +104,7 @@ public struct InputPhoneNumber: View {
105
104
  handleFocusChange(focused)
106
105
  })
107
106
  .keyboardType(.numberPad)
108
- .font(size == .small ? .header_s_semibold : .header_m_bold)
107
+ .kitFont(size == .small ? .headerSSemibold : .headerMBold)
109
108
  .ignoreBoldTextSetting()
110
109
  .foregroundColor(theme.colors.text.default)
111
110
  .applyCursorColor(theme.colors.primary)
@@ -125,13 +124,14 @@ public struct InputPhoneNumber: View {
125
124
  onChangeText?("")
126
125
  }) {
127
126
  Icon(source: "24_navigation_close_circle_full", size: 16, color: theme.colors.text.hint)
128
- .padding(.leading, Spacing.S).accessibility(identifier: "ic_clear")
127
+ .padding(.horizontal, Spacing.S)
129
128
  }
129
+ .accessibilityIdentifier("ic_clear")
130
130
  }
131
-
131
+
132
132
  // Loading indicator
133
133
  if loading {
134
- ActivityIndicator(isAnimating: .constant(true), style: .medium)
134
+ ActivityIndicator(isAnimating: .constant(true), style: .medium, color: rightIconColor ?? theme.colors.text.default)
135
135
  .frame(width: 16, height: 16)
136
136
  }
137
137
 
@@ -166,6 +166,7 @@ public struct InputPhoneNumber: View {
166
166
  // MARK: - Helpers
167
167
 
168
168
  private func handleFocusChange(_ focused: Bool) {
169
+ guard focused != isFocused else { return }
169
170
  isFocused = focused
170
171
  if focused {
171
172
  onFocus?()
@@ -18,16 +18,17 @@ struct RenderRightIconSearch: View {
18
18
  var body: some View {
19
19
  HStack(spacing: 0) {
20
20
  if loading {
21
- ActivityIndicator(isAnimating: .constant(true), style: .medium)
21
+ ActivityIndicator(isAnimating: .constant(true), style: .medium, color: color)
22
22
  .frame(width: 16, height: 16)
23
23
  .padding(.horizontal, Spacing.S)
24
24
  }
25
25
  if !icon.isEmpty {
26
- Divider()
27
- .frame(width: 1)
28
- .background(theme.colors.primary)
26
+ // Compose: a 1pt rule inset S from the top and bottom of the 36pt bar.
27
+ Rectangle()
28
+ .fill(theme.colors.primary)
29
+ .frame(width: 1, height: 36 - Spacing.S * 2)
29
30
  .padding(.leading, Spacing.S)
30
-
31
+
31
32
  Icon(source: icon, size: 24, color: color)
32
33
  .padding(.leading, Spacing.S)
33
34
  .onTapGesture(perform: onClick)
@@ -44,6 +45,8 @@ public struct InputSearchProps {
44
45
  var placeholder: String = ""
45
46
  var onChangeText: (String) -> Void = { _ in }
46
47
  var onPressButtonText: () -> Void = {}
48
+ /// Without one, a header search's button text pops the screen (Compose `SearchAnimated`).
49
+ var hasButtonTextAction = false
47
50
  var error: String = ""
48
51
  var disabled: Bool = false
49
52
  var icon: String = ""
@@ -58,6 +61,10 @@ public struct InputSearchProps {
58
61
  var searchIcon: (() -> AnyView)? = nil
59
62
  // Mirrors Compose's InputSearchProps.placeholderCustomRender — a custom placeholder view.
60
63
  var placeholderCustomRender: (() -> AnyView)? = nil
64
+ var backgroundColor: Color? = nil
65
+ var clearCondition: (() -> Bool)? = nil
66
+ var onClearPress: () -> Void = {}
67
+ var onSubmit: () -> Void = {}
61
68
 
62
69
  public init(text: Binding<String>,
63
70
  buttonText: String = "",
@@ -65,7 +72,7 @@ public struct InputSearchProps {
65
72
  showBorder: Bool = true,
66
73
  placeholder: String = "",
67
74
  onChangeText: @escaping (String) -> Void = { _ in },
68
- onPressButtonText: @escaping () -> Void = {},
75
+ onPressButtonText: (() -> Void)? = nil,
69
76
  error: String = "",
70
77
  disabled: Bool = false,
71
78
  icon: String = "",
@@ -77,14 +84,19 @@ public struct InputSearchProps {
77
84
  fontWeight: Font.Weight = .regular,
78
85
  keyboardType: UIKeyboardType = .default,
79
86
  searchIcon: (() -> AnyView)? = nil,
80
- placeholderCustomRender: (() -> AnyView)? = nil) {
87
+ placeholderCustomRender: (() -> AnyView)? = nil,
88
+ backgroundColor: Color? = nil,
89
+ clearCondition: (() -> Bool)? = nil,
90
+ onClearPress: @escaping () -> Void = {},
91
+ onSubmit: @escaping () -> Void = {}) {
81
92
  self._text = text
82
93
  self.buttonText = buttonText
83
94
  self.showButtonText = showButtonText
84
95
  self.showBorder = showBorder
85
96
  self.placeholder = placeholder
86
97
  self.onChangeText = onChangeText
87
- self.onPressButtonText = onPressButtonText
98
+ self.onPressButtonText = onPressButtonText ?? {}
99
+ self.hasButtonTextAction = onPressButtonText != nil
88
100
  self.error = error
89
101
  self.disabled = disabled
90
102
  self.icon = icon
@@ -97,6 +109,10 @@ public struct InputSearchProps {
97
109
  self.keyboardType = keyboardType
98
110
  self.searchIcon = searchIcon
99
111
  self.placeholderCustomRender = placeholderCustomRender
112
+ self.backgroundColor = backgroundColor
113
+ self.clearCondition = clearCondition
114
+ self.onClearPress = onClearPress
115
+ self.onSubmit = onSubmit
100
116
  }
101
117
  }
102
118
 
@@ -104,7 +120,6 @@ public struct InputSearchProps {
104
120
 
105
121
  public struct InputSearch: View {
106
122
  @Environment(\.appTheme) private var theme
107
- @Environment(\.momoFontScale) private var fontScale
108
123
  @Binding var text: String
109
124
  var buttonText: String = ""
110
125
  var showButtonText: Bool = false
@@ -124,6 +139,10 @@ public struct InputSearch: View {
124
139
  var keyboardType: UIKeyboardType = .default
125
140
  var searchIcon: (() -> AnyView)? = nil
126
141
  var placeholderCustomRender: (() -> AnyView)? = nil
142
+ var backgroundColor: Color? = nil
143
+ var clearCondition: (() -> Bool)? = nil
144
+ var onClearPress: () -> Void = {}
145
+ var onSubmit: () -> Void = {}
127
146
 
128
147
  @State private var isFocused = false
129
148
  @State private var isBlurred = false
@@ -146,7 +165,11 @@ public struct InputSearch: View {
146
165
  fontWeight: Font.Weight = .regular,
147
166
  keyboardType: UIKeyboardType = .default,
148
167
  searchIcon: (() -> AnyView)? = nil,
149
- placeholderCustomRender: (() -> AnyView)? = nil) {
168
+ placeholderCustomRender: (() -> AnyView)? = nil,
169
+ backgroundColor: Color? = nil,
170
+ clearCondition: (() -> Bool)? = nil,
171
+ onClearPress: @escaping () -> Void = {},
172
+ onSubmit: @escaping () -> Void = {}) {
150
173
  self._text = text
151
174
  self.buttonText = buttonText
152
175
  self.showButtonText = showButtonText
@@ -166,6 +189,10 @@ public struct InputSearch: View {
166
189
  self.keyboardType = keyboardType
167
190
  self.searchIcon = searchIcon
168
191
  self.placeholderCustomRender = placeholderCustomRender
192
+ self.backgroundColor = backgroundColor
193
+ self.clearCondition = clearCondition
194
+ self.onClearPress = onClearPress
195
+ self.onSubmit = onSubmit
169
196
  }
170
197
 
171
198
  /// Convenience initializer mirroring Compose's `InputSearch(inputSearchProps)`.
@@ -189,88 +216,90 @@ public struct InputSearch: View {
189
216
  fontWeight: props.fontWeight,
190
217
  keyboardType: props.keyboardType,
191
218
  searchIcon: props.searchIcon,
192
- placeholderCustomRender: props.placeholderCustomRender
219
+ placeholderCustomRender: props.placeholderCustomRender,
220
+ backgroundColor: props.backgroundColor,
221
+ clearCondition: props.clearCondition,
222
+ onClearPress: props.onClearPress,
223
+ onSubmit: props.onSubmit
193
224
  )
194
225
  }
195
226
 
196
227
 
197
228
  public var body: some View {
198
229
  let iconColor: Color = disabled ? theme.colors.text.disable : (self.iconColor ?? theme.colors.text.default)
199
- VStack(alignment: .leading, spacing: 0) {
230
+ HStack(spacing: 0) {
200
231
  HStack(spacing: 0) {
201
- HStack {
202
- if let searchIcon = searchIcon {
203
- searchIcon()
204
- } else {
205
- Image(systemName: "magnifyingglass")
206
- .foregroundColor(theme.colors.text.hint)
207
- .frame(width: 24, height: 24)
208
- .padding(.trailing, Spacing.XS)
209
- }
232
+ if let searchIcon = searchIcon {
233
+ searchIcon()
234
+ } else {
235
+ Icon(source: "navigation_search", size: 24, color: theme.colors.text.hint)
236
+ .padding(.trailing, Spacing.XS)
237
+ }
210
238
 
211
- ZStack(alignment: .leading) {
212
- if text.isEmpty {
213
- if let placeholderCustomRender = placeholderCustomRender {
214
- placeholderCustomRender()
215
- } else {
216
- Text(placeholder)
217
- .foregroundColor(disabled ? theme.colors.text.disable : theme.colors.text.hint)
218
- .font(.system(size: fontScale(14), weight: fontWeight))
219
- .ignoreBoldTextSetting()
220
- }
239
+ ZStack(alignment: .leading) {
240
+ if text.isEmpty {
241
+ if let placeholderCustomRender = placeholderCustomRender {
242
+ placeholderCustomRender()
243
+ } else {
244
+ MomoText(
245
+ placeholder,
246
+ typography: fontWeight == .bold ? .actionSBold : .bodyDefaultRegular,
247
+ color: disabled ? theme.colors.text.disable : theme.colors.text.hint,
248
+ maxLines: 1
249
+ )
221
250
  }
222
- TextField("", text: $text, onEditingChanged: { editing in
223
- isFocused = editing
224
- if editing {
225
- onFocus()
226
- } else if isBlurred {
227
- onBlur()
228
- }
229
- if editing && !isBlurred {
230
- isBlurred = true
231
- }
232
- }, onCommit: {})
233
- .disabled(disabled)
234
- .foregroundColor(disabled ? theme.colors.text.disable : theme.colors.text.default)
235
- .font(.system(size: fontScale(14), weight: fontWeight))
236
- .ignoreBoldTextSetting()
237
- .keyboardType(keyboardType)
238
- .applyCursorColor(theme.colors.primary)
239
251
  }
240
-
241
- if isFocused && !text.isEmpty {
242
- SwiftButton(action: {
243
- text = ""
244
- // Kotlin's clear icon fires a callback distinct from
245
- // onChangeText (`onClearPress`, not ported here); route
246
- // through onChangeText so clearing isn't a silent no-op.
247
- onChangeText("")
248
- }) {
249
- Image(systemName: "xmark.circle.fill")
250
- .foregroundColor(theme.colors.text.hint)
251
- .frame(width: 16, height: 16)
252
+ TextField("", text: $text, onEditingChanged: { editing in
253
+ isFocused = editing
254
+ if editing {
255
+ onFocus()
256
+ } else if isBlurred {
257
+ onBlur()
252
258
  }
253
- .padding(.leading, Spacing.S)
254
- }
255
-
256
- RenderRightIconSearch(loading: loading, icon: icon, color: iconColor, onClick: onRightIconPressed)
259
+ if editing && !isBlurred {
260
+ isBlurred = true
261
+ }
262
+ }, onCommit: onSubmit)
263
+ .disabled(disabled)
264
+ .foregroundColor(disabled ? theme.colors.text.disable : theme.colors.text.default)
265
+ .kitFont(size: 14, weight: fontWeight)
266
+ .ignoreBoldTextSetting()
267
+ .keyboardType(keyboardType)
268
+ .applyCursorColor(theme.colors.primary)
257
269
  }
258
- .padding(.horizontal, Spacing.M)
259
- .padding(.vertical, Spacing.S)
260
- .background(theme.colors.background.surface)
261
- .cornerRadius(Radius.XL)
262
- .overlay(
263
- RoundedRectangle(cornerRadius: Radius.XL)
264
- .stroke(getBorderColor(isFocused: isFocused, error: error, disabled: disabled), lineWidth: showBorder ? 1 : 0)
265
- )
266
- .frame(maxWidth: showButtonText ? .infinity : nil, alignment: .leading)
267
-
268
- if showButtonText {
269
- SwiftButton(action: onPressButtonText) {
270
- MomoText(buttonText, typography: .actionDefaultBold, color: theme.colors.text.default)
270
+
271
+ if clearCondition?() == true || (isFocused && !text.isEmpty) {
272
+ SwiftButton(action: {
273
+ text = ""
274
+ // Compose only fires onClearPress; onChangeText("") is kept so existing
275
+ // SwiftUI callers that filter on it still see the clear.
276
+ onChangeText("")
277
+ onClearPress()
278
+ }) {
279
+ Icon(source: "24_navigation_close_circle_full", size: 16, color: theme.colors.text.hint)
271
280
  }
272
- .padding(.leading, Spacing.L)
281
+ .padding(.leading, Spacing.XS)
282
+ }
283
+
284
+ RenderRightIconSearch(loading: loading, icon: icon, color: iconColor, onClick: onRightIconPressed)
285
+ }
286
+ .padding(.horizontal, Spacing.M)
287
+ .frame(maxWidth: .infinity, alignment: .leading)
288
+ .frame(height: 36)
289
+ .background(
290
+ RoundedRectangle(cornerRadius: Radius.XL)
291
+ .fill(backgroundColor ?? theme.colors.background.surface)
292
+ )
293
+ .overlay(
294
+ RoundedRectangle(cornerRadius: Radius.XL)
295
+ .stroke(showBorder ? getBorderColor(isFocused: isFocused, error: error, disabled: disabled) : .clear, lineWidth: 1)
296
+ )
297
+
298
+ if showButtonText {
299
+ SwiftButton(action: onPressButtonText) {
300
+ MomoText(buttonText, typography: .actionDefaultBold, color: theme.colors.text.default)
273
301
  }
302
+ .padding(.leading, Spacing.L)
274
303
  }
275
304
  }
276
305
  }