@momo-kits/native-kits 0.0.1-beta.4 → 0.89.1-2

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 (195) hide show
  1. package/README.md +1 -0
  2. package/android/.gradle/8.0/checksums/checksums.lock +0 -0
  3. package/android/.gradle/8.0/dependencies-accessors/dependencies-accessors.lock +0 -0
  4. package/android/.gradle/8.0/dependencies-accessors/gc.properties +0 -0
  5. package/android/.gradle/8.0/fileChanges/last-build.bin +0 -0
  6. package/android/.gradle/8.0/fileHashes/fileHashes.lock +0 -0
  7. package/android/.gradle/8.0/gc.properties +0 -0
  8. package/android/.gradle/config.properties +2 -0
  9. package/android/.gradle/vcs-1/gc.properties +0 -0
  10. package/android/.idea/gradle.xml +12 -0
  11. package/android/.idea/migrations.xml +10 -0
  12. package/android/.idea/misc.xml +10 -0
  13. package/android/.idea/vcs.xml +6 -0
  14. package/android/.idea/workspace.xml +50 -0
  15. package/android/build.gradle +35 -69
  16. package/android/local.properties +8 -0
  17. package/android/proguard-rules.pro +21 -0
  18. package/android/src/main/AndroidManifest.xml +2 -2
  19. package/android/src/main/java/com/momoplatform/nativekits/foundations/Button.kt +16 -0
  20. package/android/src/main/java/com/momoplatform/nativekits/libs/Logo.kt +63 -0
  21. package/android/src/main/java/com/momoplatform/nativekits/libs/TrustBanner.kt +246 -0
  22. package/android/src/main/res/drawable/ic_launcher_background.xml +170 -0
  23. package/android/src/main/res/drawable-v24/ic_launcher_foreground.xml +30 -0
  24. package/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +6 -0
  25. package/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +6 -0
  26. package/android/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
  27. package/android/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
  28. package/android/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
  29. package/android/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
  30. package/android/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
  31. package/android/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
  32. package/android/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
  33. package/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
  34. package/android/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
  35. package/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
  36. package/android/src/main/res/values/colors.xml +10 -0
  37. package/android/src/main/res/values/strings.xml +3 -0
  38. package/android/src/main/res/values/themes.xml +3 -0
  39. package/android/src/main/res/values-night/themes.xml +3 -0
  40. package/android/src/main/res/xml/backup_rules.xml +13 -0
  41. package/android/src/main/res/xml/data_extraction_rules.xml +19 -0
  42. package/build.gradle.kts +18 -0
  43. package/compose/build.gradle.kts +82 -0
  44. package/compose/src/androidMain/AndroidManifest.xml +2 -0
  45. package/compose/src/androidMain/kotlin/vn/momo/kits/utils/Platform.kt +3 -0
  46. package/compose/src/androidMain/kotlin/vn/momo/kits/utils/SetMaskFilter.kt +8 -0
  47. package/compose/src/androidMain/kotlin/vn/momo/kits/utils/Utils.android.kt +14 -0
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Components.kt +194 -0
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +197 -0
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +133 -0
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +62 -0
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +27 -0
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +288 -0
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +80 -0
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +23 -0
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +42 -0
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +126 -0
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +51 -0
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +299 -0
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +246 -0
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +223 -0
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +244 -0
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +281 -0
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PromotionPopup.kt +72 -0
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +65 -0
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +64 -0
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +63 -0
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +73 -0
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +42 -0
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +150 -0
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +13 -0
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +173 -0
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +242 -0
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +2 -0
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +2 -0
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +2 -0
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +50 -0
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1321 -0
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Platform.kt +3 -0
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/SetMaskFilter.kt +5 -0
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +97 -0
  83. package/compose/src/iosMain/kotlin/vn/momo/kits/utils/Platform.kt +3 -0
  84. package/compose/src/iosMain/kotlin/vn/momo/kits/utils/SetMaskFilter.kt +9 -0
  85. package/compose/src/iosMain/kotlin/vn/momo/kits/utils/Utils.ios.kt +18 -0
  86. package/gradle.properties +19 -0
  87. package/gradlew +240 -0
  88. package/gradlew.bat +91 -0
  89. package/ios/Button/Button.swift +9 -2
  90. package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +126 -0
  91. package/ios/Checkbox/Checkbox.swift +38 -0
  92. package/ios/{Colors+Spacing → Colors+Radius+Spacing}/Colors.swift +21 -19
  93. package/ios/Colors+Radius+Spacing/Radius.swift +22 -0
  94. package/ios/Image/Image.swift +60 -0
  95. package/ios/Input/Input.swift +88 -37
  96. package/ios/OTPKeyboard/KeyboardButton.swift +12 -4
  97. package/ios/OTPKeyboard/OTPKeyboard.swift +1 -1
  98. package/ios/Popup/PopupDisplay.swift +169 -0
  99. package/ios/Popup/PopupInput.swift +96 -0
  100. package/ios/Popup/PopupPromotion.swift +52 -0
  101. package/ios/PopupView/FullscreenPopup.swift +251 -0
  102. package/ios/{Popup → PopupView}/Modifiers.swift +6 -20
  103. package/ios/{Popup → PopupView}/PopupView.swift +38 -146
  104. package/ios/PopupView/Utils++.swift +281 -0
  105. package/ios/ScrollIndicator/ScrollIndicator.swift +79 -0
  106. package/ios/Switch/Switch.swift +44 -0
  107. package/ios/Template/Logo/Logo.swift +75 -0
  108. package/ios/Template/TrustBanner/TrustBanner.swift +189 -0
  109. package/ios/native-kits.podspec +2 -0
  110. package/local.properties +8 -0
  111. package/package.json +6 -6
  112. package/publish.sh +1 -10
  113. package/settings.gradle.kts +41 -0
  114. package/android/gradle.properties +0 -5
  115. package/android/src/main/java/com/momoplatform/nativekits/NativeKitsPackage.kt +0 -17
  116. package/android/src/main/java/com/momoplatform/nativekits/NativeKitsViewManager.kt +0 -20
  117. package/example/ios/Example/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -63
  118. package/example/ios/Example/Assets.xcassets/Background.colorset/Contents.json +0 -38
  119. package/example/ios/Example/Assets.xcassets/Border.colorset/Contents.json +0 -38
  120. package/example/ios/Example/Assets.xcassets/Card.colorset/Contents.json +0 -38
  121. package/example/ios/Example/Assets.xcassets/Contents.json +0 -6
  122. package/example/ios/Example/Assets.xcassets/Error.colorset/Contents.json +0 -38
  123. package/example/ios/Example/Assets.xcassets/Primary.colorset/Contents.json +0 -38
  124. package/example/ios/Example/Assets.xcassets/PrimaryDark.colorset/Contents.json +0 -38
  125. package/example/ios/Example/Assets.xcassets/PrimaryLight.colorset/Contents.json +0 -38
  126. package/example/ios/Example/Assets.xcassets/Secondary.colorset/Contents.json +0 -38
  127. package/example/ios/Example/Assets.xcassets/Success.colorset/Contents.json +0 -38
  128. package/example/ios/Example/Assets.xcassets/Text.colorset/Contents.json +0 -38
  129. package/example/ios/Example/Assets.xcassets/TextSecondary.colorset/Contents.json +0 -38
  130. package/example/ios/Example/Assets.xcassets/Warning.colorset/Contents.json +0 -38
  131. package/example/ios/Example/ComponentDetail.swift +0 -35
  132. package/example/ios/Example/ComponentItem.swift +0 -24
  133. package/example/ios/Example/ComponentModel.swift +0 -33
  134. package/example/ios/Example/ContentView.swift +0 -53
  135. package/example/ios/Example/Example.entitlements +0 -10
  136. package/example/ios/Example/Foundation/ButtonDemo.swift +0 -80
  137. package/example/ios/Example/Foundation/Popup/ActionSheets.swift +0 -136
  138. package/example/ios/Example/Foundation/Popup/Floats.swift +0 -127
  139. package/example/ios/Example/Foundation/Popup/Popups.swift +0 -101
  140. package/example/ios/Example/Foundation/PopupDemo.swift +0 -366
  141. package/example/ios/Example/Foundation/TextInputDemo.swift +0 -31
  142. package/example/ios/Example/Foundation/TypographyDemo.swift +0 -53
  143. package/example/ios/Example/Foundation.swift +0 -26
  144. package/example/ios/Example/Info.plist +0 -18
  145. package/example/ios/Example/Library/SwipeableDemo.swift +0 -105
  146. package/example/ios/Example/Library.swift +0 -26
  147. package/example/ios/Example/Main.swift +0 -11
  148. package/example/ios/Example/Overview.swift +0 -20
  149. package/example/ios/Example/Preview Content/Preview Assets.xcassets/Contents.json +0 -6
  150. package/example/ios/Example/Resource/SFProText-Black.ttf +0 -0
  151. package/example/ios/Example/Resource/SFProText-Bold.ttf +0 -0
  152. package/example/ios/Example/Resource/SFProText-Heavy.ttf +0 -0
  153. package/example/ios/Example/Resource/SFProText-Light.ttf +0 -0
  154. package/example/ios/Example/Resource/SFProText-Medium.ttf +0 -0
  155. package/example/ios/Example/Resource/SFProText-Regular.ttf +0 -0
  156. package/example/ios/Example/Resource/SFProText-Semibold.ttf +0 -0
  157. package/example/ios/Example/Resource/SFProText-Thin.ttf +0 -0
  158. package/example/ios/Example/Resource/SFProText-Ultralight.ttf +0 -0
  159. package/example/ios/Example/Resource/foundation.json +0 -33
  160. package/example/ios/Example/Resource/library.json +0 -8
  161. package/example/ios/Example/Utils.swift +0 -30
  162. package/example/ios/Example/ViewModifier/DarkViewModifier.swift +0 -22
  163. package/example/ios/Example.xcodeproj/project.pbxproj +0 -570
  164. package/example/ios/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  165. package/example/ios/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  166. package/example/ios/Example.xcodeproj/project.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  167. package/example/ios/Example.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  168. package/example/ios/Example.xcworkspace/contents.xcworkspacedata +0 -10
  169. package/example/ios/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  170. package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  171. package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
  172. package/example/ios/Podfile +0 -6
  173. package/example/ios/Podfile.lock +0 -16
  174. package/example/ios/Pods/Local Podspecs/MoMoUIKits.podspec.json +0 -29
  175. package/example/ios/Pods/Manifest.lock +0 -16
  176. package/example/ios/Pods/Pods.xcodeproj/project.pbxproj +0 -661
  177. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
  178. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
  179. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +0 -25
  180. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-dummy.m +0 -5
  181. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-prefix.pch +0 -12
  182. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-umbrella.h +0 -16
  183. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.debug.xcconfig +0 -12
  184. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.modulemap +0 -6
  185. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.release.xcconfig +0 -12
  186. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown +0 -3
  187. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist +0 -29
  188. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m +0 -5
  189. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h +0 -16
  190. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig +0 -14
  191. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap +0 -6
  192. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig +0 -14
  193. package/ios/Colors+Spacing/Radius.swift +0 -11
  194. package/ios/Popup/Utils++.swift +0 -163
  195. /package/ios/{Colors+Spacing → Colors+Radius+Spacing}/Spacing.swift +0 -0
