@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,261 @@
1
+ //
2
+ // Home.swift
3
+ // Example
4
+ //
5
+ // Created by sophia on 7/2/25.
6
+ //
7
+
8
+ import SwiftUI
9
+ import MoMoUIKits
10
+
11
+ public struct ScreenUsage: Hashable, Identifiable {
12
+ public let id = UUID()
13
+ public let title: String
14
+ public let destination: AnyView
15
+ public let icon: String
16
+
17
+ public init(title: String, destination: AnyView, icon: String) {
18
+ self.title = title
19
+ self.destination = destination
20
+ self.icon = icon
21
+ }
22
+
23
+ public static func == (lhs: ScreenUsage, rhs: ScreenUsage) -> Bool {
24
+ lhs.id == rhs.id
25
+ }
26
+
27
+ public func hash(into hasher: inout Hasher) {
28
+ hasher.combine(id)
29
+ }
30
+ }
31
+
32
+ public func getIcon(icon: String) -> String {
33
+ return "https://static.momocdn.net/app/img/kits/UIKIT/\(icon).png"
34
+ }
35
+
36
+ public let ScreenUsages: [ScreenUsage] = [
37
+ // ScreenUsage(title: "ScreenUsage", destination: AnyView(ContentView()), icon: getIcon(icon: "Layout")),
38
+ ScreenUsage(title: "Badge", destination: AnyView(BadgeDemo()), icon: getIcon(icon: "Badge")),
39
+ ScreenUsage(title: "Button", destination: AnyView(ButtonDemo()), icon: getIcon(icon: "Button")),
40
+ ScreenUsage(title: "CheckBox", destination: AnyView(CheckboxDemo()), icon: getIcon(icon: "Checkbox")),
41
+ ScreenUsage(title: "Chip", destination: AnyView(ChipDemo()), icon: getIcon(icon: "Chip")),
42
+ // ScreenUsage(title: "IconButton", destination: AnyView(ContentView()), icon: getIcon(icon: "Button")),
43
+ // ScreenUsage(title: "Icon", destination: AnyView(ContentView()), icon: getIcon(icon: "Icon")),
44
+ ScreenUsage(title: "Image", destination: AnyView(ImageDemo()), icon: getIcon(icon: "Layout")),
45
+ ScreenUsage(title: "Baseline View", destination: AnyView(BaselineViewDemo()), icon: getIcon(icon: "Layout")),
46
+ // ScreenUsage(title: "InputMoney", destination: AnyView(ContentView()), icon: getIcon(icon: "FormInput")),
47
+ ScreenUsage(title: "Input", destination: AnyView(InputDemo()), icon: getIcon(icon: "FormInput")),
48
+ ScreenUsage(title: "Input Phone Number", destination: AnyView(InputPhoneNumberDemo()), icon: getIcon(icon: "FormInput")),
49
+ ScreenUsage(title: "InputTextArea", destination: AnyView(InputTextAreaDemo()), icon: getIcon(icon: "FormInput")),
50
+ ScreenUsage(title: "InputSearch", destination: AnyView(InputSearchDemo()), icon: getIcon(icon: "FormInput")),
51
+ // ScreenUsage(title: "Pagination", destination: AnyView(ContentView()), icon: getIcon(icon: "Badge")),
52
+ // ScreenUsage(title: "InputDropdown", destination: AnyView(ContentView()), icon: getIcon(icon: "FormInput")),
53
+ ScreenUsage(title: "PopupNotify", destination: AnyView(PopupNotifyDemo()), icon: getIcon(icon: "Popup")),
54
+ ScreenUsage(title: "PopupPromotion", destination: AnyView(PopupPromotionDemo()), icon: getIcon(icon: "Popup")),
55
+ ScreenUsage(title: "SnackBar", destination: AnyView(SnackBarDemo()), icon: getIcon(icon: "Popup")),
56
+ // ScreenUsage(title: "Radio", destination: AnyView(ContentView()), icon: getIcon(icon: "Radio")),
57
+ // ScreenUsage(title: "Skeleton", destination: AnyView(ContentView()), icon: getIcon(icon: "Skeleton")),
58
+ ScreenUsage(title: "Switch", destination: AnyView(SwitchDemo()), icon: getIcon(icon: "Toggle")),
59
+ // ScreenUsage(title: "Tag", destination: AnyView(ContentView()), icon: getIcon(icon: "Skeleton")),
60
+ ScreenUsage(title: "Text", destination: AnyView(TypographyDemo()), icon: getIcon(icon: "Typography")),
61
+ // ScreenUsage(title: "TrustBanner", destination: AnyView(TrustBanner(onPress: {_ in })), icon: getIcon(icon: "Typography")),
62
+ ScreenUsage(title: "Information", destination: AnyView(InformationDemo()), icon: getIcon(icon: "Typography")),
63
+ ScreenUsage(title: "Avatar", destination: AnyView(AvatarDemo()), icon: getIcon(icon: "Avatar")),
64
+ ScreenUsage(title: "Carousel", destination: AnyView(CarouselDemo()), icon: getIcon(icon: "Carousel")),
65
+ ScreenUsage(title: "Divider", destination: AnyView(DividerDemo()), icon: getIcon(icon: "Divider")),
66
+ ScreenUsage(title: "IconButton", destination: AnyView(IconButtonDemo()), icon: getIcon(icon: "Button")),
67
+ ScreenUsage(title: "Loader", destination: AnyView(LoaderDemo()), icon: getIcon(icon: "Loader")),
68
+ ScreenUsage(title: "Pagination", destination: AnyView(PaginationDemo()), icon: getIcon(icon: "Badge")),
69
+ ScreenUsage(title: "Radio", destination: AnyView(RadioDemo()), icon: getIcon(icon: "Radio")),
70
+ ScreenUsage(title: "Rating", destination: AnyView(RatingDemo()), icon: getIcon(icon: "Rating")),
71
+ ScreenUsage(title: "Skeleton", destination: AnyView(SkeletonDemo()), icon: getIcon(icon: "Skeleton")),
72
+ ScreenUsage(title: "SuggestAction", destination: AnyView(SuggestActionDemo()), icon: getIcon(icon: "Information")),
73
+ ScreenUsage(title: "Tag", destination: AnyView(TagDemo()), icon: getIcon(icon: "Tag")),
74
+ ScreenUsage(title: "Title", destination: AnyView(TitleDemo()), icon: getIcon(icon: "Typography")),
75
+ ScreenUsage(title: "Collapse", destination: AnyView(CollapseDemo()), icon: getIcon(icon: "Layout")),
76
+ ScreenUsage(title: "Stepper", destination: AnyView(StepperDemo()), icon: getIcon(icon: "Layout")),
77
+ ScreenUsage(title: "Uploader", destination: AnyView(UploaderDemo()), icon: getIcon(icon: "FormInput")),
78
+ ScreenUsage(title: "Swipe", destination: AnyView(SwipeDemo()), icon: getIcon(icon: "Layout")),
79
+ ScreenUsage(title: "InputDropDown", destination: AnyView(InputDropDownDemo()), icon: getIcon(icon: "FormInput")),
80
+ ScreenUsage(title: "InputMoney", destination: AnyView(InputMoneyDemo()), icon: getIcon(icon: "FormInput")),
81
+ ScreenUsage(title: "InputOTP", destination: AnyView(InputOTPDemo()), icon: getIcon(icon: "FormInput")),
82
+ ScreenUsage(title: "ProgressInfo", destination: AnyView(ProgressInfoDemo()), icon: getIcon(icon: "Layout")),
83
+ ScreenUsage(title: "Steps", destination: AnyView(StepsDemo()), icon: getIcon(icon: "Layout")),
84
+ ScreenUsage(title: "Slider", destination: AnyView(SliderDemo()), icon: getIcon(icon: "Layout")),
85
+ ScreenUsage(title: "TabView", destination: AnyView(TabViewDemo()), icon: getIcon(icon: "Layout")),
86
+ ScreenUsage(title: "Tooltip", destination: AnyView(TooltipDemo()), icon: getIcon(icon: "Layout")),
87
+ ScreenUsage(title: "DateTimePicker", destination: AnyView(DateTimePickerDemo()), icon: getIcon(icon: "Layout")),
88
+ ScreenUsage(title: "Navigation", destination: AnyView(NavigationDemo()), icon: getIcon(icon: "Layout")),
89
+ ScreenUsage(title: "Bottom Tab", destination: AnyView(BottomTabDemo()), icon: getIcon(icon: "Layout")),
90
+ ScreenUsage(title: "Animated Header", destination: AnyView(AnimatedHeaderDemo()), icon: getIcon(icon: "Layout")),
91
+ ScreenUsage(title: "Theme", destination: AnyView(ThemeDemo()), icon: getIcon(icon: "Typography")),
92
+ ]
93
+
94
+ @available(iOS 16.0, *)
95
+ public struct HomeView: View {
96
+ // Mirrors Compose's `inputSearch` state: bound into the header search and
97
+ // forwarded into the content for filtering.
98
+ @State private var searchText = ""
99
+
100
+ public init() {}
101
+
102
+ public var body: some View {
103
+ NavigationContainer(
104
+ initialScreen: { HomeContentView(searchText: $searchText) },
105
+ options: NavigationOptions(
106
+ // headerTitle = HeaderTitle.Default("Design System")
107
+ title: "Design System",
108
+ titlePosition: .left,
109
+ // headerType = HeaderType.Extended(useAnimated = true, ...)
110
+ headerType: .extended,
111
+ useAnimated: true,
112
+ // hiddenBack = false
113
+ hiddenBack: false,
114
+ scrollable: true,
115
+ useAvoidKeyboard: true,
116
+ // keyboardOptions = KeyboardOptions(keyboardShouldPersistTaps = true)
117
+ keyboardShouldPersistTaps: true,
118
+ // headerRight = HeaderRight.Toolkit(useShortcut = true)
119
+ headerRight: {
120
+ HeaderRight(headerRight: HeaderRightData(useShortcut: true))
121
+ },
122
+ // footerComponent = { Button("Footer Button") }
123
+ footer: {
124
+ AnyView(
125
+ MoMoUIKits.Button(
126
+ title: "Footer Button",
127
+ action: { print("Footer Button") },
128
+ type: .primary,
129
+ size: .large
130
+ )
131
+ )
132
+ },
133
+ // inputSearchProps = InputSearchProps(text = inputSearch, placeholder = "Search input",
134
+ // searchIcon = { Image("...search_ai.png") }, placeholderCustomRender = { gradient Text }, ...)
135
+ inputSearchProps: InputSearchProps(
136
+ text: $searchText,
137
+ placeholder: "Search input",
138
+ onChangeText: { newText in
139
+ searchText = newText.replacingOccurrences(of: "\n", with: " ")
140
+ },
141
+ searchIcon: {
142
+ AnyView(
143
+ ImageView("https://static.momocdn.net/app/app/appx/search_ai.png")
144
+ .frame(width: 24, height: 24)
145
+ .padding(.trailing, Spacing.S)
146
+ )
147
+ },
148
+ placeholderCustomRender: {
149
+ AnyView(
150
+ Text("Search input")
151
+ .font(.header_xs_semibold)
152
+ .lineLimit(1)
153
+ .foregroundStyle(
154
+ LinearGradient(
155
+ colors: [
156
+ Color(hex: 0x18A0FB),
157
+ Color(hex: 0xA851FF),
158
+ Color(hex: 0xFD5FA9),
159
+ Color(hex: 0xFF9040)
160
+ ],
161
+ startPoint: .topLeading,
162
+ endPoint: .bottomTrailing
163
+ )
164
+ )
165
+ )
166
+ }
167
+ ),
168
+ // floatingButtonProps = FloatingButtonProps(icon = "ic_warning", iconColor = White,
169
+ // label = "Warning", size = DEFAULT, position = END)
170
+ // Note: "ic_warning" is an Android asset key; the closest rendering iOS icon URL is used here.
171
+ fabProps: FabProps(
172
+ icon: "https://static.momocdn.net/app/img/authentication/floating_helper.png",
173
+ iconColor: .white,
174
+ label: "Warning",
175
+ onClick: { print("Warning") },
176
+ containerColor: Colors.primary,
177
+ size: .large,
178
+ scrollOffset: nil,
179
+ position: .right,
180
+ bottomPadding: nil
181
+ )
182
+ )
183
+ )
184
+ }
185
+ }
186
+
187
+ @available(iOS 16.0, *)
188
+ public struct HomeContentView: View {
189
+ // Search lives in the header (inputSearchProps); the bound value flows here
190
+ // for filtering, mirroring Compose's `UIKitHome(searchQuery = inputSearch.value)`.
191
+ @Binding var searchText: String
192
+
193
+ public init(searchText: Binding<String>) {
194
+ self._searchText = searchText
195
+ }
196
+
197
+ private var filteredScreenUsages: [ScreenUsage] {
198
+ if searchText.isEmpty {
199
+ return ScreenUsages
200
+ }
201
+ return ScreenUsages.filter { $0.title.localizedCaseInsensitiveContains(searchText) }
202
+ }
203
+
204
+ public var body: some View {
205
+ ScrollView {
206
+ VStack(alignment: .leading, spacing: 16) {
207
+ HomeItemView(screenUsages: filteredScreenUsages)
208
+ }
209
+ }
210
+ }
211
+ }
212
+
213
+ @available(iOS 16.0, *)
214
+ public struct HomeItemView: View {
215
+ @EnvironmentObject var navigator: Navigator
216
+ let screenUsages: [ScreenUsage]
217
+
218
+ public init(screenUsages: [ScreenUsage]) {
219
+ self.screenUsages = screenUsages
220
+ }
221
+
222
+ public var body: some View {
223
+ ForEach(screenUsages) { screenUsage in
224
+ SwiftUI.Button {
225
+ let options = screenUsage.title == "Bottom Tab"
226
+ ? NavigationOptions(
227
+ title: screenUsage.title,
228
+ headerType: .none,
229
+ scrollable: false
230
+ )
231
+ : NavigationOptions(title: screenUsage.title)
232
+ navigator.push(
233
+ { screenUsage.destination },
234
+ options: options
235
+ )
236
+ } label: {
237
+ itemRow(screenUsage)
238
+ }
239
+ }
240
+ }
241
+
242
+ @ViewBuilder
243
+ private func itemRow(_ screenUsage: ScreenUsage) -> some View {
244
+ VStack(alignment: .leading) {
245
+ HStack {
246
+ ImageView(screenUsage.icon).frame(width: 26, height: 26)
247
+ MomoText(screenUsage.title)
248
+ }
249
+ Divider()
250
+ }
251
+ .padding(.horizontal, 16)
252
+ .padding(.vertical, 8)
253
+ }
254
+ }
255
+
256
+ @available(iOS 16.0, *)
257
+ public struct HomeView_Previews: PreviewProvider {
258
+ public static var previews: some View {
259
+ HomeView()
260
+ }
261
+ }
@@ -0,0 +1,58 @@
1
+ import MoMoUIKits
2
+ import SwiftUI
3
+
4
+ // MARK: - IconButtonDemo
5
+
6
+ struct IconButtonDemo: View {
7
+ var body: some View {
8
+ ScrollView {
9
+ VStack(alignment: .leading, spacing: 24) {
10
+ Group {
11
+ Text("Source")
12
+ .font(.headline)
13
+ HStack(spacing: 12) {
14
+ IconButton(icon: url, onClick: onPress, type: .primary)
15
+ IconButton(icon: url2, onClick: onPress, type: .primary)
16
+ IconButton(icon: url3, onClick: onPress, type: .primary)
17
+ IconButton(icon: url4, onClick: onPress, type: .primary)
18
+ }
19
+ }
20
+
21
+ Group {
22
+ Text("Type")
23
+ .font(.headline)
24
+ HStack(spacing: 12) {
25
+ IconButton(icon: url, onClick: onPress, type: .primary)
26
+ IconButton(icon: url, onClick: onPress, type: .secondary)
27
+ IconButton(icon: url, onClick: onPress, type: .tonal)
28
+ IconButton(icon: url, onClick: onPress, type: .outline)
29
+ IconButton(icon: url, onClick: onPress, type: .disabled)
30
+ IconButton(icon: url, onClick: onPress, type: .danger)
31
+ }
32
+ }
33
+
34
+ Group {
35
+ Text("Size")
36
+ .font(.headline)
37
+ HStack(spacing: 12) {
38
+ IconButton(icon: url, onClick: onPress, type: .primary, size: .large)
39
+ IconButton(icon: url, onClick: onPress, type: .primary, size: .small)
40
+ }
41
+ }
42
+ }
43
+ .padding(16)
44
+ }
45
+ .padding(.top)
46
+ }
47
+
48
+ func onPress() {
49
+ print("IconButton")
50
+ }
51
+
52
+ // MARK: Private
53
+
54
+ private let url = "travel_plane"
55
+ private let url2 = "shopping_coupon"
56
+ private let url3 = "shopping_store"
57
+ private let url4 = "time_alarm_check"
58
+ }
@@ -0,0 +1,78 @@
1
+ //
2
+ // ImageDemo.swift
3
+ // Example
4
+ //
5
+ // Created by dung.pham2 on 2/12/24.
6
+ //
7
+
8
+ import SwiftUI
9
+ import MoMoUIKits
10
+
11
+ struct ImageDemo: View {
12
+ // MARK: - Properties
13
+ @State private var time = 1000
14
+
15
+ // MARK: - Body
16
+ var body: some View {
17
+ NavigationView {
18
+ ScrollView {
19
+ VStack(spacing: 16) { // Equivalent to Spacing.M
20
+ HStack {
21
+ ImageView("https://source.unsplash.com/random/\(time)")
22
+ .frame(width: 100, height: 100)
23
+
24
+ Spacer()
25
+
26
+ ImageView("https://abc.com")
27
+ .frame(width: 100, height: 100)
28
+ }
29
+
30
+ ImageView("https://source.unsplash.com/random/\(time)")
31
+ .frame(maxWidth: .infinity)
32
+ .frame(height: 100)
33
+ .aspectRatio(contentMode: .fill)
34
+ .clipped()
35
+
36
+ ImageView("https://images.unsplash.com/photo-1509395062183-67c5ad6faff9")
37
+ .frame(maxWidth: .infinity)
38
+ .frame(height: 100)
39
+ .aspectRatio(contentMode: .fill)
40
+ .clipped()
41
+
42
+ ImageView("https://source.unsplash.com/random/\(time)")
43
+ .frame(maxWidth: .infinity)
44
+ .frame(height: 100)
45
+ .aspectRatio(contentMode: .fill)
46
+ .clipped()
47
+
48
+ ImageView("https://source.unsplash.com/random/\(time)")
49
+ .frame(maxWidth: .infinity)
50
+ .frame(height: 100)
51
+ .aspectRatio(contentMode: .fit)
52
+
53
+ ImageView("https://source.unsplash.com/random/\(time)")
54
+ .frame(maxWidth: .infinity)
55
+ .frame(height: 100)
56
+ .aspectRatio(contentMode: .fit)
57
+
58
+ ImageView("https://source.unsplash.com/random/\(time)")
59
+ .frame(maxWidth: .infinity)
60
+ .frame(height: 100)
61
+ .aspectRatio(contentMode: .fit)
62
+ }
63
+ .padding()
64
+ }
65
+ }
66
+ .onAppear {
67
+ startTimer()
68
+ }
69
+ }
70
+
71
+ // MARK: - Methods
72
+ private func startTimer() {
73
+ Timer.scheduledTimer(withTimeInterval: 5, repeats: true) { _ in
74
+ time = Int.random(in: 1...1000)
75
+ }
76
+ }
77
+ }
78
+
@@ -0,0 +1,138 @@
1
+ //
2
+ // InformationDemo.swift
3
+ // Example
4
+ //
5
+ // Created by product2 on 6/18/26.
6
+ //
7
+
8
+ import Foundation
9
+ import MoMoUIKits
10
+ import SwiftUI
11
+
12
+ // MARK: - InformationDemo
13
+
14
+ struct InformationDemo: View {
15
+ @State private var showDismissible = true
16
+
17
+ var body: some View {
18
+ ScrollView {
19
+ VStack(alignment: .leading, spacing: 24) {
20
+ // MARK: - States
21
+
22
+ section("States") {
23
+ Information(
24
+ title: "Default",
25
+ description: "This is a default information message.",
26
+ showIconClose: true,
27
+ onPressClose: {}
28
+ )
29
+ Information(
30
+ title: "Warning",
31
+ description: "This is a warning information message.",
32
+ state: .warning
33
+ )
34
+ Information(
35
+ title: "Error",
36
+ description: "This is an error information message.",
37
+ state: .error
38
+ )
39
+ }
40
+
41
+ // MARK: - Without title
42
+
43
+ section("Description only") {
44
+ Information(
45
+ description: "Information without a title, only a description."
46
+ )
47
+ Information(
48
+ description: "Warning without a title.",
49
+ state: .warning
50
+ )
51
+ }
52
+
53
+ // MARK: - With action
54
+
55
+ section("With action") {
56
+ Information(
57
+ title: "Update available",
58
+ description: "A new version is ready to install.",
59
+ onPressAction: { print("Action pressed") },
60
+ action: "Update now"
61
+ )
62
+ Information(
63
+ title: "Payment failed",
64
+ description: "We couldn't process your payment.",
65
+ state: .error,
66
+ onPressAction: { print("Retry pressed") },
67
+ action: "Retry"
68
+ )
69
+ }
70
+
71
+ // MARK: - With close button
72
+
73
+ section("Dismissible") {
74
+ if showDismissible {
75
+ Information(
76
+ title: "Dismissible",
77
+ description: "Tap the close icon to dismiss this banner.",
78
+ onPressClose: { showDismissible = false }
79
+ )
80
+ } else {
81
+ Information(
82
+ description: "Banner dismissed. Toggle to show again.",
83
+ state: .warning,
84
+ onPressAction: { showDismissible = true }, showIcon: true,
85
+ action: "Show again"
86
+
87
+ )
88
+ }
89
+ }
90
+
91
+ // MARK: - With image
92
+
93
+ section("With image") {
94
+ Information(
95
+ title: "Custom image",
96
+ description: "Uses a remote image instead of the state icon.",
97
+ image: "https://images.unsplash.com/photo-1509395062183-67c5ad6faff9",
98
+ onPressClose: { print("Close pressed") }
99
+ )
100
+ }
101
+
102
+ // MARK: - Without icon
103
+
104
+ section("Without icon") {
105
+ Information(
106
+ title: "No icon",
107
+ description: "showIcon is set to false.",
108
+ showIcon: false
109
+ )
110
+ }
111
+ }
112
+ .padding(.vertical, 16)
113
+ }
114
+ }
115
+
116
+ // MARK: - Helpers
117
+
118
+ @ViewBuilder
119
+ private func section<Content: View>(
120
+ _ title: String,
121
+ @ViewBuilder content: () -> Content
122
+ ) -> some View {
123
+ VStack(alignment: .leading, spacing: 12) {
124
+ Text(title)
125
+ .font(.headline)
126
+ content()
127
+ }
128
+ .padding(.horizontal, 16)
129
+ }
130
+ }
131
+
132
+ #if DEBUG
133
+ struct InformationDemo_Previews: PreviewProvider {
134
+ static var previews: some View {
135
+ InformationDemo()
136
+ }
137
+ }
138
+ #endif
@@ -0,0 +1,111 @@
1
+ //
2
+ // InputDemo.swift
3
+ // Example
4
+ //
5
+ // Created by dung.pham2 on 29/11/24.
6
+ //
7
+
8
+ import SwiftUI
9
+ import MoMoUIKits
10
+
11
+ struct InputDemo: View {
12
+ @State private var textValue1 = ""
13
+ @State private var textValue2 = ""
14
+ @State private var textValue3 = ""
15
+ @State private var textValue4 = ""
16
+ @State private var textValue5 = ""
17
+ @State private var textValue6 = ""
18
+ @State private var textValue7 = ""
19
+ @State private var textValue8 = ""
20
+ @State private var textValue9 = ""
21
+
22
+ var body: some View {
23
+ ScrollView {
24
+ VStack(alignment: .leading, spacing: 20) {
25
+ Text("Input Demo")
26
+ .font(.title1)
27
+
28
+ Group {
29
+ Text("Size")
30
+ .font(.headerText1)
31
+
32
+ Input(text: $textValue1, placeholder: "Small", size: .small, autofocus: true)
33
+ Input(text: $textValue1, placeholder: "Large", size: .large)
34
+ }
35
+
36
+ Group {
37
+ Text("Secure Text Entry")
38
+ .font(.headerText1)
39
+
40
+ Input(text: $textValue2, placeholder: "Enter here", floatingValue: "Momo", floatingIcon: "01.MoMo", secureTextEntry: true, autofocus: true)
41
+ Input(text: $textValue2, placeholder: "Enter here", floatingValue: "Momo", floatingIcon: "01.MoMo", size: .large, secureTextEntry: true)
42
+ }
43
+
44
+ Group {
45
+ Text("Floating Value")
46
+ .font(.headerText1)
47
+
48
+ Input(text: $textValue3, placeholder: "Enter here", floatingValue: "Momo", floatingIcon: "01.MoMo")
49
+
50
+ }
51
+
52
+ Group {
53
+ Text("Hint")
54
+ .font(.headerText1)
55
+
56
+ Input(text: $textValue4, placeholder: "Enter here", hintText: textValue4.isEmpty ? "Hint text" : textValue4 )
57
+ }
58
+
59
+ Group {
60
+ Text("Error")
61
+ .font(.headerText1)
62
+
63
+ Input(text: $textValue4, placeholder: "Enter here", error: textValue4.isEmpty ? "Error" : textValue4 )
64
+ }
65
+
66
+ Group {
67
+ Text("Disabled")
68
+ .font(.headerText1)
69
+
70
+ Input(text: $textValue5, placeholder: "Enter here", disabled: true, leadingIcon: "01.MoMo"
71
+ )
72
+ }
73
+
74
+ Group {
75
+ Text("Leading Icon")
76
+ .font(.headerText1)
77
+
78
+ Input(text: $textValue6, placeholder: "Leading Icon", floatingValue: "Small Input", leadingIcon: "01.MoMo"
79
+ )
80
+
81
+ Input(text: $textValue7, placeholder: "Leading Icon", floatingValue: "Large Input", size: .large, leadingIcon: "01.MoMo"
82
+ )
83
+ }
84
+
85
+ Group {
86
+ Text("Trailing Icon")
87
+ .font(.headerText1)
88
+
89
+ Input(text: $textValue8, placeholder: "Trailing Icon", floatingValue: "Trailing", rightIcon: "01.MoMo")
90
+ }
91
+
92
+ Group {
93
+ Text("Loading")
94
+ .font(.headerText1)
95
+
96
+ Input(text: $textValue8, placeholder: "Loading", floatingValue: "Loading", loading: true, required: true)
97
+ }
98
+
99
+ Group {
100
+ Text("Font Weight")
101
+ .font(.headerText1)
102
+
103
+ Input(text: $textValue9, placeholder: "Font Weight", floatingValue: "Regular Font Weight", required: true, fontWeight: .regular)
104
+
105
+ Input(text: $textValue9, placeholder: "Font Weight", floatingValue: "Bold Font Weight", required: true, fontWeight: .bold)
106
+ }
107
+ }
108
+ .padding()
109
+ }
110
+ }
111
+ }