@momo-kits/native-kits 0.162.2-beta.1 → 0.162.2-sp.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 (295) hide show
  1. package/.claude/settings.local.json +55 -0
  2. package/build.gradle.kts +11 -0
  3. package/compose/build.gradle.kts +186 -0
  4. package/compose/build.gradle.kts.backup +186 -0
  5. package/compose/compose.podspec +47 -0
  6. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +123 -0
  8. package/compose/src/commonMain/composeResources/font/momosignature.otf +0 -0
  9. package/compose/src/commonMain/composeResources/font/momotrustdisplay.otf +0 -0
  10. package/compose/src/commonMain/composeResources/font/sfprotext_black.otf +0 -0
  11. package/compose/src/commonMain/composeResources/font/sfprotext_black.ttf +0 -0
  12. package/compose/src/commonMain/composeResources/font/sfprotext_bold.ttf +0 -0
  13. package/compose/src/commonMain/composeResources/font/sfprotext_heavy.ttf +0 -0
  14. package/compose/src/commonMain/composeResources/font/sfprotext_light.ttf +0 -0
  15. package/compose/src/commonMain/composeResources/font/sfprotext_medium.ttf +0 -0
  16. package/compose/src/commonMain/composeResources/font/sfprotext_regular.ttf +0 -0
  17. package/compose/src/commonMain/composeResources/font/sfprotext_semibold.ttf +0 -0
  18. package/compose/src/commonMain/composeResources/font/sfprotext_thin.otf +0 -0
  19. package/compose/src/commonMain/composeResources/font/sfprotext_thin.ttf +0 -0
  20. package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.otf +0 -0
  21. package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.ttf +0 -0
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +57 -0
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +109 -0
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +201 -0
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +222 -0
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +48 -0
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +86 -0
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +76 -0
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +76 -0
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +305 -0
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +33 -0
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +921 -0
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +121 -0
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +403 -0
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +69 -0
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +85 -0
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +340 -0
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +198 -0
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +357 -0
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +123 -0
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +94 -0
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +136 -0
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +224 -0
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +543 -0
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +23 -0
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +76 -0
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +148 -0
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +188 -0
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +116 -0
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +452 -0
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +172 -0
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +255 -0
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +235 -0
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +233 -0
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +259 -0
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +241 -0
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +364 -0
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +41 -0
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +92 -0
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +40 -0
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +352 -0
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +103 -0
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +338 -0
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +70 -0
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +17 -0
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +96 -0
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +348 -0
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +256 -0
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +494 -0
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +131 -0
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +215 -0
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +96 -0
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +531 -0
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +92 -0
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +135 -0
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +214 -0
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +590 -0
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +177 -0
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +192 -0
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +205 -0
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +239 -0
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +191 -0
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +306 -0
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +188 -0
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +285 -0
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +2 -0
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +35 -0
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +2 -0
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +57 -0
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +68 -0
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +14 -0
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +50 -0
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +253 -0
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +133 -0
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +104 -0
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +145 -0
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +345 -0
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +556 -0
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +161 -0
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +243 -0
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +86 -0
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +187 -0
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +315 -0
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +80 -0
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +306 -0
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +34 -0
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +370 -0
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +131 -0
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +167 -0
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +72 -0
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +66 -0
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +70 -0
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +105 -0
  127. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +33 -0
  128. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +186 -0
  129. package/gradle/libs.versions.toml +67 -0
  130. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  131. package/gradle/wrapper/gradle-wrapper.properties +8 -0
  132. package/gradle.properties +26 -0
  133. package/gradlew +252 -0
  134. package/gradlew.bat +94 -0
  135. package/ios/Application/Components.swift +34 -43
  136. package/ios/Application/FloatingButton.swift +10 -8
  137. package/ios/Application/Navigation/BottomTab/BottomTab.swift +102 -0
  138. package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +215 -0
  139. package/ios/Application/Navigation/BottomTab/CurvedContainer.swift +65 -0
  140. package/ios/Application/Navigation/HeaderBackProps.swift +66 -0
  141. package/ios/Application/Navigation/HeaderTitle.swift +57 -0
  142. package/ios/Application/Navigation/HeaderUser.swift +209 -0
  143. package/ios/Application/Navigation/NavigationContainer.swift +151 -0
  144. package/ios/Application/Navigation/NavigationOptions.swift +109 -0
  145. package/ios/Application/Navigation/Navigator.swift +360 -0
  146. package/ios/Application/Navigation/Overplay/BottomSheet.swift +176 -0
  147. package/ios/Application/Navigation/Overplay/ModalScreen.swift +68 -0
  148. package/ios/Application/Navigation/Overplay/SnackBar.swift +144 -0
  149. package/ios/Application/Navigation/component/Header.swift +178 -0
  150. package/ios/Application/Navigation/component/HeaderBackground.swift +83 -0
  151. package/ios/Application/Navigation/component/HeaderColor.swift +65 -0
  152. package/ios/Application/StackScreen.swift +449 -0
  153. package/ios/Avatar/Avatar.swift +193 -0
  154. package/ios/Badge/Badge.swift +11 -13
  155. package/ios/Badge/BadgeRibbon.swift +12 -19
  156. package/ios/BaselineView/BaselineView.swift +163 -0
  157. package/ios/Button/Button.swift +62 -23
  158. package/ios/Carousel/Carousel.swift +181 -0
  159. package/ios/Checkbox/Checkbox.swift +14 -12
  160. package/ios/Chip/Chip.swift +23 -9
  161. package/ios/Collapse/Collapse.swift +182 -0
  162. package/ios/Colors+Radius+Spacing/Colors.swift +1 -1
  163. package/ios/Colors+Radius+Spacing/Theme.swift +295 -0
  164. package/ios/DateTimePicker/DateTimePicker.swift +210 -0
  165. package/ios/DateTimePicker/DateTimePickerTypes.swift +55 -0
  166. package/ios/DateTimePicker/DateTimePickerUtils.swift +167 -0
  167. package/ios/DateTimePicker/WheelPicker.swift +161 -0
  168. package/ios/Divider/Divider.swift +16 -0
  169. package/ios/Icon/Icon.swift +6 -1
  170. package/ios/IconButton/IconButton.swift +112 -0
  171. package/ios/Information/Information.swift +151 -0
  172. package/ios/Input/Input.swift +42 -25
  173. package/ios/Input/InputPhoneNumber.swift +21 -19
  174. package/ios/Input/InputSearch.swift +101 -45
  175. package/ios/Input/InputTextArea.swift +67 -40
  176. package/ios/InputDropDown/InputDropDown.swift +198 -0
  177. package/ios/InputMoney/InputMoney.swift +335 -0
  178. package/ios/InputOTP/InputOTP.swift +210 -0
  179. package/ios/Loader/Loader.swift +113 -0
  180. package/ios/MoMoUIKits.podspec +5 -0
  181. package/ios/OTPKeyboard/KeyboardButton.swift +1 -1
  182. package/ios/Pagination/PaginationDot.swift +61 -0
  183. package/ios/Pagination/PaginationNumber.swift +35 -0
  184. package/ios/Pagination/PaginationScroll.swift +101 -0
  185. package/ios/Pagination/PaginationWhiteDot.swift +37 -0
  186. package/ios/Popup/PopupDisplay.swift +10 -12
  187. package/ios/Popup/PopupInput.swift +2 -6
  188. package/ios/Popup/PopupNotify.swift +219 -0
  189. package/ios/ProgressInfo/ProgressInfo.swift +294 -0
  190. package/ios/Radio/Radio.swift +70 -0
  191. package/ios/Rating/Rating.swift +82 -0
  192. package/ios/Skeleton/Skeleton.swift +99 -0
  193. package/ios/Slider/Slider.swift +237 -0
  194. package/ios/Stepper/Stepper.swift +220 -0
  195. package/ios/Steps/Steps.swift +451 -0
  196. package/ios/SuggestAction/SuggestAction.swift +97 -0
  197. package/ios/Swipeable/SwipeCell.swift +185 -0
  198. package/ios/Swipeable/SwipeCellModel.swift +21 -0
  199. package/ios/TabView/TabView.swift +530 -0
  200. package/ios/Tag/Tag.swift +98 -0
  201. package/ios/Template/TrustBanner/TrustBanner.swift +2 -0
  202. package/ios/Title/Title.swift +269 -0
  203. package/ios/Tooltip/Tooltip.swift +482 -0
  204. package/ios/Typography/Text.swift +86 -24
  205. package/ios/Typography/Typography.swift +31 -6
  206. package/ios/Uploader/Uploader.swift +183 -0
  207. package/ios/native-kits.podspec +58 -8
  208. package/ios-demo/MoMoUIKitsDemo.podspec +18 -0
  209. package/ios-demo/README.md +120 -0
  210. package/ios-demo/Resources/dot_loading.json +558 -0
  211. package/ios-demo/Resources/icon.json +4052 -0
  212. package/ios-demo/Resources/lottie_circle_loader.json +1 -0
  213. package/ios-demo/Sources/MoMoUIKitsDemo/DemoScaffold.swift +48 -0
  214. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsBadgeDemoView.swift +25 -0
  215. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsButtonDemoView.swift +26 -0
  216. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsCheckboxDemoView.swift +19 -0
  217. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsChipDemoView.swift +33 -0
  218. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsInputDemoView.swift +48 -0
  219. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsPopupDemoView.swift +21 -0
  220. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsRadioDemoView.swift +17 -0
  221. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsTypographyDemoView.swift +28 -0
  222. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoContext.swift +31 -0
  223. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoFactory.swift +72 -0
  224. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +110 -0
  225. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AvatarDemo.swift +93 -0
  226. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BadgeDemo.swift +269 -0
  227. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BaselineView.swift +117 -0
  228. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +89 -0
  229. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ButtonDemo.swift +100 -0
  230. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CarouselDemo.swift +126 -0
  231. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CheckboxDemo.swift +63 -0
  232. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ChipDemo.swift +20 -0
  233. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CollapseDemo.swift +93 -0
  234. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +107 -0
  235. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DateTimePickerDemo.swift +124 -0
  236. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DividerDemo.swift +14 -0
  237. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/HeaderUserDemo.swift +49 -0
  238. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +261 -0
  239. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconButtonDemo.swift +58 -0
  240. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ImageDemo.swift +78 -0
  241. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InformationDemo.swift +138 -0
  242. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDemo.swift +111 -0
  243. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDropDownDemo.swift +136 -0
  244. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputMoneyDemo.swift +107 -0
  245. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputOTPDemo.swift +73 -0
  246. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +100 -0
  247. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputSearchDemo.swift +32 -0
  248. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputTextAreaDemo.swift +57 -0
  249. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LoaderDemo.swift +70 -0
  250. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +227 -0
  251. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PaginationDemo.swift +72 -0
  252. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +175 -0
  253. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +121 -0
  254. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +76 -0
  255. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ProgressInfoDemo.swift +89 -0
  256. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RadioDemo.swift +32 -0
  257. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RatingDemo.swift +56 -0
  258. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SkeletonDemo.swift +32 -0
  259. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SliderDemo.swift +150 -0
  260. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SnackBarDemo.swift +138 -0
  261. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepperDemo.swift +103 -0
  262. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepsDemo.swift +94 -0
  263. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SuggestActionDemo.swift +79 -0
  264. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwipeDemo.swift +152 -0
  265. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwitchDemo.swift +33 -0
  266. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TabViewDemo.swift +190 -0
  267. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TagDemo.swift +34 -0
  268. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ThemeDemo.swift +182 -0
  269. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TitleDemo.swift +109 -0
  270. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TooltipDemo.swift +187 -0
  271. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +87 -0
  272. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/UploaderDemo.swift +131 -0
  273. package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +50 -0
  274. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoModels.swift +15 -0
  275. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoRegistry.swift +73 -0
  276. package/local.properties +8 -0
  277. package/package.json +1 -1
  278. package/publish.sh +50 -0
  279. package/scripts/gen-ios-color.mjs +136 -0
  280. package/settings.gradle.kts +64 -0
  281. package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Example.xcscheme +0 -32
  282. package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  283. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  284. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/WorkspaceSettings.xcsettings +0 -16
  285. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
  286. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -5
  287. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
  288. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
  289. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImage.xcscheme +0 -58
  290. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +0 -58
  291. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SkeletonUI.xcscheme +0 -58
  292. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios-LottiePrivacyInfo.xcscheme +0 -58
  293. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios.xcscheme +0 -58
  294. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -60
  295. package/ios/Typography/MomoFontScale.swift +0 -36
