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