@@ -1,366 +0,0 @@
1
-
2
- import MoMoUIKits
3
- import SwiftUI
4
-
5
- // MARK: - PopupDemo
6
-
7
- struct PopupDemo: View {
8
- @AppStorage("showOTPKeyboard") var showOTPKeyboard: Bool = false
9
-
10
- @State var showingTopFirstFloat: Bool = false
11
- @State var showingTopSecondFloat: Bool = false
12
- @State var showingBottomFirstFloat: Bool = false
13
- @State var showingBottomSecondFloat: Bool = false
14
-
15
- @State var showingMiddlePopup: Bool = false
16
- @State var showingBottomFirstPopup: Bool = false
17
-
18
- @State var showingFirstActionSheet: Bool = false
19
- @State var showingSecondActionSheet: Bool = false
20
-
21
- var body: some View {
22
- let hideAll: () -> () = {
23
- self.showingTopFirstFloat = false
24
- self.showingTopSecondFloat = false
25
- self.showingBottomFirstFloat = false
26
- self.showingBottomSecondFloat = false
27
-
28
- self.showingMiddlePopup = false
29
- self.showingBottomFirstPopup = false
30
-
31
- self.showingFirstActionSheet = false
32
- self.showingSecondActionSheet = false
33
- }
34
-
35
- return ZStack {
36
- Rectangle()
37
- .fill(Colors.background)
38
- .ignoresSafeArea()
39
- ScrollView {
40
- LazyVStack(spacing: 12) {
41
- Group {
42
- SectionHeader(name: "Design system", count: 4)
43
- .padding(.bottom, 12)
44
-
45
- PopupButton(isShowing: $showOTPKeyboard, hideAll: hideAll) {
46
- PopupTypeView(
47
- title: "Show OTP keyboard",
48
- detail: "Top popup show otp keyboard"
49
- ) {
50
- ActionSheetImage()
51
- }
52
- }
53
- }
54
-
55
- Group {
56
- SectionHeader(name: "Floats", count: 4)
57
- .padding(.bottom, 12)
58
-
59
- PopupButton(isShowing: $showingTopFirstFloat, hideAll: hideAll) {
60
- PopupTypeView(
61
- title: "Top version 1",
62
- detail: "Top float with a picture and one button"
63
- ) {
64
- FloatsImage(position: .top)
65
- }
66
- }
67
- PopupButton(isShowing: $showingTopSecondFloat, hideAll: hideAll) {
68
- PopupTypeView(
69
- title: "Top version 2",
70
- detail: "Top float with a picture"
71
- ) {
72
- FloatsImage(position: .top)
73
- }
74
- }
75
- PopupButton(isShowing: $showingBottomFirstFloat, hideAll: hideAll) {
76
- PopupTypeView(
77
- title: "Bottom version 1",
78
- detail: "Bottom float with a picture"
79
- ) {
80
- FloatsImage(position: .bottom)
81
- }
82
- }
83
- PopupButton(isShowing: $showingBottomSecondFloat, hideAll: hideAll) {
84
- PopupTypeView(
85
- title: "Bottom version 2",
86
- detail: "Bottom float with a picture"
87
- ) {
88
- FloatsImage(position: .bottom)
89
- }
90
- }
91
- }
92
-
93
- Group {
94
- SectionHeader(name: "Popups", count: 2)
95
- .padding(EdgeInsets(top: 20, leading: 0, bottom: 12, trailing: 0))
96
-
97
- PopupButton(isShowing: $showingMiddlePopup, hideAll: hideAll) {
98
- PopupTypeView(
99
- title: "Middle",
100
- detail: "Popup in the middle of the screen with a picture"
101
- ) {
102
- PopupImage(style: .default)
103
- }
104
- }
105
- PopupButton(isShowing: $showingBottomFirstPopup, hideAll: hideAll) {
106
- PopupTypeView(
107
- title: "Bottom version 1",
108
- detail: "Popup bottom"
109
- ) {
110
- PopupImage(style: .bottomFirst)
111
- }
112
- }
113
- }
114
-
115
- Group {
116
- SectionHeader(name: "Action sheets", count: 2)
117
- .padding(EdgeInsets(top: 20, leading: 0, bottom: 12, trailing: 0))
118
-
119
- PopupButton(isShowing: $showingFirstActionSheet, hideAll: hideAll) {
120
- PopupTypeView(
121
- title: "Version 1",
122
- detail: "Action sheets"
123
- ) {
124
- ActionSheetImage()
125
- }
126
- }
127
- PopupButton(isShowing: $showingSecondActionSheet, hideAll: hideAll) {
128
- PopupTypeView(
129
- title: "Version 2",
130
- detail: "Action sheets"
131
- ) {
132
- ActionSheetImage()
133
- }
134
- }
135
- }
136
- }
137
- }
138
-
139
- // MARK: - Designed floats
140
-
141
- .popup(isPresented: $showingTopFirstFloat, type: .floater(), position: .top, animation: .spring()) {
142
- FloatTopFirst()
143
- }
144
- .popup(isPresented: $showingTopSecondFloat, type: .floater(), position: .top, animation: .spring(), autohideIn: 3) {
145
- FloatTopSecond()
146
- }
147
- .popup(isPresented: $showingBottomFirstFloat, type: .floater(), position: .bottom, animation: .spring(), autohideIn: 2) {
148
- FloatBottomFirst()
149
- }
150
- .popup(isPresented: $showingBottomSecondFloat, type: .floater(), position: .bottom, animation: .spring(), autohideIn: 5) {
151
- FloatBottomSecond()
152
- }
153
-
154
- // MARK: - Designed popups
155
-
156
- .popup(isPresented: $showingMiddlePopup, type: .default, position: .center, closeOnTap: true, backgroundColor: .black.opacity(0.4)) {
157
- PopupMiddle(isPresented: $showingMiddlePopup)
158
- }
159
- .popup(isPresented: $showingBottomFirstPopup, type: .floater(), position: .bottom, closeOnTapOutside: true, backgroundColor: .black.opacity(0.4)) {
160
- PopupBottomFirst(isPresented: $showingBottomFirstPopup)
161
- }
162
-
163
- // MARK: - Designed sheets
164
-
165
- .popup(isPresented: $showingFirstActionSheet, type: .toast, position: .bottom, closeOnTap: false, backgroundColor: .black.opacity(0.4)) {
166
- ActionSheetFirst()
167
- }
168
- .popup(isPresented: $showingSecondActionSheet, type: .toast, position: .bottom, closeOnTap: false, backgroundColor: .black.opacity(0.4)) {
169
- ActionSheetSecond()
170
- }
171
- }
172
- }
173
- }
174
-
175
- // MARK: - SectionHeader
176
-
177
- private struct SectionHeader: View {
178
- let name: String
179
- let count: Int
180
-
181
- var body: some View {
182
- HStack {
183
- Text(name)
184
- .font(.system(size: 24, weight: .bold))
185
- .foregroundColor(Colors.text)
186
-
187
- Spacer()
188
-
189
- HStack(spacing: 4) {
190
- Text("\(count)")
191
- .font(.system(size: 18))
192
- .foregroundColor(Colors.text)
193
- .opacity(0.8)
194
-
195
- Text("types")
196
- .font(.system(size: 18))
197
- .foregroundColor(Colors.text)
198
- .opacity(0.5)
199
- }
200
- }
201
- .padding(.horizontal, 20)
202
- }
203
- }
204
-
205
- // MARK: - PopupTypeView
206
-
207
- private struct PopupTypeView<Content>: View where Content: View {
208
- let title: String
209
- let detail: String
210
- @ViewBuilder let icon: () -> Content
211
-
212
- var body: some View {
213
- ZStack(alignment: .leading) {
214
- RoundedRectangle(cornerRadius: 12)
215
- .fill(Colors.card)
216
-
217
- HStack {
218
- icon()
219
- VStack(alignment: .leading, spacing: 0) {
220
- Text(title)
221
- .font(.system(size: 18))
222
- .foregroundColor(Colors.text)
223
- Text(detail)
224
- .lineLimit(1)
225
- .font(.system(size: 13))
226
- .foregroundColor(Colors.text)
227
- .opacity(0.4)
228
- }
229
- }
230
- .padding()
231
- }
232
- .padding(.horizontal, 20)
233
- }
234
- }
235
-
236
- // MARK: - PopupButton
237
-
238
- private struct PopupButton<Content>: View where Content: View {
239
- @Binding var isShowing: Bool
240
-
241
- var hideAll: () -> ()
242
-
243
- @ViewBuilder let content: () -> Content
244
-
245
- var body: some View {
246
- Button {
247
- hideAll()
248
- isShowing.toggle()
249
- } label: {
250
- content()
251
- }
252
- }
253
- }
254
-
255
- // MARK: - AlertImageView
256
-
257
- private struct AlertImageView<Content>: View where Content: View {
258
- let hex: String
259
- let alignment: Alignment
260
-
261
- @ViewBuilder let content: (Color) -> Content
262
-
263
- var body: some View {
264
- let color = Color(hex: hex)
265
- return ZStack(alignment: alignment) {
266
- Rectangle()
267
- .fill(color)
268
- .opacity(0.24)
269
- .frame(width: 40, height: 40)
270
- content(color)
271
- }
272
- .cornerRadius(10)
273
- }
274
- }
275
-
276
- // MARK: - FloatsImage
277
-
278
- private struct FloatsImage: View {
279
- enum Position {
280
- case top
281
- case bottom
282
-
283
- // MARK: Internal
284
-
285
- func toAligment() -> Alignment {
286
- switch self {
287
- case .top:
288
- return .top
289
- case .bottom:
290
- return .bottom
291
- }
292
- }
293
- }
294
-
295
- let position: Position
296
-
297
- var body: some View {
298
- AlertImageView(hex: "9265F8", alignment: position.toAligment()) { color in
299
- Rectangle()
300
- .fill(color)
301
- .frame(width: 24, height: 4)
302
- .cornerRadius(12)
303
- .padding(.all, 8)
304
- }
305
- }
306
- }
307
-
308
- // MARK: - PopupImage
309
-
310
- private struct PopupImage: View {
311
- enum Style {
312
- case `default`
313
- case bottomFirst
314
- case bottomSecond
315
-
316
- // MARK: Internal
317
-
318
- func toAligment() -> Alignment {
319
- switch self {
320
- case .default:
321
- return .center
322
- case .bottomFirst,
323
- .bottomSecond:
324
- return .bottom
325
- }
326
- }
327
- }
328
-
329
- let style: Style
330
-
331
- var body: some View {
332
- AlertImageView(hex: "CCE7A2", alignment: style.toAligment()) { color in
333
- switch style {
334
- case .default:
335
- RoundedRectangle(cornerRadius: 4)
336
- .fill(color)
337
- .frame(width: 24, height: 20)
338
-
339
- case .bottomFirst:
340
- RoundedRectangle(cornerRadius: 4)
341
- .fill(color)
342
- .frame(width: 24, height: 20)
343
- .padding(.bottom, 4)
344
-
345
- case .bottomSecond:
346
- RoundedRectangle(cornerRadius: 4)
347
- .fill(color)
348
- .frame(width: 40, height: 20)
349
- .padding(0)
350
- }
351
- }
352
- }
353
- }
354
-
355
- // MARK: - ActionSheetImage
356
-
357
- private struct ActionSheetImage: View {
358
- var body: some View {
359
- AlertImageView(hex: "FFB93D", alignment: .bottom) { color in
360
- RoundedRectangle(cornerRadius: 4)
361
- .fill(color)
362
- .frame(width: 40, height: 20)
363
- .padding(0)
364
- }
365
- }
366
- }
@@ -1,31 +0,0 @@
1
- //
2
- // TextInputDemo.swift
3
- // Example
4
- //
5
- // Created by Nguyen Hoang Son on 26/12/2022.
6
- //
7
-
8
- import Foundation
9
- import SwiftUI
10
- import MoMoUIKits
11
-
12
- public struct TextInputDemo: View {
13
- public init(){
14
-
15
- }
16
-
17
- public var body: some View{
18
- return VStack{
19
- Input(placeholder: "Placeholder", floatingValue: "Floating value", multilines: true)
20
- Input(placeholder: "Placeholder", floatingValue: "Floating value", multilines: false)
21
- }
22
- }
23
-
24
-
25
- }
26
-
27
- struct TextInputDemo_Previews: PreviewProvider {
28
- static var previews: some View {
29
- TextInputDemo()
30
- }
31
- }
@@ -1,53 +0,0 @@
1
- //
2
- // TypographyDemo.swift
3
- // Example
4
- //
5
- // Created by Wem on 13/12/2022.
6
- //
7
-
8
- import Foundation
9
- import SwiftUI
10
-
11
- struct TypographyDemo: View {
12
-
13
- var body: some View {
14
- ScrollView {
15
- Group {
16
- VStack {
17
- Text("Text").font(.h1)
18
- Text("Text").font(.h2)
19
- Text("Text").font(.h3)
20
- Text("Text").font(.h4)
21
- }
22
- VStack {
23
- Text("Text").font(.title1)
24
- Text("Text").font(.title2)
25
- Text("Text").font(.title3)
26
- }
27
- VStack {
28
- Text("Text").font(.headerText1)
29
- Text("Text").font(.headerText2)
30
- Text("Text").font(.headerText3)
31
- Text("Text").font(.paragraph)
32
- }
33
- VStack {
34
- Text("Text").font(.description1)
35
- Text("Text").font(.description2)
36
- Text("Text").font(.description3)
37
- }
38
- VStack {
39
- Text("Text").font(.label1)
40
- Text("Text").font(.label2)
41
- Text("Text").font(.label3)
42
- Text("Text").font(.label4)
43
- }
44
- VStack {
45
- Text("Text").font(.action1)
46
- Text("Text").font(.action2)
47
- Text("Text").font(.action3)
48
- Text("Text").font(.action4)
49
- }
50
- }.padding(16)
51
- }.padding(.top)
52
- }
53
- }
@@ -1,26 +0,0 @@
1
- //
2
- // Foundation.swift
3
- // Example
4
- //
5
- // Created by Wem on 13/12/2022.
6
- //
7
-
8
- import Foundation
9
- import SwiftUI
10
-
11
- struct Foundation: View {
12
- var foundations: [ComponentModel]
13
-
14
- var body: some View {
15
- NavigationView {
16
- List(foundations) { item in
17
- NavigationLink {
18
- ComponentDetail(item)
19
- } label: {
20
- ComponentItem(item)
21
- }
22
- }
23
- .navigationTitle("Foundations")
24
- }
25
- }
26
- }
@@ -1,18 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>UIAppFonts</key>
6
- <array>
7
- <string>SFProText-Bold.ttf</string>
8
- <string>SFProText-Regular.ttf</string>
9
- <string>SFProText-Semibold.ttf</string>
10
- <string>SFProText-Light.ttf</string>
11
- <string>SFProText-Heavy.ttf</string>
12
- <string>SFProText-Medium.ttf</string>
13
- <string>SFProText-Black.ttf</string>
14
- <string>SFProText-Thin.ttf</string>
15
- <string>SFProText-Ultralight.ttf</string>
16
- </array>
17
- </dict>
18
- </plist>
@@ -1,105 +0,0 @@
1
-
2
- import MoMoUIKits
3
- import SwiftUI
4
-
5
- // MARK: - SwipeableDemo
6
-
7
- struct SwipeableDemo: View {
8
- @State var data = (1 ... 10).map { "Item \($0)" }
9
- @State var currentUserInteractionCellID: String?
10
-
11
- var body: some View {
12
- GeometryReader { _ in
13
- ScrollView {
14
- LazyVStack(alignment: .center, spacing: 10) {
15
- ForEach(data, id: \.self) { item in
16
- RowView(item: item, deletionCallback: { item in
17
- self.data = self.data.filter { anyItem->Bool in
18
- anyItem != item
19
- }
20
- }, currentUserInteractionCellID: $currentUserInteractionCellID)
21
- }
22
- }.animation(.default, value: data)
23
- .padding(20)
24
- }
25
- }
26
- }
27
- }
28
-
29
- // MARK: - RowView
30
-
31
- struct RowView: View {
32
- var item: String
33
- var deletionCallback: (String)->()
34
- @Binding var currentUserInteractionCellID: String?
35
-
36
- var body: some View {
37
- Text(item)
38
- .frame(maxWidth: .infinity)
39
- .padding(.vertical, 16)
40
- .background(RoundedRectangle(cornerRadius: 5).foregroundColor(.green))
41
- .swipeCell(id: self.item, leadingSideGroup: leftGroup(), trailingSideGroup: rightGroup())
42
- .onTapGesture {}
43
- }
44
-
45
- func leftGroup()->[SwipeCellActionItem] {
46
- return [SwipeCellActionItem(buttonView: {
47
- self.pinView(swipeOut: false)
48
-
49
- }, swipeOutButtonView: {
50
- self.pinView(swipeOut: true)
51
- }, buttonWidth: 80, backgroundColor: .yellow, swipeOutAction: true, swipeOutHapticFeedbackType: .success, swipeOutIsDestructive: false)
52
- {}]
53
- }
54
-
55
- func pinView(swipeOut: Bool)->AnyView {
56
- Group {
57
- Spacer()
58
- VStack(spacing: 2) {
59
- Image(systemName: "pin").font(.system(size: 24)).foregroundColor(.white)
60
- }.frame(maxHeight: 80).padding(.horizontal, swipeOut ? 20 : 5)
61
- if swipeOut == false {
62
- Spacer()
63
- }
64
- }.animation(.default).castToAnyView()
65
- }
66
-
67
- func rightGroup()->[SwipeCellActionItem] {
68
- return [
69
- SwipeCellActionItem(buttonView: {
70
- VStack(spacing: 2) {
71
- Image(systemName: "person.crop.circle.badge.plus").font(.system(size: 22)).foregroundColor(.white)
72
- Text("Share").fixedSize().font(.system(size: 12)).foregroundColor(.white)
73
- }.frame(maxHeight: 80).castToAnyView()
74
-
75
- }, backgroundColor: .blue) {
76
- print("share action!")
77
- },
78
- SwipeCellActionItem(buttonView: {
79
- VStack(spacing: 2) {
80
- Image(systemName: "folder.fill").font(.system(size: 22)).foregroundColor(.white)
81
- Text("Move").fixedSize().font(.system(size: 12)).foregroundColor(.white)
82
- }.frame(maxHeight: 80).castToAnyView()
83
-
84
- }, backgroundColor: .purple, actionCallback: {
85
- print("folder action")
86
- }),
87
-
88
- SwipeCellActionItem(buttonView: {
89
- self.trashView(swipeOut: false)
90
- }, swipeOutButtonView: {
91
- self.trashView(swipeOut: true)
92
- }, backgroundColor: .red, swipeOutAction: true, swipeOutHapticFeedbackType: .warning, swipeOutIsDestructive: true) {
93
- print("delete action")
94
- self.deletionCallback(item)
95
- }
96
- ]
97
- }
98
-
99
- func trashView(swipeOut: Bool)->AnyView {
100
- VStack(spacing: 3) {
101
- Image(systemName: "trash").font(.system(size: swipeOut ? 28 : 22)).foregroundColor(.white)
102
- Text("Delete").fixedSize().font(.system(size: swipeOut ? 16 : 12)).foregroundColor(.white)
103
- }.frame(maxHeight: 80).animation(.default).castToAnyView()
104
- }
105
- }
@@ -1,26 +0,0 @@
1
- //
2
- // Library.swift
3
- // Example
4
- //
5
- // Created by Wem on 13/12/2022.
6
- //
7
-
8
- import Foundation
9
- import SwiftUI
10
-
11
- struct Library: View {
12
- var libraries: [ComponentModel]
13
-
14
- var body: some View {
15
- NavigationView {
16
- List(libraries) { item in
17
- NavigationLink {
18
- ComponentDetail(item)
19
- } label: {
20
- ComponentItem(item)
21
- }
22
- }
23
- .navigationTitle("Libraries")
24
- }
25
- }
26
- }
@@ -1,11 +0,0 @@
1
- import MoMoUIKits
2
- import SwiftUI
3
-
4
- @main
5
- struct Main: App {
6
- var body: some Scene {
7
- WindowGroup {
8
- ContentView().modifier(DarkViewModifier())
9
- }
10
- }
11
- }
@@ -1,20 +0,0 @@
1
- //
2
- // Overview.swift
3
- // Example
4
- //
5
- // Created by Wem on 13/12/2022.
6
- //
7
-
8
- import Foundation
9
- import SwiftUI
10
- import MoMoUIKits
11
-
12
- struct Overview: View {
13
- @AppStorage("isDarkMode") var isDarkMode: Bool = true
14
-
15
- var body: some View {
16
- VStack {
17
- Toggle("DarkMode", isOn: $isDarkMode)
18
- }.padding()
19
- }
20
- }
@@ -1,6 +0,0 @@
1
- {
2
- "info" : {
3
- "author" : "xcode",
4
- "version" : 1
5
- }
6
- }