@@ -0,0 +1,112 @@
1
+ import Foundation
2
+ import SwiftUI
3
+
4
+ // MARK: - IconSize
5
+
6
+ public enum IconSize {
7
+ case large
8
+ case small
9
+
10
+ /// Container width/height of the button.
11
+ var containerSize: CGFloat {
12
+ switch self {
13
+ case .large: return 48
14
+ case .small: return 40
15
+ }
16
+ }
17
+
18
+ /// Glyph size of the icon inside the button.
19
+ var iconSize: CGFloat {
20
+ switch self {
21
+ case .large: return 24
22
+ case .small: return 16
23
+ }
24
+ }
25
+
26
+ var radius: CGFloat {
27
+ Radius.XL
28
+ }
29
+ }
30
+
31
+ // MARK: - IconButton
32
+
33
+ public struct IconButton: View {
34
+ @Environment(\.appTheme) private var theme
35
+
36
+ var icon: String
37
+ var onClick: () -> Void
38
+ var type: ButtonType
39
+ var size: IconSize
40
+ var color: Color?
41
+
42
+ public init(
43
+ icon: String = "",
44
+ onClick: @escaping () -> Void,
45
+ type: ButtonType = .primary,
46
+ size: IconSize = .small,
47
+ color: Color? = nil
48
+ ) {
49
+ self.icon = icon
50
+ self.onClick = onClick
51
+ self.type = type
52
+ self.size = size
53
+ self.color = color
54
+ }
55
+
56
+ private var isEnabled: Bool {
57
+ type != .disabled
58
+ }
59
+
60
+ public var body: some View {
61
+ let bg = backgroundColor
62
+ let fg = contentColor
63
+ // OUTLINE allows an override color for its border, mirroring Compose `color ?? theme.colors.primary`.
64
+ let border: Color? = type == .outline ? (color ?? theme.colors.primary) : borderColor
65
+ let borderWidth = type.borderWidth
66
+
67
+ SwiftUI.Button(action: {
68
+ if isEnabled {
69
+ onClick()
70
+ }
71
+ }) {
72
+ Icon(source: icon, size: size.iconSize, color: fg)
73
+ .frame(width: size.containerSize, height: size.containerSize)
74
+ .background(bg)
75
+ .clipShape(RoundedRectangle(cornerRadius: size.radius))
76
+ .overlay(
77
+ RoundedRectangle(cornerRadius: size.radius)
78
+ .stroke(border ?? .clear, lineWidth: border != nil ? borderWidth : 0)
79
+ )
80
+ }
81
+ .buttonStyle(.plain)
82
+ .disabled(!isEnabled)
83
+ }
84
+
85
+ private var backgroundColor: Color {
86
+ switch type {
87
+ case .disabled: return theme.colors.background.disable
88
+ case .primary: return theme.colors.primary
89
+ case .secondary, .outline: return theme.colors.background.surface
90
+ case .tonal: return theme.colors.background.tonal
91
+ case .danger: return theme.colors.error.primary
92
+ case .text: return .clear
93
+ }
94
+ }
95
+
96
+ private var contentColor: Color {
97
+ switch type {
98
+ case .disabled: return theme.colors.text.disable
99
+ case .primary, .danger: return Colors.black01
100
+ case .secondary: return theme.colors.text.default
101
+ case .outline, .tonal, .text: return theme.colors.primary
102
+ }
103
+ }
104
+
105
+ private var borderColor: Color? {
106
+ switch type {
107
+ case .secondary: return theme.colors.border.default
108
+ case .outline: return color ?? theme.colors.primary
109
+ default: return nil
110
+ }
111
+ }
112
+ }
@@ -0,0 +1,151 @@
1
+ import SwiftUI
2
+
3
+ public enum InformationState {
4
+ case `default`
5
+ case warning
6
+ case error
7
+ }
8
+
9
+ public struct Information: View {
10
+ private let title: String?
11
+ private let description: String
12
+ private let state: InformationState
13
+ private let image: String?
14
+ private let onPressAction: (() -> Void)?
15
+ private let showIcon: Bool
16
+ private let action: String?
17
+ private let showIconClose: Bool
18
+ private let onPressClose: (() -> Void)?
19
+
20
+ public init(
21
+ title: String? = nil,
22
+ description: String = "Description",
23
+ state: InformationState = .default,
24
+ image: String? = nil,
25
+ onPressAction: (() -> Void)? = nil,
26
+ showIcon: Bool = true,
27
+ action: String? = nil,
28
+ showIconClose: Bool = true,
29
+ onPressClose: (() -> Void)? = nil
30
+ ) {
31
+ self.title = title
32
+ self.description = description
33
+ self.state = state
34
+ self.image = image
35
+ self.onPressAction = onPressAction
36
+ self.showIcon = showIcon
37
+ self.action = action
38
+ self.showIconClose = showIconClose
39
+ self.onPressClose = onPressClose
40
+ }
41
+
42
+ private var borderColor: Color {
43
+ switch state {
44
+ case .default: return Colors.blue07
45
+ case .warning: return Colors.yellow06
46
+ case .error: return Colors.red07
47
+ }
48
+ }
49
+
50
+ private var backgroundColor: Color {
51
+ switch state {
52
+ case .default: return Colors.blue10
53
+ case .warning: return Colors.yellow09
54
+ case .error: return Colors.red10
55
+ }
56
+ }
57
+
58
+ private var accentColor: Color {
59
+ switch state {
60
+ case .default: return Colors.blue03
61
+ case .warning: return Colors.orange03
62
+ case .error: return Colors.red03
63
+ }
64
+ }
65
+
66
+ private var iconSource: String {
67
+ switch state {
68
+ case .default: return "notifications_info"
69
+ case .warning: return "24_notifications_alert_triangle"
70
+ case .error: return "24_notifications_alert_octagon"
71
+ }
72
+ }
73
+
74
+ public var body: some View {
75
+ VStack(alignment: .leading, spacing: 0) {
76
+ HStack(alignment: .top, spacing: 0) {
77
+ if let image {
78
+ ImageView(image)
79
+ .frame(width: 40, height: 40)
80
+ .clipShape(RoundedRectangle(cornerRadius: Radius.S))
81
+ .padding(.trailing, Spacing.S)
82
+ } else if showIcon {
83
+ Icon(source: iconSource, size: 16, color: accentColor)
84
+ .padding(.trailing, Spacing.S)
85
+ }
86
+
87
+ VStack(alignment: .leading, spacing: 0) {
88
+ if let title {
89
+ MomoText(title, typography: .labelDefaultMedium)
90
+ }
91
+ MomoText(description, typography: .descriptionDefaultRegular)
92
+ }
93
+ .frame(maxWidth: .infinity, alignment: .leading)
94
+
95
+ if let onPressClose, showIconClose {
96
+ Icon(source: "navigation_close", size: 16, color: Colors.black17)
97
+ .contentShape(Rectangle())
98
+ .onTapGesture(perform: onPressClose)
99
+ }
100
+ }
101
+
102
+ if let action, let onPressAction {
103
+ MomoText(action, typography: .actionXsBold, color: accentColor)
104
+ .frame(maxWidth: .infinity, alignment: .trailing)
105
+ .contentShape(Rectangle())
106
+ .onTapGesture(perform: onPressAction)
107
+ .padding(.top, Spacing.S)
108
+ }
109
+ }
110
+ .padding(Spacing.M)
111
+ .background(
112
+ RoundedRectangle(cornerRadius: Radius.S)
113
+ .fill(backgroundColor)
114
+ )
115
+ .overlay(
116
+ RoundedRectangle(cornerRadius: Radius.S)
117
+ .stroke(borderColor, lineWidth: 0.5)
118
+ )
119
+ }
120
+ }
121
+
122
+ // MARK: - Preview
123
+ #if DEBUG
124
+ struct Information_Previews: PreviewProvider {
125
+ static var previews: some View {
126
+ VStack(spacing: 16) {
127
+ Information(
128
+ title: "Information",
129
+ description: "This is a default information message."
130
+ )
131
+ Information(
132
+ title: "Warning",
133
+ description: "This is a warning message.",
134
+ state: .warning
135
+ )
136
+ Information(
137
+ title: "Error",
138
+ description: "This is an error message.",
139
+ state: .error,
140
+ onPressAction: {}, action: "Retry"
141
+ )
142
+ Information(
143
+ description: "Dismissible information.",
144
+ onPressClose: {}
145
+ )
146
+ }
147
+ .padding()
148
+ .previewLayout(.sizeThatFits)
149
+ }
150
+ }
151
+ #endif
@@ -3,12 +3,14 @@ import SwiftUI
3
3
  import Combine
