@momo-kits/native-kits 0.163.1-beta.2-debug → 0.163.1-beta.20-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 (245) hide show
  1. package/.claude/settings.local.json +112 -0
  2. package/CLAUDE.md +1 -1
  3. package/compose/build.gradle.kts +2 -1
  4. package/compose/build.gradle.kts.backup +1 -0
  5. package/compose/compose.podspec +1 -1
  6. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +7 -0
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +30 -3
  8. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +8 -10
  9. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +2 -3
  10. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +3 -0
  11. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +56 -0
  12. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +11 -9
  13. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -1
  14. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +40 -55
  15. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +69 -26
  16. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +5 -5
  17. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +3 -1
  18. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +21 -0
  19. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +3 -6
  20. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +19 -0
  21. package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitFontScale.kt +22 -0
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +28 -21
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +50 -0
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +25 -22
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +37 -0
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +68 -22
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +1 -1
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +7 -1
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +112 -115
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +15 -3
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +33 -9
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +6 -5
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +3 -1
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +2 -1
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -1
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +23 -2
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +9 -0
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +11 -0
  39. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +66 -0
  40. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +26 -3
  41. package/gradle/libs.versions.toml +2 -0
  42. package/gradle.properties +1 -1
  43. package/ios/Application/ApplicationEnvironment.swift +15 -3
  44. package/ios/Application/Components.swift +36 -30
  45. package/ios/Application/FloatingButton.swift +10 -9
  46. package/ios/Application/Localize.swift +309 -0
  47. package/ios/Application/MaxApi.swift +18 -0
  48. package/ios/Application/Navigation/BottomTab/BottomTab.swift +104 -0
  49. package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +215 -0
  50. package/ios/Application/Navigation/BottomTab/CurvedContainer.swift +65 -0
  51. package/ios/Application/Navigation/HeaderBackProps.swift +66 -0
  52. package/ios/Application/Navigation/HeaderTitle.swift +57 -0
  53. package/ios/Application/Navigation/HeaderUser.swift +209 -0
  54. package/ios/Application/Navigation/NavigationContainer.swift +203 -0
  55. package/ios/Application/Navigation/NavigationOptions.swift +109 -0
  56. package/ios/Application/Navigation/Navigator.swift +385 -0
  57. package/ios/Application/Navigation/Overplay/BottomSheet.swift +256 -0
  58. package/ios/Application/Navigation/Overplay/ModalScreen.swift +74 -0
  59. package/ios/Application/Navigation/Overplay/SnackBar.swift +144 -0
  60. package/ios/Application/Navigation/Tracking/ScreenTracker.swift +117 -0
  61. package/ios/Application/Navigation/component/Header.swift +178 -0
  62. package/ios/Application/Navigation/component/HeaderBackground.swift +83 -0
  63. package/ios/Application/Navigation/component/HeaderColor.swift +65 -0
  64. package/ios/Application/Navigation/component/HeaderRightWidthKey.swift +11 -0
  65. package/ios/Application/Navigation/component/NavigationHeaderRight.swift +196 -0
  66. package/ios/Application/Screen.swift +2 -1
  67. package/ios/Application/StackScreen.swift +501 -0
  68. package/ios/Avatar/Avatar.swift +193 -0
  69. package/ios/Badge/Badge.swift +11 -14
  70. package/ios/Badge/BadgeRibbon.swift +91 -17
  71. package/ios/BaselineView/BaselineView.swift +163 -0
  72. package/ios/Button/Button.swift +137 -28
  73. package/ios/Carousel/Carousel.swift +196 -0
  74. package/ios/Checkbox/Checkbox.swift +23 -28
  75. package/ios/Chip/Chip.swift +56 -33
  76. package/ios/Collapse/Collapse.swift +192 -0
  77. package/ios/Colors+Radius+Spacing/Colors.swift +20 -17
  78. package/ios/Colors+Radius+Spacing/Spacing.swift +3 -1
  79. package/ios/Colors+Radius+Spacing/Theme.swift +295 -0
  80. package/ios/DateTimePicker/DateTimePicker.swift +212 -0
  81. package/ios/DateTimePicker/DateTimePickerTypes.swift +55 -0
  82. package/ios/DateTimePicker/DateTimePickerUtils.swift +167 -0
  83. package/ios/DateTimePicker/WheelPicker.swift +165 -0
  84. package/ios/Divider/Divider.swift +16 -0
  85. package/ios/Extensions/ActiveOpacityButtonStyle.swift +14 -0
  86. package/ios/Extensions/Color++.swift +32 -0
  87. package/ios/Icon/Icon.swift +10 -1
  88. package/ios/IconButton/IconButton.swift +140 -0
  89. package/ios/Image/Image.swift +16 -3
  90. package/ios/Information/Information.swift +3 -1
  91. package/ios/Input/ErrorView.swift +3 -1
  92. package/ios/Input/Input.swift +72 -33
  93. package/ios/Input/InputPhoneNumber.swift +33 -21
  94. package/ios/Input/InputSearch.swift +107 -48
  95. package/ios/Input/InputTextArea.swift +134 -64
  96. package/ios/InputDropDown/InputDropDown.swift +201 -0
  97. package/ios/InputMoney/InputMoney.swift +347 -0
  98. package/ios/InputOTP/InputOTP.swift +210 -0
  99. package/ios/Loader/Loader.swift +113 -0
  100. package/ios/MoMoUIKits.podspec +5 -0
  101. package/ios/Pagination/PaginationDot.swift +61 -0
  102. package/ios/Pagination/PaginationNumber.swift +35 -0
  103. package/ios/Pagination/PaginationScroll.swift +101 -0
  104. package/ios/Pagination/PaginationWhiteDot.swift +37 -0
  105. package/ios/Popup/PopupDisplay.swift +11 -20
  106. package/ios/Popup/PopupInput.swift +2 -8
  107. package/ios/Popup/PopupNotify.swift +218 -0
  108. package/ios/Popup/PopupPromotion.swift +5 -3
  109. package/ios/ProgressInfo/ProgressInfo.swift +296 -0
  110. package/ios/Radio/Radio.swift +69 -0
  111. package/ios/Rating/Rating.swift +82 -0
  112. package/ios/Resources/MoMoUIKitsColors.xcassets/AccentColor.colorset/Contents.json +11 -0
  113. package/ios/Resources/MoMoUIKitsColors.xcassets/Background.colorset/Contents.json +38 -0
  114. package/ios/Resources/MoMoUIKitsColors.xcassets/Border.colorset/Contents.json +38 -0
  115. package/ios/Resources/MoMoUIKitsColors.xcassets/Card.colorset/Contents.json +38 -0
  116. package/ios/Resources/MoMoUIKitsColors.xcassets/Contents.json +6 -0
  117. package/ios/Resources/MoMoUIKitsColors.xcassets/Error.colorset/Contents.json +38 -0
  118. package/ios/Resources/MoMoUIKitsColors.xcassets/Primary.colorset/Contents.json +38 -0
  119. package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryDark.colorset/Contents.json +38 -0
  120. package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryLight.colorset/Contents.json +38 -0
  121. package/ios/Resources/MoMoUIKitsColors.xcassets/Secondary.colorset/Contents.json +38 -0
  122. package/ios/Resources/MoMoUIKitsColors.xcassets/Success.colorset/Contents.json +38 -0
  123. package/ios/Resources/MoMoUIKitsColors.xcassets/Text.colorset/Contents.json +38 -0
  124. package/ios/Resources/MoMoUIKitsColors.xcassets/TextSecondary.colorset/Contents.json +38 -0
  125. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/Contents.json +9 -0
  126. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-default.colorset/Contents.json +38 -0
  127. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-disable.colorset/Contents.json +38 -0
  128. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-pressed.colorset/Contents.json +38 -0
  129. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-selected.colorset/Contents.json +38 -0
  130. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-surface.colorset/Contents.json +38 -0
  131. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-tonal.colorset/Contents.json +38 -0
  132. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-default.colorset/Contents.json +38 -0
  133. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-disable.colorset/Contents.json +38 -0
  134. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/gradient.colorset/Contents.json +38 -0
  135. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/primary.colorset/Contents.json +38 -0
  136. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/secondary.colorset/Contents.json +38 -0
  137. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-container.colorset/Contents.json +38 -0
  138. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-primary.colorset/Contents.json +38 -0
  139. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-secondary.colorset/Contents.json +38 -0
  140. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-default.colorset/Contents.json +38 -0
  141. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-disable.colorset/Contents.json +38 -0
  142. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-hint.colorset/Contents.json +38 -0
  143. package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-secondary.colorset/Contents.json +38 -0
  144. package/ios/Resources/MoMoUIKitsColors.xcassets/Warning.colorset/Contents.json +38 -0
  145. package/ios/Skeleton/Skeleton.swift +99 -0
  146. package/ios/Slider/Slider.swift +237 -0
  147. package/ios/Stepper/Stepper.swift +220 -0
  148. package/ios/Steps/Steps.swift +467 -0
  149. package/ios/SuggestAction/SuggestAction.swift +99 -0
  150. package/ios/Swipeable/SwipeCell.swift +187 -0
  151. package/ios/Swipeable/SwipeCellModel.swift +21 -0
  152. package/ios/Switch/Switch.swift +53 -28
  153. package/ios/TabView/TabView.swift +534 -0
  154. package/ios/Tag/Tag.swift +98 -0
  155. package/ios/Template/TrustBanner/TrustBanner.swift +7 -8
  156. package/ios/Title/Title.swift +269 -0
  157. package/ios/Tooltip/Tooltip.swift +485 -0
  158. package/ios/Typography/FontScaleStore.swift +19 -0
  159. package/ios/Typography/Text.swift +86 -17
  160. package/ios/Typography/Typography.swift +12 -14
  161. package/ios/Uploader/Uploader.swift +174 -0
  162. package/ios/native-kits.podspec +61 -8
  163. package/ios-demo/MoMoUIKitsDemo.podspec +20 -0
  164. package/ios-demo/README.md +120 -0
  165. package/ios-demo/Resources/dot_loading.json +558 -0
  166. package/ios-demo/Resources/icon.json +4052 -0
  167. package/ios-demo/Resources/lottie_circle_loader.json +1 -0
  168. package/ios-demo/Sources/MoMoUIKitsDemo/DemoScaffold.swift +48 -0
  169. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsBadgeDemoView.swift +25 -0
  170. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsButtonDemoView.swift +26 -0
  171. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsCheckboxDemoView.swift +19 -0
  172. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsChipDemoView.swift +33 -0
  173. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsInputDemoView.swift +48 -0
  174. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsPopupDemoView.swift +21 -0
  175. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsRadioDemoView.swift +17 -0
  176. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsTypographyDemoView.swift +28 -0
  177. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoContext.swift +31 -0
  178. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoFactory.swift +24 -0
  179. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +110 -0
  180. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AvatarDemo.swift +93 -0
  181. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BadgeDemo.swift +269 -0
  182. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BaselineView.swift +117 -0
  183. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +89 -0
  184. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ButtonDemo.swift +100 -0
  185. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CarouselDemo.swift +126 -0
  186. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CheckboxDemo.swift +64 -0
  187. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ChipDemo.swift +20 -0
  188. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CollapseDemo.swift +93 -0
  189. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +107 -0
  190. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DateTimePickerDemo.swift +124 -0
  191. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DividerDemo.swift +14 -0
  192. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/HeaderUserDemo.swift +49 -0
  193. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +279 -0
  194. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconButtonDemo.swift +58 -0
  195. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ImageDemo.swift +78 -0
  196. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InformationDemo.swift +138 -0
  197. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDemo.swift +111 -0
  198. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDropDownDemo.swift +136 -0
  199. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputMoneyDemo.swift +107 -0
  200. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputOTPDemo.swift +73 -0
  201. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +100 -0
  202. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputSearchDemo.swift +32 -0
  203. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputTextAreaDemo.swift +57 -0
  204. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LoaderDemo.swift +70 -0
  205. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LocalizeDemo.swift +188 -0
  206. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +229 -0
  207. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PaginationDemo.swift +72 -0
  208. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +175 -0
  209. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +121 -0
  210. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +76 -0
  211. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ProgressInfoDemo.swift +89 -0
  212. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RadioDemo.swift +32 -0
  213. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RatingDemo.swift +56 -0
  214. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SkeletonDemo.swift +32 -0
  215. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SliderDemo.swift +150 -0
  216. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SnackBarDemo.swift +138 -0
  217. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepperDemo.swift +103 -0
  218. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepsDemo.swift +94 -0
  219. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SuggestActionDemo.swift +79 -0
  220. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwipeDemo.swift +152 -0
  221. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwitchDemo.swift +33 -0
  222. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TabViewDemo.swift +190 -0
  223. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TagDemo.swift +34 -0
  224. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ThemeDemo.swift +182 -0
  225. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TitleDemo.swift +109 -0
  226. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TooltipDemo.swift +187 -0
  227. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +87 -0
  228. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/UploaderDemo.swift +131 -0
  229. package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +51 -0
  230. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoModels.swift +15 -0
  231. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoRegistry.swift +73 -0
  232. package/local.properties +2 -2
  233. package/package.json +1 -1
  234. package/publish.sh +53 -0
  235. package/scripts/gen-ios-color.mjs +136 -0
  236. package/example/ios/Example.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  237. package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  238. package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -5
  239. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
  240. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
  241. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImage.xcscheme +0 -58
  242. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +0 -58
  243. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SkeletonUI.xcscheme +0 -58
  244. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -46
  245. package/ios/Application/FontScaleStore.swift +0 -59
