@momo-kits/native-kits 0.162.2-beta.26 → 0.162.2-beta.27

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