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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/.claude/settings.local.json +55 -0
  2. package/compose/build.gradle.kts +1 -1
  3. package/compose/compose.podspec +1 -1
  4. package/gradle.properties +1 -1
  5. package/ios/Application/Components.swift +34 -43
  6. package/ios/Application/FloatingButton.swift +10 -8
  7. package/ios/Application/Navigation/BottomTab/BottomTab.swift +102 -0
  8. package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +215 -0
  9. package/ios/Application/Navigation/BottomTab/CurvedContainer.swift +65 -0
  10. package/ios/Application/Navigation/HeaderBackProps.swift +66 -0
  11. package/ios/Application/Navigation/HeaderTitle.swift +57 -0
  12. package/ios/Application/Navigation/HeaderUser.swift +209 -0
  13. package/ios/Application/Navigation/NavigationContainer.swift +151 -0
  14. package/ios/Application/Navigation/NavigationOptions.swift +109 -0
  15. package/ios/Application/Navigation/Navigator.swift +360 -0
  16. package/ios/Application/Navigation/Overplay/BottomSheet.swift +176 -0
  17. package/ios/Application/Navigation/Overplay/ModalScreen.swift +68 -0
  18. package/ios/Application/Navigation/Overplay/SnackBar.swift +144 -0
  19. package/ios/Application/Navigation/component/Header.swift +178 -0
  20. package/ios/Application/Navigation/component/HeaderBackground.swift +83 -0
  21. package/ios/Application/Navigation/component/HeaderColor.swift +65 -0
  22. package/ios/Application/StackScreen.swift +449 -0
  23. package/ios/Avatar/Avatar.swift +193 -0
  24. package/ios/Badge/Badge.swift +11 -13
  25. package/ios/Badge/BadgeRibbon.swift +12 -19
  26. package/ios/BaselineView/BaselineView.swift +163 -0
  27. package/ios/Button/Button.swift +62 -23
  28. package/ios/Carousel/Carousel.swift +181 -0
  29. package/ios/Checkbox/Checkbox.swift +14 -12
  30. package/ios/Chip/Chip.swift +23 -9
  31. package/ios/Collapse/Collapse.swift +182 -0
  32. package/ios/Colors+Radius+Spacing/Colors.swift +1 -1
  33. package/ios/Colors+Radius+Spacing/Theme.swift +295 -0
  34. package/ios/DateTimePicker/DateTimePicker.swift +210 -0
  35. package/ios/DateTimePicker/DateTimePickerTypes.swift +55 -0
  36. package/ios/DateTimePicker/DateTimePickerUtils.swift +167 -0
  37. package/ios/DateTimePicker/WheelPicker.swift +161 -0
  38. package/ios/Divider/Divider.swift +16 -0
  39. package/ios/Icon/Icon.swift +6 -1
  40. package/ios/IconButton/IconButton.swift +112 -0
  41. package/ios/Information/Information.swift +151 -0
  42. package/ios/Input/Input.swift +42 -25
  43. package/ios/Input/InputPhoneNumber.swift +21 -19
  44. package/ios/Input/InputSearch.swift +101 -45
  45. package/ios/Input/InputTextArea.swift +67 -40
  46. package/ios/InputDropDown/InputDropDown.swift +198 -0
  47. package/ios/InputMoney/InputMoney.swift +335 -0
  48. package/ios/InputOTP/InputOTP.swift +210 -0
  49. package/ios/Loader/Loader.swift +113 -0
  50. package/ios/MoMoUIKits.podspec +5 -0
  51. package/ios/OTPKeyboard/KeyboardButton.swift +1 -1
  52. package/ios/Pagination/PaginationDot.swift +61 -0
  53. package/ios/Pagination/PaginationNumber.swift +35 -0
  54. package/ios/Pagination/PaginationScroll.swift +101 -0
  55. package/ios/Pagination/PaginationWhiteDot.swift +37 -0
  56. package/ios/Popup/PopupDisplay.swift +10 -12
  57. package/ios/Popup/PopupInput.swift +2 -6
  58. package/ios/Popup/PopupNotify.swift +219 -0
  59. package/ios/ProgressInfo/ProgressInfo.swift +294 -0
  60. package/ios/Radio/Radio.swift +70 -0
  61. package/ios/Rating/Rating.swift +82 -0
  62. package/ios/Skeleton/Skeleton.swift +99 -0
  63. package/ios/Slider/Slider.swift +237 -0
  64. package/ios/Stepper/Stepper.swift +220 -0
  65. package/ios/Steps/Steps.swift +451 -0
  66. package/ios/SuggestAction/SuggestAction.swift +97 -0
  67. package/ios/Swipeable/SwipeCell.swift +185 -0
  68. package/ios/Swipeable/SwipeCellModel.swift +21 -0
  69. package/ios/TabView/TabView.swift +530 -0
  70. package/ios/Tag/Tag.swift +98 -0
  71. package/ios/Template/TrustBanner/TrustBanner.swift +2 -0
  72. package/ios/Title/Title.swift +269 -0
  73. package/ios/Tooltip/Tooltip.swift +482 -0
  74. package/ios/Typography/Text.swift +77 -5
  75. package/ios/Typography/Typography.swift +9 -0
  76. package/ios/Uploader/Uploader.swift +183 -0
  77. package/ios/native-kits.podspec +58 -8
  78. package/ios-demo/MoMoUIKitsDemo.podspec +18 -0
  79. package/ios-demo/README.md +120 -0
  80. package/ios-demo/Resources/dot_loading.json +558 -0
  81. package/ios-demo/Resources/icon.json +4052 -0
  82. package/ios-demo/Resources/lottie_circle_loader.json +1 -0
  83. package/ios-demo/Sources/MoMoUIKitsDemo/DemoScaffold.swift +48 -0
  84. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsBadgeDemoView.swift +25 -0
  85. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsButtonDemoView.swift +26 -0
  86. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsCheckboxDemoView.swift +19 -0
  87. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsChipDemoView.swift +33 -0
  88. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsInputDemoView.swift +48 -0
  89. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsPopupDemoView.swift +21 -0
  90. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsRadioDemoView.swift +17 -0
  91. package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsTypographyDemoView.swift +28 -0
  92. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoContext.swift +31 -0
  93. package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoFactory.swift +72 -0
  94. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +110 -0
  95. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AvatarDemo.swift +93 -0
  96. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BadgeDemo.swift +269 -0
  97. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BaselineView.swift +117 -0
  98. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +89 -0
  99. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ButtonDemo.swift +100 -0
  100. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CarouselDemo.swift +126 -0
  101. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CheckboxDemo.swift +63 -0
  102. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ChipDemo.swift +20 -0
  103. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CollapseDemo.swift +93 -0
  104. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +107 -0
  105. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DateTimePickerDemo.swift +124 -0
  106. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DividerDemo.swift +14 -0
  107. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/HeaderUserDemo.swift +49 -0
  108. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +261 -0
  109. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconButtonDemo.swift +58 -0
  110. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ImageDemo.swift +78 -0
  111. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InformationDemo.swift +138 -0
  112. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDemo.swift +111 -0
  113. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDropDownDemo.swift +136 -0
  114. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputMoneyDemo.swift +107 -0
  115. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputOTPDemo.swift +73 -0
  116. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +100 -0
  117. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputSearchDemo.swift +32 -0
  118. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputTextAreaDemo.swift +57 -0
  119. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LoaderDemo.swift +70 -0
  120. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +227 -0
  121. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PaginationDemo.swift +72 -0
  122. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +175 -0
  123. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +121 -0
  124. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +76 -0
  125. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ProgressInfoDemo.swift +89 -0
  126. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RadioDemo.swift +32 -0
  127. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RatingDemo.swift +56 -0
  128. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SkeletonDemo.swift +32 -0
  129. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SliderDemo.swift +150 -0
  130. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SnackBarDemo.swift +138 -0
  131. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepperDemo.swift +103 -0
  132. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepsDemo.swift +94 -0
  133. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SuggestActionDemo.swift +79 -0
  134. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwipeDemo.swift +152 -0
  135. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwitchDemo.swift +33 -0
  136. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TabViewDemo.swift +190 -0
  137. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TagDemo.swift +34 -0
  138. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ThemeDemo.swift +182 -0
  139. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TitleDemo.swift +109 -0
  140. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TooltipDemo.swift +187 -0
  141. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +87 -0
  142. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/UploaderDemo.swift +131 -0
  143. package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +50 -0
  144. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoModels.swift +15 -0
  145. package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoRegistry.swift +73 -0
  146. package/local.properties +8 -0
  147. package/package.json +1 -1
  148. package/publish.sh +50 -0
  149. package/scripts/gen-ios-color.mjs +136 -0