@@ -0,0 +1,279 @@
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
+ ScreenUsage(title: "Localize", destination: AnyView(LocalizeDemo()), icon: getIcon(icon: "Typography")),
93
+ ]
94
+
95
+ @available(iOS 16.0, *)
96
+ public struct HomeView: View {
97
+ // Mirrors Compose's `inputSearch` state: bound into the header search and
98
+ // forwarded into the content for filtering.
99
+ @State private var searchText = ""
100
+ private let onOpenCompose: () -> Void
101
+ private let applicationContext: MiniAppContext?
102
+ private let composeApi: KitComposeApi?
103
+ private let config: KitConfig?
104
+
105
+ public init(
106
+ onOpenCompose: @escaping () -> Void = {},
107
+ applicationContext: MiniAppContext? = nil,
108
+ composeApi: KitComposeApi? = nil,
109
+ config: KitConfig? = nil
110
+ ) {
111
+ self.onOpenCompose = onOpenCompose
112
+ self.applicationContext = applicationContext
113
+ self.composeApi = composeApi
114
+ self.config = config
115
+ }
116
+
117
+ public var body: some View {
118
+ NavigationContainer(
119
+ initialScreen: { HomeContentView(searchText: $searchText) },
120
+ options: NavigationOptions(
121
+ // headerTitle = HeaderTitle.Default("Design System")
122
+ title: "Design System",
123
+ titlePosition: .left,
124
+ // headerType = HeaderType.Extended(useAnimated = true, ...)
125
+ headerType: .extended,
126
+ useAnimated: true,
127
+ // hiddenBack = false
128
+ hiddenBack: false,
129
+ scrollable: true,
130
+ useAvoidKeyboard: true,
131
+ // keyboardOptions = KeyboardOptions(keyboardShouldPersistTaps = true)
132
+ keyboardShouldPersistTaps: true,
133
+ // headerRight = HeaderRight.Toolkit(useShortcut = true)
134
+ headerRight: {
135
+ HeaderRight(headerRight: HeaderRightData(useShortcut: true))
136
+ },
137
+ // footerComponent = { Button("Footer Button") }
138
+ footer: {
139
+ AnyView(
140
+ MoMoUIKits.Button(
141
+ title: "Footer Button",
142
+ action: onOpenCompose,
143
+ type: .primary,
144
+ size: .large
145
+ )
146
+ )
147
+ },
148
+ // inputSearchProps = InputSearchProps(text = inputSearch, placeholder = "Search input",
149
+ // searchIcon = { Image("...search_ai.png") }, placeholderCustomRender = { gradient Text }, ...)
150
+ inputSearchProps: InputSearchProps(
151
+ text: $searchText,
152
+ placeholder: "Search input",
153
+ onChangeText: { newText in
154
+ searchText = newText.replacingOccurrences(of: "\n", with: " ")
155
+ },
156
+ searchIcon: {
157
+ AnyView(
158
+ ImageView("https://static.momocdn.net/app/app/appx/search_ai.png")
159
+ .frame(width: 24, height: 24)
160
+ .padding(.trailing, Spacing.S)
161
+ )
162
+ },
163
+ placeholderCustomRender: {
164
+ AnyView(
165
+ Text("Search input")
166
+ .font(.header_xs_semibold)
167
+ .lineLimit(1)
168
+ .foregroundStyle(
169
+ LinearGradient(
170
+ colors: [
171
+ Color(hex: 0x18A0FB),
172
+ Color(hex: 0xA851FF),
173
+ Color(hex: 0xFD5FA9),
174
+ Color(hex: 0xFF9040)
175
+ ],
176
+ startPoint: .topLeading,
177
+ endPoint: .bottomTrailing
178
+ )
179
+ )
180
+ )
181
+ }
182
+ ),
183
+ // floatingButtonProps = FloatingButtonProps(icon = "ic_warning", iconColor = White,
184
+ // label = "Warning", size = DEFAULT, position = END)
185
+ // Note: "ic_warning" is an Android asset key; the closest rendering iOS icon URL is used here.
186
+ fabProps: FabProps(
187
+ icon: "https://static.momocdn.net/app/img/authentication/floating_helper.png",
188
+ iconColor: .white,
189
+ label: "Warning",
190
+ onClick: { print("Warning") },
191
+ containerColor: Colors.primary,
192
+ size: .large,
193
+ scrollOffset: nil,
194
+ position: .right,
195
+ bottomPadding: nil
196
+ )
197
+ ),
198
+ applicationContext: applicationContext,
199
+ composeApi: composeApi,
200
+ config: config
201
+ )
202
+ }
203
+ }
204
+
205
+ @available(iOS 16.0, *)
206
+ public struct HomeContentView: View {
207
+ // Search lives in the header (inputSearchProps); the bound value flows here
208
+ // for filtering, mirroring Compose's `UIKitHome(searchQuery = inputSearch.value)`.
209
+ @Binding var searchText: String
210
+
211
+ public init(searchText: Binding<String>) {
212
+ self._searchText = searchText
213
+ }
214
+
215
+ private var filteredScreenUsages: [ScreenUsage] {
216
+ if searchText.isEmpty {
217
+ return ScreenUsages
218
+ }
219
+ return ScreenUsages.filter { $0.title.localizedCaseInsensitiveContains(searchText) }
220
+ }
221
+
222
+ public var body: some View {
223
+ ScrollView {
224
+ VStack(alignment: .leading, spacing: 16) {
225
+ HomeItemView(screenUsages: filteredScreenUsages)
226
+ }
227
+ }
228
+ }
229
+ }
230
+
231
+ @available(iOS 16.0, *)
232
+ public struct HomeItemView: View {
233
+ @EnvironmentObject var navigator: Navigator
234
+ let screenUsages: [ScreenUsage]
235
+
236
+ public init(screenUsages: [ScreenUsage]) {
237
+ self.screenUsages = screenUsages
238
+ }
239
+
240
+ public var body: some View {
241
+ ForEach(screenUsages) { screenUsage in
242
+ SwiftUI.Button {
243
+ let options = screenUsage.title == "Bottom Tab"
244
+ ? NavigationOptions(
245
+ title: screenUsage.title,
246
+ headerType: .none,
247
+ scrollable: false
248
+ )
249
+ : NavigationOptions(title: screenUsage.title)
250
+ navigator.push(
251
+ { screenUsage.destination },
252
+ options: options
253
+ )
254
+ } label: {
255
+ itemRow(screenUsage)
256
+ }
257
+ }
258
+ }
259
+
260
+ @ViewBuilder
261
+ private func itemRow(_ screenUsage: ScreenUsage) -> some View {
262
+ VStack(alignment: .leading) {
263
+ HStack {
264
+ ImageView(screenUsage.icon).frame(width: 26, height: 26)
265
+ MomoText(screenUsage.title)
266
+ }
267
+ Divider()
268
+ }
269
+ .padding(.horizontal, 16)
270
+ .padding(.vertical, 8)
271
+ }
272
+ }
273
+
274
+ @available(iOS 16.0, *)
275
+ public struct HomeView_Previews: PreviewProvider {
276
+ public static var previews: some View {
277
+ HomeView()
278
+ }
279
+ }
@@ -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
+ }