@momo-kits/native-kits 0.0.1-beta.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 (101) hide show
  1. package/CODE_OF_CONDUCT.md +133 -0
  2. package/CONTRIBUTING.md +114 -0
  3. package/LICENSE +20 -0
  4. package/README.md +6 -0
  5. package/android/build.gradle +82 -0
  6. package/android/gradle.properties +5 -0
  7. package/android/src/main/AndroidManifest.xml +4 -0
  8. package/android/src/main/java/com/momoplatform/nativekits/NativeKitsPackage.kt +17 -0
  9. package/android/src/main/java/com/momoplatform/nativekits/NativeKitsViewManager.kt +20 -0
  10. package/example/ios/Example/Assets.xcassets/AppIcon.appiconset/Contents.json +63 -0
  11. package/example/ios/Example/Assets.xcassets/Background.colorset/Contents.json +38 -0
  12. package/example/ios/Example/Assets.xcassets/Border.colorset/Contents.json +38 -0
  13. package/example/ios/Example/Assets.xcassets/Card.colorset/Contents.json +38 -0
  14. package/example/ios/Example/Assets.xcassets/Contents.json +6 -0
  15. package/example/ios/Example/Assets.xcassets/Error.colorset/Contents.json +38 -0
  16. package/example/ios/Example/Assets.xcassets/Primary.colorset/Contents.json +38 -0
  17. package/example/ios/Example/Assets.xcassets/PrimaryDark.colorset/Contents.json +38 -0
  18. package/example/ios/Example/Assets.xcassets/PrimaryLight.colorset/Contents.json +38 -0
  19. package/example/ios/Example/Assets.xcassets/Secondary.colorset/Contents.json +38 -0
  20. package/example/ios/Example/Assets.xcassets/Success.colorset/Contents.json +38 -0
  21. package/example/ios/Example/Assets.xcassets/Text.colorset/Contents.json +38 -0
  22. package/example/ios/Example/Assets.xcassets/TextSecondary.colorset/Contents.json +38 -0
  23. package/example/ios/Example/Assets.xcassets/Warning.colorset/Contents.json +38 -0
  24. package/example/ios/Example/ComponentDetail.swift +35 -0
  25. package/example/ios/Example/ComponentItem.swift +24 -0
  26. package/example/ios/Example/ComponentModel.swift +31 -0
  27. package/example/ios/Example/ContentView.swift +53 -0
  28. package/example/ios/Example/Example.entitlements +10 -0
  29. package/example/ios/Example/Foundation/ButtonDemo.swift +80 -0
  30. package/example/ios/Example/Foundation/Popup/ActionSheets.swift +136 -0
  31. package/example/ios/Example/Foundation/Popup/Floats.swift +127 -0
  32. package/example/ios/Example/Foundation/Popup/Popups.swift +101 -0
  33. package/example/ios/Example/Foundation/PopupDemo.swift +366 -0
  34. package/example/ios/Example/Foundation/TypographyDemo.swift +53 -0
  35. package/example/ios/Example/Foundation.swift +26 -0
  36. package/example/ios/Example/Info.plist +18 -0
  37. package/example/ios/Example/Library/SwipeableDemo.swift +105 -0
  38. package/example/ios/Example/Library.swift +26 -0
  39. package/example/ios/Example/Main.swift +11 -0
  40. package/example/ios/Example/Overview.swift +20 -0
  41. package/example/ios/Example/Preview Content/Preview Assets.xcassets/Contents.json +6 -0
  42. package/example/ios/Example/Resource/SFProText-Black.ttf +0 -0
  43. package/example/ios/Example/Resource/SFProText-Bold.ttf +0 -0
  44. package/example/ios/Example/Resource/SFProText-Heavy.ttf +0 -0
  45. package/example/ios/Example/Resource/SFProText-Light.ttf +0 -0
  46. package/example/ios/Example/Resource/SFProText-Medium.ttf +0 -0
  47. package/example/ios/Example/Resource/SFProText-Regular.ttf +0 -0
  48. package/example/ios/Example/Resource/SFProText-Semibold.ttf +0 -0
  49. package/example/ios/Example/Resource/SFProText-Thin.ttf +0 -0
  50. package/example/ios/Example/Resource/SFProText-Ultralight.ttf +0 -0
  51. package/example/ios/Example/Resource/foundation.json +33 -0
  52. package/example/ios/Example/Resource/library.json +8 -0
  53. package/example/ios/Example/Utils.swift +30 -0
  54. package/example/ios/Example/ViewModifier/DarkViewModifier.swift +22 -0
  55. package/example/ios/Example.xcodeproj/project.pbxproj +565 -0
  56. package/example/ios/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  57. package/example/ios/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  58. package/example/ios/Example.xcodeproj/project.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  59. package/example/ios/Example.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  60. package/example/ios/Example.xcworkspace/contents.xcworkspacedata +10 -0
  61. package/example/ios/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  62. package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  63. package/example/ios/Example.xcworkspace/xcuserdata/wem.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +6 -0
  64. package/example/ios/Podfile +6 -0
  65. package/example/ios/Podfile.lock +16 -0
  66. package/example/ios/Pods/Local Podspecs/MoMoUIKits.podspec.json +29 -0
  67. package/example/ios/Pods/Manifest.lock +16 -0
  68. package/example/ios/Pods/Pods.xcodeproj/project.pbxproj +661 -0
  69. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +58 -0
  70. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/Pods-Example.xcscheme +58 -0
  71. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/wem.xcuserdatad/xcschemes/xcschememanagement.plist +25 -0
  72. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-dummy.m +5 -0
  73. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-prefix.pch +12 -0
  74. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits-umbrella.h +16 -0
  75. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.debug.xcconfig +12 -0
  76. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.modulemap +6 -0
  77. package/example/ios/Pods/Target Support Files/MoMoUIKits/MoMoUIKits.release.xcconfig +12 -0
  78. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown +3 -0
  79. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist +29 -0
  80. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m +5 -0
  81. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h +16 -0
  82. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig +14 -0
  83. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap +6 -0
  84. package/example/ios/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig +14 -0
  85. package/ios/Button/Button.swift +131 -0
  86. package/ios/Colors+Spacing/Colors.swift +170 -0
  87. package/ios/Colors+Spacing/Radius.swift +11 -0
  88. package/ios/Colors+Spacing/Spacing.swift +12 -0
  89. package/ios/Extensions/Color++.swift +25 -0
  90. package/ios/OTPKeyboard/KeyboardButton.swift +33 -0
  91. package/ios/OTPKeyboard/OTPKeyboard.swift +145 -0
  92. package/ios/Popup/Modifiers.swift +172 -0
  93. package/ios/Popup/PopupView.swift +397 -0
  94. package/ios/Popup/Utils.swift +186 -0
  95. package/ios/Swipeable/SwipeCell.swift +270 -0
  96. package/ios/Swipeable/SwipeCellModel.swift +86 -0
  97. package/ios/Theme.md +18 -0
  98. package/ios/Typography/Typography.swift +30 -0
  99. package/ios/native-kits.podspec +15 -0
  100. package/package.json +8 -0
  101. package/publish.sh +28 -0