@@ -0,0 +1,183 @@
1
+ import SwiftUI
2
+
3
+ /// Native SwiftUI port of the Compose `Uploader` component.
4
+ ///
5
+ /// Renders a horizontal row with an optional dashed "add image" picker cell
6
+ /// followed by a horizontally scrollable list of uploaded image thumbnails.
7
+ /// Each thumbnail can show a loading shimmer overlay and an optional cancel
8
+ /// button.
9
+ ///
10
+ /// Mirrors the Compose surface in
11
+ /// `compose/.../components/Uploader.kt`:
12
+ /// - `images`, `numberOfImages`, `disabled`, `width`, `height`
13
+ /// - callbacks `onAdd`, `onCancel`, `onPressImage`
14
+ ///
15
+ /// Note: like Compose, this component does NOT perform any native photo-picker
16
+ /// or file-system access. It exposes the `onAdd` callback so the host can
17
+ /// present a picker and supply the resulting image data back via the `images`
18
+ /// list (the demo passes mock image URLs).
19
+ public struct UploadImage: Identifiable {
20
+ public let id = UUID()
21
+ public var uri: String?
22
+ public var loading: Bool
23
+
24
+ public init(uri: String? = nil, loading: Bool = false) {
25
+ self.uri = uri
26
+ self.loading = loading
27
+ }
28
+ }
29
+
30
+ public struct Uploader: View {
31
+ // MARK: Properties
32
+
33
+ private let images: [UploadImage]
34
+ private let numberOfImages: Int
35
+ private let disabled: Bool
36
+ private let width: CGFloat
37
+ private let height: CGFloat
38
+ private let onAdd: () -> Void
39
+ private let onCancel: ((UploadImage, Int) -> Void)?
40
+ private let onPressImage: (UploadImage, Int) -> Void
41
+
42
+ // MARK: Lifecycle
43
+
44
+ public init(
45
+ images: [UploadImage],
46
+ numberOfImages: Int = 1,
47
+ disabled: Bool = false,
48
+ width: CGFloat = 64,
49
+ height: CGFloat = 64,
50
+ onAdd: @escaping () -> Void = {},
51
+ onCancel: ((UploadImage, Int) -> Void)? = nil,
52
+ onPressImage: @escaping (UploadImage, Int) -> Void = { _, _ in }
53
+ ) {
54
+ self.images = images
55
+ self.numberOfImages = numberOfImages
56
+ self.disabled = disabled
57
+ self.width = width
58
+ self.height = height
59
+ self.onAdd = onAdd
60
+ self.onCancel = onCancel
61
+ self.onPressImage = onPressImage
62
+ }
63
+
64
+ // MARK: Body
65
+
66
+ private var shouldShowPicker: Bool {
67
+ images.count < numberOfImages
68
+ }
69
+
70
+ public var body: some View {
71
+ HStack(alignment: .top, spacing: Spacing.S) {
72
+ if shouldShowPicker {
73
+ UploaderPickerCell(
74
+ disabled: disabled,
75
+ width: width,
76
+ height: height,
77
+ onAdd: onAdd
78
+ )
79
+ }
80
+
81
+ ScrollView(.horizontal, showsIndicators: false) {
82
+ HStack(alignment: .top, spacing: Spacing.S) {
83
+ ForEach(Array(images.enumerated()), id: \.element.id) { index, image in
84
+ UploaderImageItem(
85
+ image: image,
86
+ width: width,
87
+ height: height,
88
+ index: index,
89
+ onCancel: onCancel,
90
+ onPressImage: { onPressImage(image, index) }
91
+ )
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+
99
+ // MARK: - Picker cell
100
+
101
+ private struct UploaderPickerCell: View {
102
+ @Environment(\.appTheme) private var theme
103
+
104
+ let disabled: Bool
105
+ let width: CGFloat
106
+ let height: CGFloat
107
+ let onAdd: () -> Void
108
+
109
+ // text.disable / text.hint and border.disable / border.default tokens.
110
+ private var mainColor: Color { disabled ? theme.colors.text.disable : theme.colors.text.hint }
111
+ private var borderColor: Color { disabled ? theme.colors.border.disable : theme.colors.border.default }
112
+
113
+ var body: some View {
114
+ SwiftUI.Button(action: { if !disabled { onAdd() } }) {
115
+ VStack(spacing: Spacing.XXS) {
116
+ Icon(source: "16_navigation_plus", size: 16, color: mainColor)
117
+ MomoText("Thêm hình", typography: .descriptionXsRegular, color: mainColor)
118
+ }
119
+ .frame(width: width, height: height)
120
+ .background(
121
+ RoundedRectangle(cornerRadius: Radius.XS)
122
+ .strokeBorder(
123
+ borderColor,
124
+ style: StrokeStyle(lineWidth: 1, dash: [10, 6])
125
+ )
126
+ )
127
+ .clipShape(RoundedRectangle(cornerRadius: Radius.XS))
128
+ }
129
+ .buttonStyle(ActiveOpacityButtonStyle())
130
+ .disabled(disabled)
131
+ }
132
+ }
133
+
134
+ // MARK: - Image item
135
+
136
+ private struct UploaderImageItem: View {
137
+ let image: UploadImage
138
+ let width: CGFloat
139
+ let height: CGFloat
140
+ let index: Int
141
+ let onCancel: ((UploadImage, Int) -> Void)?
142
+ let onPressImage: () -> Void
143
+
144
+ var body: some View {
145
+ SwiftUI.Button(action: onPressImage) {
146
+ ZStack(alignment: .topTrailing) {
147
+ ImageView(image.uri ?? "", contentMode: .fill)
148
+ .frame(width: width, height: height)
149
+ .clipShape(RoundedRectangle(cornerRadius: Radius.XS))
150
+
151
+ if image.loading {
152
+ Skeleton()
153
+ .frame(width: width, height: height)
154
+ .clipShape(RoundedRectangle(cornerRadius: Radius.XS))
155
+ .background(
156
+ Color.white.opacity(0.4)
157
+ .clipShape(RoundedRectangle(cornerRadius: Radius.XS))
158
+ )
159
+ }
160
+
161
+ if let onCancel, !image.loading {
162
+ SwiftUI.Button(action: { onCancel(image, index) }) {
163
+ Icon(source: "navigation_close_circle_full", size: 16, color: nil)
164
+ }
165
+ .buttonStyle(ActiveOpacityButtonStyle())
166
+ .padding(.top, Spacing.XXS)
167
+ .padding(.trailing, Spacing.XXS)
168
+ }
169
+ }
170
+ .frame(width: width, height: height)
171
+ }
172
+ .buttonStyle(ActiveOpacityButtonStyle())
173
+ }
174
+ }
175
+
176
+ // MARK: - Active opacity button style
177
+
178
+ private struct ActiveOpacityButtonStyle: ButtonStyle {
179
+ func makeBody(configuration: Configuration) -> some View {
180
+ configuration.label
181
+ .opacity(configuration.isPressed ? 0.5 : 1)
182
+ }
183
+ }
@@ -1,21 +1,71 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKits'
3
- s.version = '1.0.0'
3
+ s.version = '0.162.2-sp.1'
4
4
  s.summary = 'MoMoUIKits for iOS'
5
5
  s.homepage = 'https://momo.vn'
6
- s.license = { :type => 'MIT', :file => 'LICENSE' }
6
+ s.license = { :type => 'MIT' }
7
7
  s.author = { 'MoMo' => 'dev@momo.vn' }
8
8
  s.source = { :path => '.' }
9
9
 
10
10
  s.ios.deployment_target = '15.0'
11
11
  s.swift_version = '5.0'
12
+ s.module_name = 'MoMoUIKits'
12
13
 
13
- s.source_files = "**/*.{swift,m,h}"
14
+ s.source_files = [
15
+ "Application/**/*.{swift,m,h}",
16
+ "Avatar/**/*.{swift,m,h}",
17
+ "Badge/**/*.{swift,m,h}",
18
+ "BaselineView/**/*.{swift,m,h}",
19
+ "Button/**/*.{swift,m,h}",
20
+ "CalculatorKeyboard/**/*.{swift,m,h}",
21
+ "Carousel/**/*.{swift,m,h}",
22
+ "Checkbox/**/*.{swift,m,h}",
23
+ "Chip/**/*.{swift,m,h}",
24
+ "Collapse/**/*.{swift,m,h}",
25
+ "Colors+Radius+Spacing/**/*.{swift,m,h}",
26
+ "DateTimePicker/**/*.{swift,m,h}",
27
+ "Divider/**/*.{swift,m,h}",
28
+ "Extensions/**/*.{swift,m,h}",
29
+ "Icon/**/*.{swift,m,h}",
30
+ "IconButton/**/*.{swift,m,h}",
31
+ "Image/**/*.{swift,m,h}",
32
+ "Information/**/*.{swift,m,h}",
33
+ "Input/**/*.{swift,m,h}",
34
+ "InputDropDown/**/*.{swift,m,h}",
35
+ "InputMoney/**/*.{swift,m,h}",
36
+ "InputOTP/**/*.{swift,m,h}",
37
+ "Loader/**/*.{swift,m,h}",
38
+ "Lottie/**/*.{swift,m,h}",
39
+ "OTPKeyboard/**/*.{swift,m,h}",
40
+ "Pagination/**/*.{swift,m,h}",
41
+ "Popup/**/*.{swift,m,h}",
42
+ "PopupView/**/*.{swift,m,h}",
43
+ "ProgressInfo/**/*.{swift,m,h}",
44
+ "Radio/**/*.{swift,m,h}",
45
+ "Rating/**/*.{swift,m,h}",
46
+ "ScrollIndicator/**/*.{swift,m,h}",
47
+ "Skeleton/**/*.{swift,m,h}",
48
+ "Slider/**/*.{swift,m,h}",
49
+ "StatusBarTap/**/*.{swift,m,h}",
50
+ "Stepper/**/*.{swift,m,h}",
51
+ "Steps/**/*.{swift,m,h}",
52
+ "SuggestAction/**/*.{swift,m,h}",
53
+ "Swipeable/**/*.{swift,m,h}",
54
+ "Switch/**/*.{swift,m,h}",
55
+ "TabView/**/*.{swift,m,h}",
56
+ "Tag/**/*.{swift,m,h}",
57
+ "Template/**/*.{swift,m,h}",
58
+ "Title/**/*.{swift,m,h}",
59
+ "Tooltip/**/*.{swift,m,h}",
60
+ "Typography/**/*.{swift,m,h}",
61
+ "Uploader/**/*.{swift,m,h}"
62
+ ]
14
63
  s.public_header_files = "StatusBarTap/*.h"
15
- s.framework = 'SwiftUI', 'Combine'
16
- s.dependency 'SDWebImageSwiftUI'
17
- s.dependency 'lottie-ios'
64
+ s.frameworks = 'SwiftUI', 'Combine'
65
+ s.pod_target_xcconfig = {
66
+ 'DEFINES_MODULE' => 'YES'
67
+ }
68
+ s.dependency 'SDWebImageSwiftUI', '2.2.3'
69
+ s.dependency 'lottie-ios', '4.5.2'
18
70
  s.dependency 'SkeletonUI', '1.0.11'
19
71
  end
20
-
21
-
@@ -0,0 +1,18 @@
1
+ Pod::Spec.new do |s|
2
+ s.name = 'MoMoUIKitsDemo'
3
+ s.version = '0.162.2-sp.1'
4
+ s.summary = 'Demo browser for MoMoUIKits SwiftUI components'
5
+ s.homepage = 'https://momo.vn'
6
+ s.license = { :type => 'MIT' }
7
+ s.author = { 'MoMo' => 'dev@momo.vn' }
8
+ s.source = { :path => '.' }
9
+
10
+ s.ios.deployment_target = '15.0'
11
+ s.swift_version = '5.0'
12
+
13
+ s.source_files = 'Sources/**/*.{swift}'
14
+ s.resources = 'Resources/**/*'
15
+ s.frameworks = 'SwiftUI', 'UIKit'
16
+ s.dependency 'MoMoUIKits'
17
+ s.dependency 'lottie-ios', '4.5.2'
18
+ end
@@ -0,0 +1,120 @@
1
+ # MoMoUIKitsDemo
2
+
3
+ SwiftUI demo browser for `MoMoUIKits`.
4
+
5
+ The package can optionally host a Compose UIKits screen by receiving a
6
+ `UIViewController` factory from the host app. It does not import the KMP
7
+ `shared` module directly.
8
+
9
+ SwiftUI mode reuses the full demo screen set from
10
+ `sample/iosApp/iosApp/Demo`, including the sample `HomeView` registry and demo
11
+ screens for all currently available components.
12
+
13
+ ## CocoaPods
14
+
15
+ In the host app `Podfile`, include both local pods:
16
+
17
+ ```ruby
18
+ pod 'MoMoUIKits', :path => '../momo-native-kits/ios/native-kits.podspec'
19
+ pod 'MoMoUIKitsDemo', :path => '../momo-native-kits/ios-demo'
20
+ ```
21
+
22
+ Adjust the relative paths to match the host app checkout.
23
+
24
+ ## Host App Usage
25
+
26
+ ```swift
27
+ import MoMoUIKitsDemo
28
+ import shared
29
+
30
+ class UIKitsViewController: BaseComposeAppViewController {
31
+ override func getViewController() -> UIViewController? {
32
+ let params = self.application.data as? [String: Any]
33
+
34
+ return MoMoUIKitsDemoViewControllerFactory.make(
35
+ context: MoMoUIKitsDemoContext(
36
+ appId: params?["appId"] as? String ?? "",
37
+ appCode: params?["code"] as? String ?? "",
38
+ appName: params?["name"] as? String,
39
+ appIcon: params?["icon"] as? String ?? ""
40
+ ),
41
+ composeViewController: {
42
+ UIKitsScreenComposeViewControllerKt.UIKitsScreenComposeViewController(
43
+ params: params
44
+ )
45
+ }
46
+ )
47
+ }
48
+
49
+ override func viewDidDisappear(_ animated: Bool) {
50
+ super.viewDidDisappear(animated)
51
+ composeViewController = nil
52
+ }
53
+ }
54
+ ```
55
+
56
+ If the host does not pass `composeViewController`, the demo opens directly in
57
+ SwiftUI mode.
58
+
59
+ ## Included SwiftUI Demos
60
+
61
+ The pod includes the sample demo screens for:
62
+
63
+ - Animated Header
64
+ - Avatar
65
+ - Badge
66
+ - Baseline View
67
+ - Bottom Tab
68
+ - Button
69
+ - Carousel
70
+ - Checkbox
71
+ - Chip
72
+ - Collapse
73
+ - DateTimePicker
74
+ - Divider
75
+ - Header User
76
+ - Icon Button
77
+ - Image
78
+ - Information
79
+ - Input
80
+ - Input DropDown
81
+ - Input Money
82
+ - Input OTP
83
+ - Input Phone Number
84
+ - Input Search
85
+ - Input TextArea
86
+ - Loader
87
+ - Navigation
88
+ - Pagination
89
+ - Popup Display
90
+ - Popup Notify
91
+ - Popup Promotion
92
+ - Progress Info
93
+ - Radio
94
+ - Rating
95
+ - Skeleton
96
+ - Slider
97
+ - SnackBar
98
+ - Stepper
99
+ - Steps
100
+ - Suggest Action
101
+ - Swipe
102
+ - Switch
103
+ - TabView
104
+ - Tag
105
+ - Theme
106
+ - Title
107
+ - Tooltip
108
+ - Typography
109
+ - Uploader
110
+
111
+ ## Validation Notes
112
+
113
+ Validated locally with:
114
+
115
+ ```sh
116
+ pod ipc spec ios/MoMoUIKits.podspec
117
+ pod ipc spec ios-demo/MoMoUIKitsDemo.podspec
118
+ pod lib lint ios/MoMoUIKits.podspec --allow-warnings --skip-import-validation
119
+ pod lib lint ios-demo/MoMoUIKitsDemo.podspec --allow-warnings --skip-import-validation --include-podspecs=ios/MoMoUIKits.podspec
120
+ ```