@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,35 +0,0 @@
1
- //
2
- // ComponentDetail.swift
3
- // Example
4
- //
5
- // Created by Wem on 23/12/2022.
6
- //
7
-
8
- import SwiftUI
9
-
10
- struct ComponentDetail: View {
11
- // MARK: Lifecycle
12
-
13
- init(_ item: ComponentModel) {
14
- self.item = item
15
- }
16
-
17
- // MARK: Internal
18
-
19
- var item: ComponentModel
20
-
21
- var body: some View {
22
- let defaultView = AnyView(ScrollView {
23
- VStack(alignment: .leading) {
24
- Text(item.name)
25
- .font(.title2)
26
- Text(item.description)
27
- }
28
- .padding()
29
- })
30
-
31
- (self.item.component ?? defaultView)
32
- .navigationTitle(item.name)
33
- .navigationBarTitleDisplayMode(.inline)
34
- }
35
- }
@@ -1,24 +0,0 @@
1
- //
2
- // ComponentItem.swift
3
- // Example
4
- //
5
- // Created by Wem on 23/12/2022.
6
- //
7
-
8
- import SwiftUI
9
-
10
- struct ComponentItem: View {
11
- var item: ComponentModel
12
-
13
- init(_ item: ComponentModel){
14
- self.item = item
15
- }
16
-
17
- var body: some View {
18
- HStack {
19
- Text(item.name)
20
- Spacer()
21
- }.frame(minHeight: 40)
22
- }
23
- }
24
-
@@ -1,33 +0,0 @@
1
- //
2
- // ComponentModel.swift
3
- // Example
4
- //
5
- // Created by Wem on 23/12/2022.
6
- //
7
-
8
- import Foundation
9
- import SwiftUI
10
- import CoreLocation
11
-
12
- struct ComponentModel: Hashable, Codable, Identifiable {
13
- var id: String
14
- var name: String
15
- var description: String
16
- var component: AnyView? {
17
- switch id {
18
- case "Typography":
19
- return AnyView(TypographyDemo())
20
- case "Button":
21
- return AnyView(ButtonDemo())
22
- case "SwipeableCell":
23
- return AnyView(SwipeableDemo())
24
- case "Popup":
25
- return AnyView(PopupDemo())
26
- case "TextInput":
27
- return AnyView(TextInputDemo())
28
- default:
29
- return nil
30
- }
31
- }
32
- }
33
-
@@ -1,53 +0,0 @@
1
-
2
- import MoMoUIKits
3
- import SwiftUI
4
-
5
- // MARK: - ContentView
6
-
7
- struct ContentView: View {
8
- @State var foundations: [ComponentModel] = []
9
- @State var libraries: [ComponentModel] = []
10
- @State var otpValue: String = ""
11
-
12
- @AppStorage("showOTPKeyboard") var showOTPKeyboard: Bool = false
13
-
14
- var body: some View {
15
- TabView {
16
- Overview()
17
- .tabItem {
18
- Label("Overview", systemImage: "lightbulb")
19
- }
20
- Foundation(foundations: foundations)
21
- .tabItem {
22
- Label("Foundation", systemImage: "internaldrive")
23
- }
24
- Library(libraries: libraries)
25
- .tabItem {
26
- Label("Library", systemImage: "folder")
27
- }
28
- }.onAppear {
29
- foundations = load("foundation.json")
30
- libraries = load("library.json")
31
- }
32
- .popup(isPresented: $showOTPKeyboard, type: .toast, dragToDismiss: false, closeOnTap: false, backgroundColor: .black.opacity(0.4)) {
33
- VStack {
34
- OTPKeyboard(value: $otpValue, length: 8, onChange: onChange, onClose: {
35
- showOTPKeyboard = false
36
- }).padding()
37
- }
38
- .background(Colors.background)
39
- }
40
- }
41
-
42
- func onChange(otp: String) {
43
- print(otp)
44
- }
45
- }
46
-
47
- // MARK: - ContentView_Previews
48
-
49
- struct ContentView_Previews: PreviewProvider {
50
- static var previews: some View {
51
- ContentView()
52
- }
53
- }
@@ -1,10 +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>com.apple.security.app-sandbox</key>
6
- <true/>
7
- <key>com.apple.security.files.user-selected.read-only</key>
8
- <true/>
9
- </dict>
10
- </plist>
@@ -1,80 +0,0 @@
1
- //
2
- // Foundation.swift
3
- // Example
4
- //
5
- // Created by Wem on 13/12/2022.
6
- //
7
-
8
- import Foundation
9
- import MoMoUIKits
10
- import SwiftUI
11
-
12
- // MARK: - ButtonDemo
13
-
14
- struct ButtonDemo: View {
15
- // MARK: Internal
16
-
17
- var body: some View {
18
- ScrollView {
19
- VStack {
20
- Toggle("Disabled", isOn: $disabled)
21
-
22
- Group {
23
- Button(title: "Button", action: onPress, type: disabled ? .disabled : .primary, size: .large, iconRight: AnyView(Image(systemName: "checkmark.circle")))
24
- Button(title: "Button", action: onPress, size: .medium, iconRight: AnyView(ProgressView().padding(.leading, 2).progressViewStyle(CircularProgressViewStyle(tint: Colors.background))
25
- ))
26
- Button(title: "Button", action: onPress, size: .small)
27
- }
28
-
29
- Group {
30
- Button(title: "Button", action: onPress, type: .danger, iconLeft: AnyView(Image(
31
- systemName: "checkmark.circle"
32
- )))
33
- Button(title: "Button", action: onPress, type: .danger, size: .medium)
34
- Button(title: "Button", action: onPress, type: .danger, size: .small)
35
- }
36
-
37
- Group {
38
- Button(title: "Button", action: onPress, type: .tonal, size: .large)
39
- Button(title: "Button", action: onPress, type: .tonal, size: .medium)
40
- Button(title: "Button", action: onPress, type: .tonal, size: .small)
41
- }
42
-
43
- Group {
44
- Button(title: "Button", action: onPress, type: .secondary, size: .large)
45
- Button(title: "Button", action: onPress, type: .secondary, size: .medium)
46
- Button(title: "Button", action: onPress, type: .secondary, size: .small)
47
- }
48
-
49
- Group {
50
- Button(title: "Button", action: onPress, type: .outline, size: .large)
51
- Button(title: "Button", action: onPress, type: .outline, size: .medium)
52
- Button(title: "Button", action: onPress, type: .outline, size: .small)
53
- }
54
-
55
- Group {
56
- Button(title: "Button", action: onPress, type: .disabled, size: .large)
57
- Button(title: "Button", action: onPress, type: .disabled, size: .medium)
58
- Button(title: "Button", action: onPress, type: .disabled, size: .small)
59
- }
60
- }.padding(16)
61
- }.padding(.top)
62
- }
63
-
64
- func onPress() {
65
- print("Button")
66
- }
67
-
68
- // MARK: Private
69
-
70
- @State private var value: String = ""
71
- @State private var disabled: Bool = false
72
- }
73
-
74
- // MARK: - ButtonDemo_Previews
75
-
76
- struct ButtonDemo_Previews: PreviewProvider {
77
- static var previews: some View {
78
- ButtonDemo()
79
- }
80
- }
@@ -1,136 +0,0 @@
1
-
2
- import SwiftUI
3
-
4
- // MARK: - ActionSheetView
5
-
6
- struct ActionSheetView<Content: View>: View {
7
- // MARK: Lifecycle
8
-
9
- init(topPadding: CGFloat = 100, fixedHeight: Bool = false, bgColor: Color = .white, @ViewBuilder content: () -> Content) {
10
- self.content = content()
11
- self.topPadding = topPadding
12
- self.fixedHeight = fixedHeight
13
- self.bgColor = bgColor
14
- }
15
-
16
- // MARK: Internal
17
-
18
- let content: Content
19
- let topPadding: CGFloat
20
- let fixedHeight: Bool
21
- let bgColor: Color
22
-
23
- var body: some View {
24
- ZStack {
25
- VStack {
26
- Color.black
27
- .opacity(0.2)
28
- .frame(width: 30, height: 6)
29
- .clipShape(Capsule())
30
- .padding(.top, 15)
31
- .padding(.bottom, 10)
32
-
33
- content
34
- .padding(.bottom, 30)
35
- .applyIf(fixedHeight) {
36
- $0.frame(height: UIScreen.main.bounds.height - topPadding)
37
- }
38
- .applyIf(!fixedHeight) {
39
- $0.frame(maxHeight: UIScreen.main.bounds.height - topPadding)
40
- }
41
- }
42
- }
43
- .background(bgColor)
44
- .fixedSize(horizontal: false, vertical: true)
45
- }
46
- }
47
-
48
- // MARK: - ActivityView
49
-
50
- private struct ActivityView: View {
51
- let emoji: String
52
- let name: String
53
- let isSelected: Bool
54
-
55
- var body: some View {
56
- HStack(spacing: 12) {
57
- Text(emoji)
58
- .font(.system(size: 24))
59
-
60
- Text(name.uppercased())
61
- .font(.system(size: 13, weight: isSelected ? .regular : .light))
62
-
63
- Spacer()
64
-
65
- if isSelected {
66
- Image(systemName: "checkmark")
67
- .foregroundColor(Color(hex: "9265F8"))
68
- }
69
- }
70
- .opacity(isSelected ? 1.0 : 0.8)
71
- }
72
- }
73
-
74
- // MARK: - ActionSheetFirst
75
-
76
- struct ActionSheetFirst: View {
77
- var body: some View {
78
- ActionSheetView(bgColor: .white) {
79
- ScrollView {
80
- VStack(alignment: .leading, spacing: 24) {
81
- ActivityView(emoji: "🤼‍♂️", name: "Sparring", isSelected: true)
82
- ActivityView(emoji: "🧘", name: "Yoga", isSelected: false)
83
- ActivityView(emoji: "🚴", name: "cycling", isSelected: false)
84
- ActivityView(emoji: "🏊", name: "Swimming", isSelected: false)
85
- ActivityView(emoji: "🏄", name: "Surfing", isSelected: false)
86
- ActivityView(emoji: "🤸", name: "Fitness", isSelected: false)
87
- ActivityView(emoji: "⛹️", name: "Basketball", isSelected: true)
88
- ActivityView(emoji: "🏋️", name: "Lifting Weights", isSelected: false)
89
- ActivityView(emoji: "⚽️", name: "Football", isSelected: false)
90
- }
91
- .padding(.horizontal, 20)
92
- }
93
- }
94
- }
95
- }
96
-
97
- // MARK: - ActionSheetSecond
98
-
99
- struct ActionSheetSecond: View {
100
- var description: String = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam consectetur orci eget rutrum dignissim. Vivamus aliquam a massa a scelerisque. Integer eleifend lectus non blandit ultricies."
101
-
102
- var body: some View {
103
- ActionSheetView(bgColor: .white) {
104
- ScrollView {
105
- VStack(alignment: .leading, spacing: 16) {
106
- Text("Privacy Policy")
107
- .font(.system(size: 24))
108
-
109
- Text("\(description)\(description)\(description)\(description)\(description)\(description)")
110
- .font(.system(size: 14))
111
- .opacity(0.6)
112
- }
113
- .padding(.horizontal, 24)
114
- }
115
- }
116
- }
117
- }
118
-
119
- // MARK: - ActionSheets_Previews
120
-
121
- struct ActionSheets_Previews: PreviewProvider {
122
- static var previews: some View {
123
- ZStack {
124
- Rectangle()
125
- .ignoresSafeArea()
126
- ActionSheetFirst()
127
- }
128
-
129
- ZStack {
130
- Rectangle()
131
- .ignoresSafeArea()
132
- ActionSheetSecond()
133
- }
134
- }
135
- }
136
-
@@ -1,127 +0,0 @@
1
-
2
-
3
- import SwiftUI
4
-
5
- // MARK: - FloatTopFirst
6
-
7
- struct FloatTopFirst: View {
8
- var body: some View {
9
- ZStack {
10
- RoundedRectangle(cornerRadius: 12)
11
- .fill(Color(hex: "E0E3E8"))
12
-
13
- HStack(spacing: 0) {
14
- Image("avatar1")
15
- .aspectRatio(1.0, contentMode: .fit)
16
- .cornerRadius(16)
17
- .padding(16.0)
18
-
19
- VStack(alignment: .leading, spacing: 8) {
20
- Group {
21
- Text("Adam Jameson")
22
- .bold()
23
- .foregroundColor(.black) +
24
- Text(" invites you to join his training")
25
- .foregroundColor(.black.opacity(0.6))
26
- }
27
-
28
- Button {
29
- debugPrint("Accepted!")
30
- } label: {
31
- Text("Accept".uppercased())
32
- .font(.system(size: 14, weight: .black))
33
- }
34
- }
35
-
36
- Spacer()
37
- }
38
- }
39
- .frame(height: 98)
40
- .padding(.horizontal, 16)
41
- }
42
- }
43
-
44
- // MARK: - FloatTopSecond
45
-
46
- struct FloatTopSecond: View {
47
- var body: some View {
48
- HStack(spacing: 0) {
49
- VStack(alignment: .leading, spacing: 2) {
50
- Text("We give you a gift!")
51
- .foregroundColor(.white)
52
- .font(.system(size: 18))
53
-
54
- Text("30% discount until the end of the month on all products of the company.")
55
- .foregroundColor(.white)
56
- .font(.system(size: 16))
57
- .opacity(0.8)
58
- }
59
-
60
- Spacer()
61
-
62
- Image("gift")
63
- .aspectRatio(1.0, contentMode: .fit)
64
- }
65
- .padding(16)
66
- .background(Color(hex: "9265F8").cornerRadius(12))
67
- .shadow(color: Color(hex: "9265F8").opacity(0.5), radius: 40, x: 0, y: 12)
68
- .padding(.horizontal, 16)
69
- }
70
- }
71
-
72
- // MARK: - FloatBottomFirst
73
-
74
- struct FloatBottomFirst: View {
75
- var body: some View {
76
- HStack(spacing: 0) {
77
- Text("Your message has been sent to Alex Brant")
78
- .font(.system(size: 15))
79
- .foregroundColor(.black)
80
- Spacer()
81
- Image("avatar2")
82
- .frame(width: 32, height: 32)
83
- .cornerRadius(16)
84
- }
85
- .padding(16)
86
- .background(Color.white.cornerRadius(12))
87
- .shadow(color: .black.opacity(0.08), radius: 2, x: 0, y: 0)
88
- .shadow(color: .black.opacity(0.16), radius: 24, x: 0, y: 0)
89
- .padding(.horizontal, 16)
90
- }
91
- }
92
-
93
- // MARK: - FloatBottomSecond
94
-
95
- struct FloatBottomSecond: View {
96
- var body: some View {
97
- HStack(spacing: 8) {
98
- Image(systemName: "wifi.slash")
99
- .foregroundColor(.white)
100
- .frame(width: 24, height: 24)
101
-
102
- Text("Check your network connection and try again")
103
- .foregroundColor(.white)
104
- .font(.system(size: 16))
105
- }
106
- .padding(16)
107
- .background(Color(hex: "FFB93D").cornerRadius(12))
108
- .padding(.horizontal, 16)
109
- }
110
- }
111
-
112
- // MARK: - Floats_Previews
113
-
114
- struct Floats_Previews: PreviewProvider {
115
- static var previews: some View {
116
- ZStack {
117
- Rectangle()
118
- .ignoresSafeArea()
119
- VStack {
120
- FloatTopFirst()
121
- FloatTopSecond()
122
- FloatBottomFirst()
123
- FloatBottomSecond()
124
- }
125
- }
126
- }
127
- }
@@ -1,101 +0,0 @@
1
-
2
- import SwiftUI
3
-
4
- // MARK: - PopupMiddle
5
-
6
- struct PopupMiddle: View {
7
- @Binding var isPresented: Bool
8
-
9
- var body: some View {
10
- VStack(spacing: 12) {
11
- Image("winner")
12
- .resizable()
13
- .scaledToFit()
14
- .frame(maxWidth: 226, maxHeight: 226)
15
-
16
- Text("Congratulations!")
17
- .foregroundColor(.black)
18
- .font(.system(size: 24))
19
- .padding(.top, 12)
20
-
21
- Text("In two weeks, you did 12 workouts and burned 2671 calories. That's 566 calories more than last month. Continue at the same pace and the result will please you.")
22
- .foregroundColor(.black)
23
- .font(.system(size: 16))
24
- .opacity(0.6)
25
- .multilineTextAlignment(.center)
26
- .padding(.bottom, 20)
27
-
28
- Button("Thanks") {
29
- isPresented = false
30
- }
31
- .buttonStyle(.plain)
32
- .font(.system(size: 18, weight: .bold))
33
- .frame(maxWidth: .infinity)
34
- .padding(.vertical, 18)
35
- .padding(.horizontal, 24)
36
- .foregroundColor(.white)
37
- .background(Color(hex: "9265F8"))
38
- .cornerRadius(12)
39
- }
40
- .padding(EdgeInsets(top: 37, leading: 24, bottom: 40, trailing: 24))
41
- .background(Color.white.cornerRadius(20))
42
- .shadow(color: .black.opacity(0.08), radius: 2, x: 0, y: 0)
43
- .shadow(color: .black.opacity(0.16), radius: 24, x: 0, y: 0)
44
- .padding(.horizontal, 40)
45
- }
46
- }
47
-
48
- // MARK: - PopupBottomFirst
49
-
50
- struct PopupBottomFirst: View {
51
- @Binding var isPresented: Bool
52
-
53
- var body: some View {
54
- VStack(spacing: 12) {
55
- Text("Policy changes")
56
- .foregroundColor(.black)
57
- .font(.system(size: 24))
58
-
59
- Text("Policy change occurs through interactions between wide external changes or shocks to the political system and the success of the ideas in the coalitions, which may cause actors in the advocacy coalition to shift coalitions.")
60
- .foregroundColor(.black)
61
- .font(.system(size: 16))
62
- .opacity(0.6)
63
- .multilineTextAlignment(.center)
64
- .padding(.bottom, 12)
65
-
66
- Button("Ok, I accept") {
67
- isPresented = false
68
- }
69
- .buttonStyle(.plain)
70
- .font(.system(size: 18, weight: .bold))
71
- .frame(maxWidth: .infinity)
72
- .padding(.vertical, 18)
73
- .foregroundColor(.white)
74
- .background(Color(hex: "FFB93D"))
75
- .cornerRadius(12)
76
- }
77
- .padding(EdgeInsets(top: 37, leading: 24, bottom: 40, trailing: 24))
78
- .background(Color.white.cornerRadius(20))
79
- .shadow(color: .black.opacity(0.08), radius: 2, x: 0, y: 0)
80
- .shadow(color: .black.opacity(0.16), radius: 24, x: 0, y: 0)
81
- .padding(.horizontal, 16)
82
- }
83
- }
84
-
85
- // MARK: - Popups_Previews
86
-
87
- struct Popups_Previews: PreviewProvider {
88
- static var previews: some View {
89
- ZStack {
90
- Rectangle()
91
- .ignoresSafeArea()
92
- PopupMiddle(isPresented: .constant(true))
93
- }
94
-
95
- ZStack {
96
- Rectangle()
97
- .ignoresSafeArea()
98
- PopupBottomFirst(isPresented: .constant(false))
99
- }
100
- }
101
- }