4
4
 
5
5
  public struct Input: View {
6
+ @Environment(\.appTheme) private var theme
6
7
  @Binding public var text: String
7
8
 
8
9
  public var placeholder: String
9
10
  public var floatingValue: String
11
+ public var floatingValueColor: Color?
10
12
  public var floatingIcon: String
11
- public var floatingIconColor: Color
13
+ public var floatingIconColor: Color?
12
14
  public var size: InputSize
13
15
  public var hintText: String
14
16
  public var error: String
@@ -17,9 +19,9 @@ public struct Input: View {
17
19
  public var readOnly: Bool
18
20
  public var secureTextEntry: Bool
19
21
  public var rightIcon: String
20
- public var rightIconColor: Color
22
+ public var rightIconColor: Color?
21
23
  public var leadingIcon: String
22
- public var leadingIconColor: Color
24
+ public var leadingIconColor: Color?
23
25
  public var loading: Bool
24
26
  public var required: Bool
25
27
  public var maxLength: Int?
@@ -38,8 +40,9 @@ public struct Input: View {
38
40
  text: Binding<String>,
39
41
  placeholder: String = "",
40
42
  floatingValue: String = "",
43
+ floatingValueColor: Color? = nil,
41
44
  floatingIcon: String = "",
42
- floatingIconColor: Color = Colors.primary,
45
+ floatingIconColor: Color? = nil,
43
46
  size: InputSize = .small,
44
47
  hintText: String = "",
45
48
  error: String = "",
@@ -48,9 +51,9 @@ public struct Input: View {
48
51
  readOnly: Bool = false,
49
52
  secureTextEntry: Bool = false,
50
53
  rightIcon: String = "",
51
- rightIconColor: Color = Colors.black17,
54
+ rightIconColor: Color? = nil,
52
55
  leadingIcon: String = "",
53
- leadingIconColor: Color = Colors.black12,
56
+ leadingIconColor: Color? = nil,
54
57
  loading: Bool = false,
55
58
  required: Bool = false,
56
59
  maxLength: Int? = nil,
@@ -65,6 +68,7 @@ public struct Input: View {
65
68
  self._text = text
66
69
  self.placeholder = placeholder
67
70
  self.floatingValue = floatingValue
71
+ self.floatingValueColor = floatingValueColor
68
72
  self.floatingIcon = floatingIcon
69
73
  self.floatingIconColor = floatingIconColor
70
74
  self.size = size
@@ -107,14 +111,14 @@ public struct Input: View {
107
111
  HStack(spacing: Spacing.XS) {
108
112
  MomoText(floatingValue, typography: .labelSMedium, color: getFloatingColor())
109
113
  if required {
110
- MomoText("*", typography: .labelSMedium, color: Colors.red03)
114
+ MomoText("*", typography: .labelSMedium, color: theme.colors.error.primary)
111
115
  }
112
116
  if !floatingIcon.isEmpty {
113
117
  Icon(source: floatingIcon, size: 16, color: getFloatingIconColor())
114
118
  }
115
119
  }
116
120
  .padding(.horizontal, Spacing.S)
117
- .background(Colors.black01)
121
+ .background(theme.colors.background.surface)
118
122
  .offset(x: Spacing.S, y: -8)
119
123
  .zIndex(10)
120
124
  }
@@ -123,7 +127,7 @@ public struct Input: View {
123
127
  HStack(alignment: .center, spacing: 0) {
124
128
  // Leading icon
125
129
  if !leadingIcon.isEmpty {
126
- Icon(source: leadingIcon, size: size == .small ? 24 : 32, color: leadingIconColor)
130
+ Icon(source: leadingIcon, size: size == .small ? 24 : 32, color: getLeadingIconColor())
127
131
  .padding(.trailing, Spacing.M)
128
132
  }
129
133
 
@@ -144,6 +148,7 @@ public struct Input: View {
144
148
  fontSize: scaleSize(14),
145
149
  fontWeight: fontWeight == .bold ? .bold : .regular,
146
150
  textColor: UIColor(getTextColor()),
151
+ cursorColor: UIColor(theme.colors.primary),
147
152
  isDisabled: disabled || readOnly,
148
153
  maxLength: maxLength,
149
154
  onFocusChange: { focused in
@@ -157,9 +162,10 @@ public struct Input: View {
157
162
  })
158
163
  .keyboardType(keyboardType)
159
164
  .font(fontWeight == .bold ? .action_s_bold : .body_default_regular)
165
+ .ignoreBoldTextSetting()
160
166
  .foregroundColor(getTextColor())
161
167
  .disabled(disabled || readOnly)
162
- .applyPrimaryCursorColor()
168
+ .applyCursorColor(theme.colors.primary)
163
169
  .onChange(of: text) { newValue in
164
170
  let limited = limitText(newValue)
165
171
  if limited != newValue {
@@ -175,7 +181,7 @@ public struct Input: View {
175
181
  text = ""
176
182
  onChangeText?("")
177
183
  }) {
178
- Icon(source: "24_navigation_close_circle_full", size: 16, color: Colors.black12)
184
+ Icon(source: "24_navigation_close_circle_full", size: 16, color: theme.colors.text.hint)
179
185
  .padding(.leading, Spacing.S).accessibility(identifier: "ic_clear")
180
186
  }
181
187
  }
@@ -194,14 +200,14 @@ public struct Input: View {
194
200
  Icon(
195
201
  source: isPasswordHidden ? "24_security_eye_off" : "24_security_eye_open",
196
202
  size: 24,
197
- color: rightIconColor
203
+ color: getRightIconColor()
198
204
  )
199
205
  .padding(.leading, Spacing.S).accessibility(identifier: "ic_show_hide")
200
206
  }
201
207
  }
202
208
  } else if !rightIcon.isEmpty {
203
209
  SwiftUI.Button(action: { onRightIconPressed?() }) {
204
- Icon(source: rightIcon, size: 24, color: rightIconColor)
210
+ Icon(source: rightIcon, size: 24, color: getRightIconColor())
205
211
  .padding(.leading, Spacing.S)
206
212
  }
207
213
  }
@@ -210,7 +216,7 @@ public struct Input: View {
210
216
  .frame(height: scaleSize(size == .small ? 48 : 56, 1.1))
211
217
  .background(
212
218
  RoundedRectangle(cornerRadius: Radius.S)
213
- .fill(Colors.black01)
219
+ .fill(theme.colors.background.surface)
214
220
  )
215
221
  .overlay(
216
222
  RoundedRectangle(cornerRadius: Radius.S)
@@ -259,31 +265,39 @@ public struct Input: View {
259
265
 
260
266
  private func borderColor() -> Color {
261
267
  if disabled {
262
- return Colors.black04 // border.disable
268
+ return theme.colors.border.disable
263
269
  }
264
270
  if !error.isEmpty {
265
- return Colors.red03 // error.primary
271
+ return theme.colors.error.primary
266
272
  }
267
273
  if isFocused {
268
- return Colors.primary
274
+ return theme.colors.primary
269
275
  }
270
- return Colors.black04 // border.default
276
+ return theme.colors.border.default
271
277
  }
272
278
 
273
279
  private func getTextColor() -> Color {
274
- return disabled ? Colors.black09 : Colors.black17
280
+ return disabled ? theme.colors.text.disable : theme.colors.text.default
275
281
  }
276
282
 
277
283
  private func getPlaceholderColor() -> Color {
278
- return disabled ? Colors.black09 : Colors.black12
284
+ return disabled ? theme.colors.text.disable : theme.colors.text.hint
279
285
  }
280
286
 
281
287
  private func getFloatingColor() -> Color {
282
- return disabled ? Colors.black09 : Colors.black12
288
+ return disabled ? theme.colors.text.disable : (floatingValueColor ?? theme.colors.text.hint)
283
289
  }
284
290
 
285
291
  private func getFloatingIconColor() -> Color {
286
- return disabled ? Colors.black09 : floatingIconColor
292
+ return disabled ? theme.colors.text.disable : (floatingIconColor ?? theme.colors.text.default)
293
+ }
294
+
295
+ private func getLeadingIconColor() -> Color {
296
+ return disabled ? theme.colors.text.disable : (leadingIconColor ?? theme.colors.text.hint)
297
+ }
298
+
299
+ private func getRightIconColor() -> Color {
300
+ return disabled ? theme.colors.text.disable : (rightIconColor ?? theme.colors.text.default)
287
301
  }
288
302
  }
289
303
 
@@ -295,6 +309,7 @@ private struct SecureInputField: UIViewRepresentable {
295
309
  var fontSize: CGFloat
296
310
  var fontWeight: UIFont.Weight
297
311
  var textColor: UIColor
312
+ var cursorColor: UIColor
298
313
  var isDisabled: Bool
299
314
  var maxLength: Int?
300
315
  var onFocusChange: (Bool) -> Void
@@ -315,7 +330,7 @@ private struct SecureInputField: UIViewRepresentable {
315
330
  textField.setContentHuggingPriority(.defaultLow, for: .horizontal)
316
331
  textField.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
317
332
  textField.text = text
318
- textField.tintColor = UIColor(Colors.primary)
333
+ textField.tintColor = cursorColor
319
334
  textField.addTarget(
320
335
  context.coordinator,
321
336
  action: #selector(Coordinator.textFieldDidChange(_:)),
@@ -330,6 +345,8 @@ private struct SecureInputField: UIViewRepresentable {
330
345
  textField.text = text
331
346
  }
332
347
  textField.isEnabled = !isDisabled
348
+ textField.textColor = textColor
349
+ textField.tintColor = cursorColor
333
350
  if textField.keyboardType != keyboardType {
334
351
  textField.keyboardType = keyboardType
335
352
  textField.reloadInputViews()
@@ -400,9 +417,9 @@ private struct SecureInputField: UIViewRepresentable {
400
417
 
401
418
  // MARK: - Helper Extension
402
419
  private extension View {
403
- func applyPrimaryCursorColor() -> some View {
420
+ func applyCursorColor(_ color: Color) -> some View {
404
421
  if #available(iOS 15.0, *) {
405
- return self.tint(Colors.primary)
422
+ return self.tint(color)
406
423
  } else {
407
424
  return self
408
425
  }
@@ -7,15 +7,17 @@
7
7
 
8
8
  import SwiftUI
9
9
  public struct InputPhoneNumber: View {
10
+ @Environment(\.appTheme) private var theme
10
11
  @Binding public var text: String
11
12
 
12
13
  public var placeholder: String
13
14
  public var size: InputSize
14
15
  public var hintText: String
15
16
  public var error: String
17
+ public var errorSpacing: Bool
16
18
  public var loading: Bool
17
19
  public var rightIcon: String
18
- public var rightIconColor: Color
20
+ public var rightIconColor: Color?
19
21
  public var autofocus: Bool
20
22
  public var onChangeText: ((String) -> Void)?
21
23
  public var onFocus: (() -> Void)?
@@ -31,10 +33,11 @@ public struct InputPhoneNumber: View {
31
33
  size: InputSize = .small,
32
34
  hintText: String = "",
33
35
  error: String = "",
36
+ errorSpacing: Bool = false,
34
37
  loading: Bool = false,
35
38
  required: Bool = false,
36
39
  rightIcon: String = "",
37
- rightIconColor: Color = Colors.black12,
40
+ rightIconColor: Color? = nil,
38
41
  autofocus: Bool = false,
39
42
  onChangeText: ((String) -> Void)? = nil,
40
43
  onFocus: (() -> Void)? = nil,
@@ -47,6 +50,7 @@ public struct InputPhoneNumber: View {
47
50
  self.size = size
48
51
  self.hintText = hintText
49
52
  self.error = error
53
+ self.errorSpacing = errorSpacing
50
54
  self.loading = loading
51
55
  self.rightIcon = rightIcon
52
56
  self.rightIconColor = rightIconColor
@@ -76,17 +80,17 @@ public struct InputPhoneNumber: View {
76
80
  .padding(.trailing, Spacing.XS)
77
81
 
78
82
  MomoText("+84", typography: size == .small ? .headerSSemibold : .headerMBold)
79
- .foregroundColor(Colors.black17)
83
+ .foregroundColor(theme.colors.text.default)
80
84
 
81
85
  Rectangle()
82
- .fill(Colors.black04)
86
+ .fill(theme.colors.border.default)
83
87
  .frame(width: 1, height: size == .small ? 24 : 32)
84
88
  .padding(.horizontal, Spacing.M)
85
89
 
86
90
  // Text input
87
91
  ZStack(alignment: .leading) {
88
92
  if text.isEmpty {
89
- MomoText(placeholder, typography: size == .small ? .headerSSemibold : .headerMBold, color: Colors.black12)
93
+ MomoText(placeholder, typography: size == .small ? .headerSSemibold : .headerMBold, color: theme.colors.text.hint)
90
94
  }
91
95
 
92
96
  TextField("", text: textBinding, onEditingChanged: { focused in
@@ -94,8 +98,9 @@ public struct InputPhoneNumber: View {
94
98
  })
95
99
  .keyboardType(.numberPad)
96
100
  .font(size == .small ? .header_s_semibold : .header_m_bold)
97
- .foregroundColor(Colors.black17)
98
- .applyPrimaryCursorColor()
101
+ .ignoreBoldTextSetting()
102
+ .foregroundColor(theme.colors.text.default)
103
+ .applyCursorColor(theme.colors.primary)
99
104
  .lineLimit(1)
100
105
  .accessibility(identifier: accessibilityLabel ?? "")
101
106
  .accessibilityValue(textBinding.wrappedValue.isEmpty ? placeholder : textBinding.wrappedValue)
@@ -107,7 +112,7 @@ public struct InputPhoneNumber: View {
107
112
  text = ""
108
113
  onChangeText?("")
109
114
  }) {
110
- Icon(source: "24_navigation_close_circle_full", size: 16, color: Colors.black12)
115
+ Icon(source: "24_navigation_close_circle_full", size: 16, color: theme.colors.text.hint)
111
116
  .padding(.leading, Spacing.S).accessibility(identifier: "ic_clear")
112
117
  }
113
118
  }
@@ -121,7 +126,7 @@ public struct InputPhoneNumber: View {
121
126
  // ✅ Right icon
122
127
  if !rightIcon.isEmpty {
123
128
  SwiftUI.Button(action: { onRightIconPressed?() }) {
124
- Icon(source: rightIcon, size: 24, color: rightIconColor)
129
+ Icon(source: rightIcon, size: 24, color: rightIconColor ?? theme.colors.text.default)
125
130
  .padding(.leading, Spacing.S)
126
131
  }
127
132
  }
@@ -130,7 +135,7 @@ public struct InputPhoneNumber: View {
130
135
  .frame(height: scaleSize(size == .small ? 48 : 56, 1.1))
131
136
  .background(
132
137
  RoundedRectangle(cornerRadius: Radius.S)
133
- .fill(Colors.black01)
138
+ .fill(theme.colors.background.surface)
134
139
  )
135
140
  .overlay(
136
141
  RoundedRectangle(cornerRadius: Radius.S)
@@ -140,7 +145,7 @@ public struct InputPhoneNumber: View {
140
145
  // Error or hint
141
146
  ErrorView(
142
147
  errorMessage: error,
143
- errorSpacing: false,
148
+ errorSpacing: errorSpacing,
144
149
  hintText: hintText
145
150
  )
146
151
  }
@@ -158,21 +163,18 @@ public struct InputPhoneNumber: View {
158
163
  }
159
164
 
160
165
  private func borderColor() -> Color {
161
- if !error.isEmpty { return Colors.red03 }
162
- if isFocused { return Colors.primary }
163
- return Colors.black04
166
+ if !error.isEmpty { return theme.colors.error.primary }
167
+ if isFocused { return theme.colors.primary }
168
+ return theme.colors.border.default
164
169
  }
165
170
  }
166
171
 
167
172
  private extension View {
168
- func applyPrimaryCursorColor() -> some View {
173
+ func applyCursorColor(_ color: Color) -> some View {
169
174
  if #available(iOS 15.0, *) {
170
- // Modern SwiftUI: use .tint() for cursor
171
- return self.tint(Colors.primary)
175
+ return self.tint(color)
172
176
  } else {
173
- // iOS 13–14: return unchanged (no tint support)
174
177
  return self
175
178
  }
176
179
  }
177
180
  }
178
-