@momo-kits/native-kits 0.162.2-debug → 0.162.2-sp.1

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 (278) hide show
  1. package/.claude/settings.local.json +55 -0
  2. package/ios/Application/Components.swift +34 -43
  3. package/ios/Application/FloatingButton.swift +10 -8
  4. package/ios/Application/Navigation/BottomTab/BottomTab.swift +102 -0
  5. package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +215 -0
  6. package/ios/Application/Navigation/BottomTab/CurvedContainer.swift +65 -0
  7. package/ios/Application/Navigation/HeaderBackProps.swift +66 -0
  8. package/ios/Application/Navigation/HeaderTitle.swift +57 -0
  9. package/ios/Application/Navigation/HeaderUser.swift +209 -0
  10. package/ios/Application/Navigation/NavigationContainer.swift +151 -0
  11. package/ios/Application/Navigation/NavigationOptions.swift +109 -0
  12. package/ios/Application/Navigation/Navigator.swift +360 -0
  13. package/ios/Application/Navigation/Overplay/BottomSheet.swift +176 -0
  14. package/ios/Application/Navigation/Overplay/ModalScreen.swift +68 -0
  15. package/ios/Application/Navigation/Overplay/SnackBar.swift +144 -0
  16. package/ios/Application/Navigation/component/Header.swift +178 -0
  17. package/ios/Application/Navigation/component/HeaderBackground.swift +83 -0
  18. package/ios/Application/Navigation/component/HeaderColor.swift +65 -0
  19. package/ios/Application/StackScreen.swift +449 -0
  20. package/ios/Avatar/Avatar.swift +193 -0
  21. package/ios/Badge/Badge.swift +11 -13
  22. package/ios/Badge/BadgeRibbon.swift +12 -19
  23. package/ios/BaselineView/BaselineView.swift +163 -0
  24. package/ios/Button/Button.swift +62 -23
  25. package/ios/Carousel/Carousel.swift +181 -0
  26. package/ios/Checkbox/Checkbox.swift +14 -12
  27. package/ios/Chip/Chip.swift +23 -9
  28. package/ios/Collapse/Collapse.swift +182 -0
  29. package/ios/Colors+Radius+Spacing/Colors.swift +1 -1
  30. package/ios/Colors+Radius+Spacing/Theme.swift +295 -0
  31. package/ios/DateTimePicker/DateTimePicker.swift +210 -0
  32. package/ios/DateTimePicker/DateTimePickerTypes.swift +55 -0
  33. package/ios/DateTimePicker/DateTimePickerUtils.swift +167 -0
  34. package/ios/DateTimePicker/WheelPicker.swift +161 -0
  35. package/ios/Divider/Divider.swift +16 -0
  36. package/ios/Icon/Icon.swift +6 -1
  37. package/ios/IconButton/IconButton.swift +112 -0
  38. package/ios/Information/Information.swift +151 -0
  39. package/ios/Input/Input.swift +42 -25
  40. package/ios/Input/InputPhoneNumber.swift +21 -19
  41. package/ios/Input/InputSearch.swift +101 -45
  42. package/ios/Input/InputTextArea.swift +67 -40
  43. package/ios/InputDropDown/InputDropDown.swift +198 -0
  44. package/ios/InputMoney/InputMoney.swift +335 -0
  45. package/ios/InputOTP/InputOTP.swift +210 -0
  46. package/ios/Loader/Loader.swift +113 -0
  47. package/ios/MoMoUIKits.podspec +5 -0
  48. package/ios/OTPKeyboard/KeyboardButton.swift +1 -1
  49. package/ios/Pagination/PaginationDot.swift +61 -0
  50. package/ios/Pagination/PaginationNumber.swift +35 -0
  51. package/ios/Pagination/PaginationScroll.swift +101 -0
  52. package/ios/Pagination/PaginationWhiteDot.swift +37 -0
  53. package/ios/Popup/PopupDisplay.swift +10 -12
  54. package/ios/Popup/PopupInput.swift +2 -6
  55. package/ios/Popup/PopupNotify.swift +219 -0
  56. package/ios/ProgressInfo/ProgressInfo.swift +294 -0
  57. package/ios/Radio/Radio.swift +70 -0
  58. package/ios/Rating/Rating.swift +82 -0
  59. package/ios/Skeleton/Skeleton.swift +99 -0
  60. package/ios/Slider/Slider.swift +237 -0
  61. package/ios/Stepper/Stepper.swift +220 -0
  62. package/ios/Steps/Steps.swift +451 -0
  63. package/ios/SuggestAction/SuggestAction.swift +97 -0
  64. package/ios/Swipeable/SwipeCell.swift +185 -0
  65. package/ios/Swipeable/SwipeCellModel.swift +21 -0
  66. package/ios/TabView/TabView.swift +530 -0
  67. package/ios/Tag/Tag.swift +98 -0
  68. package/ios/Template/TrustBanner/TrustBanner.swift +2 -0
  69. package/ios/Title/Title.swift +269 -0
  70. package/ios/Tooltip/Tooltip.swift +482 -0
  71. package/ios/Typography/Text.swift +77 -5
  72. package/ios/Typography/Typography.swift +9 -0
  73. package/ios/Uploader/Uploader.swift +183 -0
  74. package/ios/native-kits.podspec +58 -8
  75. package/ios-demo/MoMoUIKitsDemo.podspec +18 -0
  76. package/ios-demo/Resources/dot_loading.json +558 -0
  77. package/ios-demo/Resources/icon.json +4052 -0
  78. package/ios-demo/Resources/lottie_circle_loader.json +1 -0
  79. package/ios-demo/Sources/MoMoUIKitsDemo/DemoScaffold.swift +48 -0
  80. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsBadgeDemoView.swift +25 -0
  81. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsButtonDemoView.swift +26 -0
  82. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsCheckboxDemoView.swift +19 -0
  83. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsChipDemoView.swift +33 -0
  84. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsInputDemoView.swift +48 -0
  85. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsPopupDemoView.swift +21 -0
  86. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsRadioDemoView.swift +17 -0
  87. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsTypographyDemoView.swift +28 -0
  88. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoContext.swift +31 -0
  89. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoFactory.swift +72 -0
  90. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +110 -0
  91. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AvatarDemo.swift +93 -0
  92. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BadgeDemo.swift +269 -0
  93. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BaselineView.swift +117 -0
  94. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +89 -0
  95. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ButtonDemo.swift +100 -0
  96. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CarouselDemo.swift +126 -0
  97. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CheckboxDemo.swift +63 -0
  98. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ChipDemo.swift +20 -0
  99. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CollapseDemo.swift +93 -0
  100. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +107 -0
  101. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DateTimePickerDemo.swift +124 -0
  102. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DividerDemo.swift +14 -0
  103. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/HeaderUserDemo.swift +49 -0
  104. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +261 -0
  105. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconButtonDemo.swift +58 -0
  106. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ImageDemo.swift +78 -0
  107. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InformationDemo.swift +138 -0
  108. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDemo.swift +111 -0
  109. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDropDownDemo.swift +136 -0
  110. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputMoneyDemo.swift +107 -0
  111. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputOTPDemo.swift +73 -0
  112. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +100 -0
  113. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputSearchDemo.swift +32 -0
  114. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputTextAreaDemo.swift +57 -0
  115. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LoaderDemo.swift +70 -0
  116. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +227 -0
  117. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PaginationDemo.swift +72 -0
  118. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +175 -0
  119. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +121 -0
  120. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +76 -0
  121. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ProgressInfoDemo.swift +89 -0
  122. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RadioDemo.swift +32 -0
  123. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RatingDemo.swift +56 -0
  124. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SkeletonDemo.swift +32 -0
  125. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SliderDemo.swift +150 -0
  126. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SnackBarDemo.swift +138 -0
  127. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepperDemo.swift +103 -0
  128. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepsDemo.swift +94 -0
  129. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SuggestActionDemo.swift +79 -0
  130. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwipeDemo.swift +152 -0
  131. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwitchDemo.swift +33 -0
  132. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TabViewDemo.swift +190 -0
  133. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TagDemo.swift +34 -0
  134. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ThemeDemo.swift +182 -0
  135. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TitleDemo.swift +109 -0
  136. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TooltipDemo.swift +187 -0
  137. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +87 -0
  138. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/UploaderDemo.swift +131 -0
  139. package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +50 -0
  140. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoModels.swift +15 -0
  141. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoRegistry.swift +73 -0
  142. package/package.json +1 -1
  143. package/publish.sh +50 -0
  144. package/scripts/gen-ios-color.mjs +136 -0
  145. package/build.gradle.kts +0 -11
  146. package/compose/build.gradle.kts +0 -186
  147. package/compose/build.gradle.kts.backup +0 -186
  148. package/compose/compose.podspec +0 -47
  149. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +0 -6
  150. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -123
  151. package/compose/src/commonMain/composeResources/font/momosignature.otf +0 -0
  152. package/compose/src/commonMain/composeResources/font/momotrustdisplay.otf +0 -0
  153. package/compose/src/commonMain/composeResources/font/sfprotext_black.otf +0 -0
  154. package/compose/src/commonMain/composeResources/font/sfprotext_black.ttf +0 -0
  155. package/compose/src/commonMain/composeResources/font/sfprotext_bold.ttf +0 -0
  156. package/compose/src/commonMain/composeResources/font/sfprotext_heavy.ttf +0 -0
  157. package/compose/src/commonMain/composeResources/font/sfprotext_light.ttf +0 -0
  158. package/compose/src/commonMain/composeResources/font/sfprotext_medium.ttf +0 -0
  159. package/compose/src/commonMain/composeResources/font/sfprotext_regular.ttf +0 -0
  160. package/compose/src/commonMain/composeResources/font/sfprotext_semibold.ttf +0 -0
  161. package/compose/src/commonMain/composeResources/font/sfprotext_thin.otf +0 -0
  162. package/compose/src/commonMain/composeResources/font/sfprotext_thin.ttf +0 -0
  163. package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.otf +0 -0
  164. package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.ttf +0 -0
  165. package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +0 -57
  166. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -109
  167. package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +0 -201
  168. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +0 -222
  169. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +0 -48
  170. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +0 -86
  171. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +0 -76
  172. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +0 -76
  173. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +0 -305
  174. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +0 -33
  175. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -921
  176. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +0 -121
  177. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +0 -403
  178. package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +0 -69
  179. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +0 -157
  180. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +0 -85
  181. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +0 -32
  182. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +0 -340
  183. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -198
  184. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +0 -357
  185. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -123
  186. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -94
  187. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +0 -136
  188. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +0 -224
  189. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -543
  190. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +0 -23
  191. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +0 -76
  192. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +0 -148
  193. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +0 -188
  194. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +0 -116
  195. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -452
  196. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +0 -172
  197. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +0 -255
  198. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -235
  199. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +0 -233
  200. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +0 -259
  201. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +0 -241
  202. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +0 -364
  203. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +0 -108
  204. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +0 -56
  205. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +0 -41
  206. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -92
  207. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +0 -40
  208. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +0 -352
  209. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +0 -103
  210. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -338
  211. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +0 -70
  212. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +0 -87
  213. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -17
  214. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -96
  215. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +0 -348
  216. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +0 -256
  217. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +0 -494
  218. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +0 -131
  219. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -215
  220. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -96
  221. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -531
  222. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -92
  223. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +0 -135
  224. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +0 -214
  225. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +0 -590
  226. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +0 -177
  227. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +0 -192
  228. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +0 -205
  229. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +0 -29
  230. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +0 -239
  231. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -191
  232. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +0 -306
  233. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +0 -12
  234. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +0 -16
  235. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +0 -188
  236. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -285
  237. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +0 -2
  238. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +0 -35
  239. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +0 -2
  240. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -57
  241. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -68
  242. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +0 -11
  243. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -14
  244. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -50
  245. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +0 -51
  246. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +0 -253
  247. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +0 -133
  248. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -104
  249. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -145
  250. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +0 -345
  251. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +0 -8
  252. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +0 -556
  253. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +0 -161
  254. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -243
  255. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -86
  256. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -187
  257. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +0 -315
  258. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -80
  259. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +0 -306
  260. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -34
  261. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +0 -370
  262. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -131
  263. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -167
  264. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -72
  265. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -66
  266. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +0 -1329
  267. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +0 -70
  268. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +0 -15
  269. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +0 -105
  270. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +0 -33
  271. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -186
  272. package/gradle/libs.versions.toml +0 -67
  273. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  274. package/gradle/wrapper/gradle-wrapper.properties +0 -8
  275. package/gradle.properties +0 -26
  276. package/gradlew +0 -252
  277. package/gradlew.bat +0 -94
  278. package/settings.gradle.kts +0 -64
@@ -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
+ }