@@ -0,0 +1,38 @@
1
+ {
2
+ "colors" : [
3
+ {
4
+ "color" : {
5
+ "color-space" : "srgb",
6
+ "components" : {
7
+ "alpha" : "1.000",
8
+ "blue" : "0.471",
9
+ "green" : "0.149",
10
+ "red" : "0.737"
11
+ }
12
+ },
13
+ "idiom" : "universal"
14
+ },
15
+ {
16
+ "appearances" : [
17
+ {
18
+ "appearance" : "luminosity",
19
+ "value" : "dark"
20
+ }
21
+ ],
22
+ "color" : {
23
+ "color-space" : "srgb",
24
+ "components" : {
25
+ "alpha" : "1.000",
26
+ "blue" : "0.471",
27
+ "green" : "0.149",
28
+ "red" : "0.737"
29
+ }
30
+ },
31
+ "idiom" : "universal"
32
+ }
33
+ ],
34
+ "info" : {
35
+ "author" : "xcode",
36
+ "version" : 1
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "colors" : [
3
+ {
4
+ "color" : {
5
+ "color-space" : "srgb",
6
+ "components" : {
7
+ "alpha" : "1.000",
8
+ "blue" : "0.957",
9
+ "green" : "0.918",
10
+ "red" : "0.992"
11
+ }
12
+ },
13
+ "idiom" : "universal"
14
+ },
15
+ {
16
+ "appearances" : [
17
+ {
18
+ "appearance" : "luminosity",
19
+ "value" : "dark"
20
+ }
21
+ ],
22
+ "color" : {
23
+ "color-space" : "srgb",
24
+ "components" : {
25
+ "alpha" : "1.000",
26
+ "blue" : "0.957",
27
+ "green" : "0.918",
28
+ "red" : "0.992"
29
+ }
30
+ },
31
+ "idiom" : "universal"
32
+ }
33
+ ],
34
+ "info" : {
35
+ "author" : "xcode",
36
+ "version" : 1
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "colors" : [
3
+ {
4
+ "color" : {
5
+ "color-space" : "srgb",
6
+ "components" : {
7
+ "alpha" : "1.000",
8
+ "blue" : "1.000",
9
+ "green" : "0.478",
10
+ "red" : "0.000"
11
+ }
12
+ },
13
+ "idiom" : "universal"
14
+ },
15
+ {
16
+ "appearances" : [
17
+ {
18
+ "appearance" : "luminosity",
19
+ "value" : "dark"
20
+ }
21
+ ],
22
+ "color" : {
23
+ "color-space" : "srgb",
24
+ "components" : {
25
+ "alpha" : "1.000",
26
+ "blue" : "1.000",
27
+ "green" : "0.478",
28
+ "red" : "0.000"
29
+ }
30
+ },
31
+ "idiom" : "universal"
32
+ }
33
+ ],
34
+ "info" : {
35
+ "author" : "xcode",
36
+ "version" : 1
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "colors" : [
3
+ {
4
+ "color" : {
5
+ "color-space" : "srgb",
6
+ "components" : {
7
+ "alpha" : "1.000",
8
+ "blue" : "0.349",
9
+ "green" : "0.780",
10
+ "red" : "0.204"
11
+ }
12
+ },
13
+ "idiom" : "universal"
14
+ },
15
+ {
16
+ "appearances" : [
17
+ {
18
+ "appearance" : "luminosity",
19
+ "value" : "dark"
20
+ }
21
+ ],
22
+ "color" : {
23
+ "color-space" : "srgb",
24
+ "components" : {
25
+ "alpha" : "1.000",
26
+ "blue" : "0.349",
27
+ "green" : "0.780",
28
+ "red" : "0.204"
29
+ }
30
+ },
31
+ "idiom" : "universal"
32
+ }
33
+ ],
34
+ "info" : {
35
+ "author" : "xcode",
36
+ "version" : 1
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "colors" : [
3
+ {
4
+ "color" : {
5
+ "color-space" : "srgb",
6
+ "components" : {
7
+ "alpha" : "1.000",
8
+ "blue" : "0.282",
9
+ "green" : "0.216",
10
+ "red" : "0.169"
11
+ }
12
+ },
13
+ "idiom" : "universal"
14
+ },
15
+ {
16
+ "appearances" : [
17
+ {
18
+ "appearance" : "luminosity",
19
+ "value" : "dark"
20
+ }
21
+ ],
22
+ "color" : {
23
+ "color-space" : "srgb",
24
+ "components" : {
25
+ "alpha" : "1.000",
26
+ "blue" : "0.933",
27
+ "green" : "0.925",
28
+ "red" : "0.925"
29
+ }
30
+ },
31
+ "idiom" : "universal"
32
+ }
33
+ ],
34
+ "info" : {
35
+ "author" : "xcode",
36
+ "version" : 1
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "colors" : [
3
+ {
4
+ "color" : {
5
+ "color-space" : "srgb",
6
+ "components" : {
7
+ "alpha" : "1.000",
8
+ "blue" : "0.812",
9
+ "green" : "0.796",
10
+ "red" : "0.784"
11
+ }
12
+ },
13
+ "idiom" : "universal"
14
+ },
15
+ {
16
+ "appearances" : [
17
+ {
18
+ "appearance" : "luminosity",
19
+ "value" : "dark"
20
+ }
21
+ ],
22
+ "color" : {
23
+ "color-space" : "srgb",
24
+ "components" : {
25
+ "alpha" : "1.000",
26
+ "blue" : "0.376",
27
+ "green" : "0.318",
28
+ "red" : "0.278"
29
+ }
30
+ },
31
+ "idiom" : "universal"
32
+ }
33
+ ],
34
+ "info" : {
35
+ "author" : "xcode",
36
+ "version" : 1
37
+ }
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "colors" : [
3
+ {
4
+ "color" : {
5
+ "color-space" : "srgb",
6
+ "components" : {
7
+ "alpha" : "1.000",
8
+ "blue" : "0.086",
9
+ "green" : "0.549",
10
+ "red" : "0.980"
11
+ }
12
+ },
13
+ "idiom" : "universal"
14
+ },
15
+ {
16
+ "appearances" : [
17
+ {
18
+ "appearance" : "luminosity",
19
+ "value" : "dark"
20
+ }
21
+ ],
22
+ "color" : {
23
+ "color-space" : "srgb",
24
+ "components" : {
25
+ "alpha" : "1.000",
26
+ "blue" : "0.086",
27
+ "green" : "0.549",
28
+ "red" : "0.980"
29
+ }
30
+ },
31
+ "idiom" : "universal"
32
+ }
33
+ ],
34
+ "info" : {
35
+ "author" : "xcode",
36
+ "version" : 1
37
+ }
38
+ }
@@ -0,0 +1,35 @@
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
+ }
@@ -0,0 +1,24 @@
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
+
@@ -0,0 +1,31 @@
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
+ default:
27
+ return nil
28
+ }
29
+ }
30
+ }
31
+
@@ -0,0 +1,53 @@
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
+ }
@@ -0,0 +1,10 @@
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>
@@ -0,0 +1,80 @@
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
+ }
@@ -0,0 +1,136 @@
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
+