diff --git a/ClerkDemo/ClerkDemo.xcodeproj/project.pbxproj b/ClerkDemo/ClerkDemo.xcodeproj/project.pbxproj index 10f86451..ee9f99d3 100644 --- a/ClerkDemo/ClerkDemo.xcodeproj/project.pbxproj +++ b/ClerkDemo/ClerkDemo.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 8F74DCDA2BC74C8700C7C5F6 /* ClerkDemo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ClerkDemo.entitlements; sourceTree = ""; }; 8F8116662B9BC35B00E2858C /* ClerkDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ClerkDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 8F8116692B9BC35B00E2858C /* ClerkDemoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClerkDemoApp.swift; sourceTree = ""; }; 8F81166D2B9BC35C00E2858C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -63,6 +64,7 @@ 8F8116682B9BC35B00E2858C /* ClerkDemo */ = { isa = PBXGroup; children = ( + 8F74DCDA2BC74C8700C7C5F6 /* ClerkDemo.entitlements */, 8F8407862BA36ACB00218DB3 /* Info.plist */, 8F8116692B9BC35B00E2858C /* ClerkDemoApp.swift */, 8F81167E2B9BC45000E2858C /* HomeView.swift */, @@ -304,6 +306,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = ClerkDemo/ClerkDemo.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"ClerkDemo/Preview Content\""; @@ -325,13 +328,15 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.clerk.ClerkDemo; PRODUCT_NAME = "$(TARGET_NAME)"; - SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator xros xrsimulator"; - SUPPORTS_MACCATALYST = NO; + SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx xros xrsimulator"; + SUPPORTS_MACCATALYST = YES; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3,7"; + TVOS_DEPLOYMENT_TARGET = 16.0; + XROS_DEPLOYMENT_TARGET = 1.0; }; name = Debug; }; @@ -340,6 +345,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = ClerkDemo/ClerkDemo.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"ClerkDemo/Preview Content\""; @@ -361,13 +367,15 @@ MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.clerk.ClerkDemo; PRODUCT_NAME = "$(TARGET_NAME)"; - SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator xros xrsimulator"; - SUPPORTS_MACCATALYST = NO; + SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx xros xrsimulator"; + SUPPORTS_MACCATALYST = YES; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3,7"; + TVOS_DEPLOYMENT_TARGET = 16.0; + XROS_DEPLOYMENT_TARGET = 1.0; }; name = Release; }; diff --git a/ClerkDemo/ClerkDemo/ClerkDemo.entitlements b/ClerkDemo/ClerkDemo/ClerkDemo.entitlements new file mode 100644 index 00000000..0e0af634 --- /dev/null +++ b/ClerkDemo/ClerkDemo/ClerkDemo.entitlements @@ -0,0 +1,14 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + keychain-access-groups + + $(AppIdentifierPrefix)com.clerk.ClerkDemo + + + diff --git a/ClerkDemo/ClerkDemo/ClerkDemoApp.swift b/ClerkDemo/ClerkDemo/ClerkDemoApp.swift index f4000ed7..47b9faab 100644 --- a/ClerkDemo/ClerkDemo/ClerkDemoApp.swift +++ b/ClerkDemo/ClerkDemo/ClerkDemoApp.swift @@ -15,7 +15,9 @@ struct ClerkDemoApp: App { var body: some Scene { WindowGroup { HomeView() + #if os(iOS) .clerkProvider() + #endif .task { Clerk.shared.configure(publishableKey: publishableKey) try? await Clerk.shared.load() diff --git a/ClerkDemo/ClerkDemo/DemoSpecific/DemoAppSettingsView.swift b/ClerkDemo/ClerkDemo/DemoSpecific/DemoAppSettingsView.swift index 1e924348..e6016a50 100644 --- a/ClerkDemo/ClerkDemo/DemoSpecific/DemoAppSettingsView.swift +++ b/ClerkDemo/ClerkDemo/DemoSpecific/DemoAppSettingsView.swift @@ -42,7 +42,7 @@ struct DemoAppSettingsView: View { } .navigationTitle("Demo Settings") .toolbar { - ToolbarItem(placement: .topBarTrailing) { + ToolbarItem(placement: .primaryAction) { Button(action: { dismiss() }, label: { @@ -56,10 +56,7 @@ struct DemoAppSettingsView: View { } .overlay { if isLoading { - ZStack { - Color(.systemBackground).opacity(0.5).ignoresSafeArea() - ProgressView() - } + ProgressView() } } } diff --git a/ClerkDemo/ClerkDemo/HomeView.swift b/ClerkDemo/ClerkDemo/HomeView.swift index 4e634176..1ac30dbf 100644 --- a/ClerkDemo/ClerkDemo/HomeView.swift +++ b/ClerkDemo/ClerkDemo/HomeView.swift @@ -14,6 +14,7 @@ struct HomeView: View { var body: some View { NavigationStack { List { + #if os(iOS) Section("Instructions:") { Text("Create an account on [Clerk.com](https://www.clerk.com).") Text("Create an app.") @@ -22,11 +23,16 @@ struct HomeView: View { Text("Tap the user button to get started.") } .font(.subheadline) + #else + Text("Clerk UI components are only supported on iOS (iPhone, iPad, Mac Catalyst), but you can still use the Clerk SDK to interact with the Clerk API on other platforms.") + #endif } .navigationTitle("Clerk Demo") .toolbar { - ToolbarItem(placement: .topBarTrailing) { + ToolbarItem(placement: .primaryAction) { + #if os(iOS) UserButton() + #endif } } } @@ -34,9 +40,11 @@ struct HomeView: View { if clerk.loadingState == .notLoaded { VStack { Spacer() + #if os(iOS) OrgLogoView() .frame(width: 100, height: 100) .padding() + #endif Spacer() Spacer() } @@ -45,7 +53,9 @@ struct HomeView: View { .transition(.opacity.animation(.default)) } } + #if os(iOS) .demoSettings() + #endif } } diff --git a/Package.swift b/Package.swift index 3fe0e3c4..51061ed1 100644 --- a/Package.swift +++ b/Package.swift @@ -5,7 +5,7 @@ import PackageDescription let package = Package( name: "Clerk", - platforms: [.iOS(.v16), .macCatalyst(.v13), .macOS(.v13), .watchOS(.v9), .tvOS(.v16), .visionOS(.v1)], + platforms: [.iOS(.v16), .macCatalyst(.v16), .macOS(.v13), .watchOS(.v9), .tvOS(.v16), .visionOS(.v1)], products: [ // Products define the executables and libraries a package produces, making them visible to other packages. .library( diff --git a/Sources/API/Models/ExternalAccount.swift b/Sources/API/Models/ExternalAccount.swift index 9328f383..1242c985 100644 --- a/Sources/API/Models/ExternalAccount.swift +++ b/Sources/API/Models/ExternalAccount.swift @@ -94,6 +94,7 @@ extension ExternalAccount { extension ExternalAccount { + #if !os(tvOS) /// Invokes a re-authorization flow for an existing external account. @MainActor public func reauthorize() async throws { @@ -107,6 +108,7 @@ extension ExternalAccount { let authSession = ExternalAuthWebSession(url: url, authAction: .reauthorize) try await authSession.start() } + #endif } diff --git a/Sources/API/Models/PhoneNumber.swift b/Sources/API/Models/PhoneNumber.swift index 103b80a4..26df714f 100644 --- a/Sources/API/Models/PhoneNumber.swift +++ b/Sources/API/Models/PhoneNumber.swift @@ -58,7 +58,7 @@ extension PhoneNumber { let phoneNumberKit = Container.shared.phoneNumberKit() guard let phoneNumber = try? phoneNumberKit.parse(phoneNumber) else { return phoneNumber } - #if canImport(UIKit) + #if os(iOS) if let region = phoneNumber.regionID, diff --git a/Sources/API/Models/SignIn.swift b/Sources/API/Models/SignIn.swift index 3a589071..35e53e22 100644 --- a/Sources/API/Models/SignIn.swift +++ b/Sources/API/Models/SignIn.swift @@ -351,6 +351,7 @@ public struct SignIn: Codable, Sendable { return response } + #if !os(tvOS) /// Signs in users via OAuth. This is commonly known as Single Sign On (SSO), where an external account is used for verifying the user's identity. @MainActor public func authenticateWithRedirect() async throws { @@ -361,6 +362,7 @@ public struct SignIn: Codable, Sendable { let authSession = ExternalAuthWebSession(url: url, authAction: .signIn) try await authSession.start() } + #endif } extension SignIn { diff --git a/Sources/API/Models/SignUp.swift b/Sources/API/Models/SignUp.swift index 8a75e329..a19e7947 100644 --- a/Sources/API/Models/SignUp.swift +++ b/Sources/API/Models/SignUp.swift @@ -290,6 +290,7 @@ public struct SignUp: Codable, Sendable { public let code: String } + #if !os(tvOS) /// Signs in users via OAuth. This is commonly known as Single Sign On (SSO), where an external account is used for verifying the user's identity. @MainActor public func authenticateWithRedirect() async throws { @@ -304,6 +305,7 @@ public struct SignUp: Codable, Sendable { let authSession = ExternalAuthWebSession(url: url, authAction: .signUp) try await authSession.start() } + #endif /// Returns the current sign up. @MainActor diff --git a/Sources/API/Utils/ExternalAuthWebSession.swift b/Sources/API/Utils/ExternalAuthWebSession.swift index a54743d6..e379174c 100644 --- a/Sources/API/Utils/ExternalAuthWebSession.swift +++ b/Sources/API/Utils/ExternalAuthWebSession.swift @@ -5,6 +5,8 @@ // Created by Mike Pitre on 10/19/23. // +#if !os(tvOS) + import AuthenticationServices @MainActor @@ -105,3 +107,5 @@ extension ExternalAuthWebSession: ASWebAuthenticationPresentationContextProvidin } +#endif + diff --git a/Sources/API/Utils/LocalAuth.swift b/Sources/API/Utils/LocalAuth.swift index cd59fe88..49071362 100644 --- a/Sources/API/Utils/LocalAuth.swift +++ b/Sources/API/Utils/LocalAuth.swift @@ -5,6 +5,8 @@ // Created by Mike Pitre on 3/25/24. // +#if !os(tvOS) + import Foundation import SwiftUI import LocalAuthentication @@ -139,3 +141,5 @@ extension LABiometryType { } } + +#endif diff --git a/Sources/UI/ClerkTheme.swift b/Sources/UI/ClerkTheme.swift index fe2fef4d..985550ed 100644 --- a/Sources/UI/ClerkTheme.swift +++ b/Sources/UI/ClerkTheme.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 10/12/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/ClerkUIState.swift b/Sources/UI/ClerkUIState.swift index 098f2e59..fef630f2 100644 --- a/Sources/UI/ClerkUIState.swift +++ b/Sources/UI/ClerkUIState.swift @@ -5,12 +5,14 @@ // Created by Mike Pitre on 10/25/23. // -#if canImport(UIKit) +#if os(iOS) import Foundation public final class ClerkUIState: ObservableObject { + public init() {} + /// Is the auth view being displayed. @Published public var authIsPresented = false diff --git a/Sources/UI/Common/AccordionView.swift b/Sources/UI/Common/AccordionView.swift index d0491b03..69309525 100644 --- a/Sources/UI/Common/AccordionView.swift +++ b/Sources/UI/Common/AccordionView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/3/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/AsyncButton.swift b/Sources/UI/Common/AsyncButton.swift index 424f7ebb..03f84e68 100644 --- a/Sources/UI/Common/AsyncButton.swift +++ b/Sources/UI/Common/AsyncButton.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 10/4/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/AuthProviderButton.swift b/Sources/UI/Common/AuthProviderButton.swift index ca1937f4..b89b89d9 100644 --- a/Sources/UI/Common/AuthProviderButton.swift +++ b/Sources/UI/Common/AuthProviderButton.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 9/22/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import NukeUI diff --git a/Sources/UI/Common/AuthProviderIcon.swift b/Sources/UI/Common/AuthProviderIcon.swift index 919dde67..aaeb4603 100644 --- a/Sources/UI/Common/AuthProviderIcon.swift +++ b/Sources/UI/Common/AuthProviderIcon.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 3/6/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import NukeUI diff --git a/Sources/UI/Common/AuthSocialProvidersView.swift b/Sources/UI/Common/AuthSocialProvidersView.swift index 22a1fb74..8d51213e 100644 --- a/Sources/UI/Common/AuthSocialProvidersView.swift +++ b/Sources/UI/Common/AuthSocialProvidersView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/2/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import Algorithms diff --git a/Sources/UI/Common/CapsuleTag.swift b/Sources/UI/Common/CapsuleTag.swift index 11d559c1..95b0d928 100644 --- a/Sources/UI/Common/CapsuleTag.swift +++ b/Sources/UI/Common/CapsuleTag.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/8/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/CheckBoxView.swift b/Sources/UI/Common/CheckBoxView.swift index 1a36df15..f90d9f0a 100644 --- a/Sources/UI/Common/CheckBoxView.swift +++ b/Sources/UI/Common/CheckBoxView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 12/19/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/CodeFormView.swift b/Sources/UI/Common/CodeFormView.swift index b07179e1..a2e795e5 100644 --- a/Sources/UI/Common/CodeFormView.swift +++ b/Sources/UI/Common/CodeFormView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/6/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/CustomTextField.swift b/Sources/UI/Common/CustomTextField.swift index 422ba8c3..f443645b 100644 --- a/Sources/UI/Common/CustomTextField.swift +++ b/Sources/UI/Common/CustomTextField.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 9/22/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/DismissButton.swift b/Sources/UI/Common/DismissButton.swift index 1e0e71c5..1e20b57b 100644 --- a/Sources/UI/Common/DismissButton.swift +++ b/Sources/UI/Common/DismissButton.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 12/13/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/ErrorPresentation.swift b/Sources/UI/Common/ErrorPresentation.swift index cb58161e..9dbae8e5 100644 --- a/Sources/UI/Common/ErrorPresentation.swift +++ b/Sources/UI/Common/ErrorPresentation.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 12/11/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI @@ -72,12 +72,7 @@ extension View { } #Preview { - Color(.systemBackground) - .sheet(item: .constant(ErrorWrapper(error: ClerkClientError(message: "Password is incorrect. Try again, or use another method.")))) { errorWrapper in - ErrorView(errorWrapper: errorWrapper) - .presentationDetents([.height(250)]) - .presentationDragIndicator(.visible) - } + ErrorView(errorWrapper: ErrorWrapper(error: ClerkClientError(message: "Password is incorrect. Try again, or use another method."))) } #endif diff --git a/Sources/UI/Common/GetHelpView.swift b/Sources/UI/Common/GetHelpView.swift index 34eb20b1..f2020a93 100644 --- a/Sources/UI/Common/GetHelpView.swift +++ b/Sources/UI/Common/GetHelpView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 1/17/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/HeaderView.swift b/Sources/UI/Common/HeaderView.swift index 1e82bef5..6df38357 100644 --- a/Sources/UI/Common/HeaderView.swift +++ b/Sources/UI/Common/HeaderView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/2/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/IdentityPreviewView.swift b/Sources/UI/Common/IdentityPreviewView.swift index 55e99d06..8005d60b 100644 --- a/Sources/UI/Common/IdentityPreviewView.swift +++ b/Sources/UI/Common/IdentityPreviewView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 10/10/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import PhoneNumberKit diff --git a/Sources/UI/Common/MoreActionsView.swift b/Sources/UI/Common/MoreActionsView.swift index 86fd924e..43886fcf 100644 --- a/Sources/UI/Common/MoreActionsView.swift +++ b/Sources/UI/Common/MoreActionsView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 1/11/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/OTPFieldView.swift b/Sources/UI/Common/OTPFieldView.swift index 38f7d0a3..d91a624c 100644 --- a/Sources/UI/Common/OTPFieldView.swift +++ b/Sources/UI/Common/OTPFieldView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 10/10/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/OrgLogoView.swift b/Sources/UI/Common/OrgLogoView.swift index e2c9e497..bfebf4a6 100644 --- a/Sources/UI/Common/OrgLogoView.swift +++ b/Sources/UI/Common/OrgLogoView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 12/18/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import NukeUI diff --git a/Sources/UI/Common/PasswordInputView.swift b/Sources/UI/Common/PasswordInputView.swift index 63ad3443..b4029d89 100644 --- a/Sources/UI/Common/PasswordInputView.swift +++ b/Sources/UI/Common/PasswordInputView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/1/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/PhoneNumberField.swift b/Sources/UI/Common/PhoneNumberField.swift index 592221ee..1f5e157a 100644 --- a/Sources/UI/Common/PhoneNumberField.swift +++ b/Sources/UI/Common/PhoneNumberField.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 10/20/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import Factory diff --git a/Sources/UI/Common/RemoveResourceView.swift b/Sources/UI/Common/RemoveResourceView.swift index 997c5874..81fd4afe 100644 --- a/Sources/UI/Common/RemoveResourceView.swift +++ b/Sources/UI/Common/RemoveResourceView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/8/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/SecuredByClerkView.swift b/Sources/UI/Common/SecuredByClerkView.swift index 5f0b8df9..6bed542b 100644 --- a/Sources/UI/Common/SecuredByClerkView.swift +++ b/Sources/UI/Common/SecuredByClerkView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/29/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/TextDivider.swift b/Sources/UI/Common/TextDivider.swift index 0159a2a8..48a94235 100644 --- a/Sources/UI/Common/TextDivider.swift +++ b/Sources/UI/Common/TextDivider.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/2/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Common/UserPreviewView.swift b/Sources/UI/Common/UserPreviewView.swift index 56f15a63..df9f2230 100644 --- a/Sources/UI/Common/UserPreviewView.swift +++ b/Sources/UI/Common/UserPreviewView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/29/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import NukeUI diff --git a/Sources/UI/Common/VerificationCodeView.swift b/Sources/UI/Common/VerificationCodeView.swift index e9a96235..73534519 100644 --- a/Sources/UI/Common/VerificationCodeView.swift +++ b/Sources/UI/Common/VerificationCodeView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/1/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/AuthView.swift b/Sources/UI/Components/Auth/AuthView.swift index 108e23f1..4647397f 100644 --- a/Sources/UI/Components/Auth/AuthView.swift +++ b/Sources/UI/Components/Auth/AuthView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 10/10/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInFactorOneAlternativeMethodsView.swift b/Sources/UI/Components/Auth/SignIn/SignInFactorOneAlternativeMethodsView.swift index e7001ec3..61b82221 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInFactorOneAlternativeMethodsView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInFactorOneAlternativeMethodsView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 12/21/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import NukeUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInFactorOneEmailCodeView.swift b/Sources/UI/Components/Auth/SignIn/SignInFactorOneEmailCodeView.swift index 5624c34d..393305e2 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInFactorOneEmailCodeView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInFactorOneEmailCodeView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/2/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInFactorOnePasswordView.swift b/Sources/UI/Components/Auth/SignIn/SignInFactorOnePasswordView.swift index d708684f..616d1f1b 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInFactorOnePasswordView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInFactorOnePasswordView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/2/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import KeychainAccess @@ -107,9 +107,11 @@ struct SignInFactorOnePasswordView: View { let signInIdentifier = signIn?.identifier try await signIn?.attemptFirstFactor(for: .password(password: password)) + if let signInIdentifier, enableBiometry { try Clerk.LocalAuth.setLocalAuthCredentials(identifier: signInIdentifier, password: password) } + if signIn?.status == .needsSecondFactor { clerkUIState.presentedAuthStep = .signInFactorTwo(signIn?.currentSecondFactor) } else { diff --git a/Sources/UI/Components/Auth/SignIn/SignInFactorOnePhoneCodeView.swift b/Sources/UI/Components/Auth/SignIn/SignInFactorOnePhoneCodeView.swift index 6d1bb2c6..2edf1db3 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInFactorOnePhoneCodeView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInFactorOnePhoneCodeView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/2/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInFactorOneResetView.swift b/Sources/UI/Components/Auth/SignIn/SignInFactorOneResetView.swift index a4bc9f17..9f7801ed 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInFactorOneResetView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInFactorOneResetView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 12/18/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInFactorOneUseAnotherMethodView.swift b/Sources/UI/Components/Auth/SignIn/SignInFactorOneUseAnotherMethodView.swift index b6936d6c..cecebe2c 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInFactorOneUseAnotherMethodView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInFactorOneUseAnotherMethodView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 12/21/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInFactorOneView.swift b/Sources/UI/Components/Auth/SignIn/SignInFactorOneView.swift index f5f07acc..628087d9 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInFactorOneView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInFactorOneView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 10/10/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInFactorTwoAlternativeMethodsView.swift b/Sources/UI/Components/Auth/SignIn/SignInFactorTwoAlternativeMethodsView.swift index 42f10e36..2ae06d80 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInFactorTwoAlternativeMethodsView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInFactorTwoAlternativeMethodsView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 1/8/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import NukeUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInFactorTwoBackupCodeView.swift b/Sources/UI/Components/Auth/SignIn/SignInFactorTwoBackupCodeView.swift index a2a34d35..b49232a5 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInFactorTwoBackupCodeView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInFactorTwoBackupCodeView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 1/8/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInFactorTwoPhoneCodeView.swift b/Sources/UI/Components/Auth/SignIn/SignInFactorTwoPhoneCodeView.swift index 248ab9a3..a730ba2f 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInFactorTwoPhoneCodeView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInFactorTwoPhoneCodeView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 1/8/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInFactorTwoTotpCodeView.swift b/Sources/UI/Components/Auth/SignIn/SignInFactorTwoTotpCodeView.swift index 34d325b5..17113827 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInFactorTwoTotpCodeView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInFactorTwoTotpCodeView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 1/9/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInFactorTwoUseAnotherMethodView.swift b/Sources/UI/Components/Auth/SignIn/SignInFactorTwoUseAnotherMethodView.swift index df420c71..49965d83 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInFactorTwoUseAnotherMethodView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInFactorTwoUseAnotherMethodView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 1/8/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInFactorTwoView.swift b/Sources/UI/Components/Auth/SignIn/SignInFactorTwoView.swift index cf11781e..ec0b6df0 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInFactorTwoView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInFactorTwoView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/2/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInForgotPasswordView.swift b/Sources/UI/Components/Auth/SignIn/SignInForgotPasswordView.swift index 12e29d83..fbd6badb 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInForgotPasswordView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInForgotPasswordView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 12/15/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import NukeUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInFormView.swift b/Sources/UI/Components/Auth/SignIn/SignInFormView.swift index 7dac5796..727cc553 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInFormView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInFormView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/3/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInResetPasswordView.swift b/Sources/UI/Components/Auth/SignIn/SignInResetPasswordView.swift index 3cded9c9..2e8883d6 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInResetPasswordView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInResetPasswordView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 12/18/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignIn/SignInStartView.swift b/Sources/UI/Components/Auth/SignIn/SignInStartView.swift index 5739f959..a7b4d5c2 100644 --- a/Sources/UI/Components/Auth/SignIn/SignInStartView.swift +++ b/Sources/UI/Components/Auth/SignIn/SignInStartView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 9/22/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignUp/SignUpEmailCodeView.swift b/Sources/UI/Components/Auth/SignUp/SignUpEmailCodeView.swift index 9de1b57e..19ef7cd5 100644 --- a/Sources/UI/Components/Auth/SignUp/SignUpEmailCodeView.swift +++ b/Sources/UI/Components/Auth/SignUp/SignUpEmailCodeView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/1/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignUp/SignUpFormView.swift b/Sources/UI/Components/Auth/SignUp/SignUpFormView.swift index 4724b4c3..679def20 100644 --- a/Sources/UI/Components/Auth/SignUp/SignUpFormView.swift +++ b/Sources/UI/Components/Auth/SignUp/SignUpFormView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/1/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignUp/SignUpPhoneCodeView.swift b/Sources/UI/Components/Auth/SignUp/SignUpPhoneCodeView.swift index 30aceacf..f3b2e87a 100644 --- a/Sources/UI/Components/Auth/SignUp/SignUpPhoneCodeView.swift +++ b/Sources/UI/Components/Auth/SignUp/SignUpPhoneCodeView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/1/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignUp/SignUpStartView.swift b/Sources/UI/Components/Auth/SignUp/SignUpStartView.swift index c58c09fd..6a8f644e 100644 --- a/Sources/UI/Components/Auth/SignUp/SignUpStartView.swift +++ b/Sources/UI/Components/Auth/SignUp/SignUpStartView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 10/16/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/Auth/SignUp/SignUpVerificationView.swift b/Sources/UI/Components/Auth/SignUp/SignUpVerificationView.swift index d07f4118..15ee489c 100644 --- a/Sources/UI/Components/Auth/SignUp/SignUpVerificationView.swift +++ b/Sources/UI/Components/Auth/SignUp/SignUpVerificationView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 10/16/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import Factory diff --git a/Sources/UI/Components/User/UserButton/UserButton.swift b/Sources/UI/Components/User/UserButton/UserButton.swift index f4a4ce8c..f151e640 100644 --- a/Sources/UI/Components/User/UserButton/UserButton.swift +++ b/Sources/UI/Components/User/UserButton/UserButton.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 10/16/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import Nuke diff --git a/Sources/UI/Components/User/UserButton/UserButtonPopover.swift b/Sources/UI/Components/User/UserButton/UserButtonPopover.swift index bb66da32..7e7d2d0c 100644 --- a/Sources/UI/Components/User/UserButton/UserButtonPopover.swift +++ b/Sources/UI/Components/User/UserButton/UserButtonPopover.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/29/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI @@ -173,7 +173,7 @@ struct UserButtonPopover: View { .animation(.snappy, value: clerk.session) .frame(minWidth: 376, maxWidth: .infinity, alignment: .leading) .onChange(of: clerk.session) { session in - UIImpactFeedbackGenerator(style: .medium).impactOccurred() + FeedbackGenerator.success() if session == nil { dismiss() } } } diff --git a/Sources/UI/Components/User/UserProfile/UserProfileActiveDevicesSection.swift b/Sources/UI/Components/User/UserProfile/UserProfileActiveDevicesSection.swift index 52fdae24..d46a3d69 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileActiveDevicesSection.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileActiveDevicesSection.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/16/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import NukeUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileAddEmailView.swift b/Sources/UI/Components/User/UserProfile/UserProfileAddEmailView.swift index 1c1a69d8..813ff74b 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileAddEmailView.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileAddEmailView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/6/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileAddExternalAccountView.swift b/Sources/UI/Components/User/UserProfile/UserProfileAddExternalAccountView.swift index e5261417..bb24afc4 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileAddExternalAccountView.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileAddExternalAccountView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/9/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileAddPhoneNumberView.swift b/Sources/UI/Components/User/UserProfile/UserProfileAddPhoneNumberView.swift index cbea58a6..aef229b7 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileAddPhoneNumberView.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileAddPhoneNumberView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/8/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileChangePasswordView.swift b/Sources/UI/Components/User/UserProfile/UserProfileChangePasswordView.swift index cfbf2b6a..0a0616c5 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileChangePasswordView.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileChangePasswordView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/27/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileDeleteAccountSection.swift b/Sources/UI/Components/User/UserProfile/UserProfileDeleteAccountSection.swift index 69c74159..2f7d5a48 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileDeleteAccountSection.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileDeleteAccountSection.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 3/13/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileDetailsView.swift b/Sources/UI/Components/User/UserProfile/UserProfileDetailsView.swift index 80a95d7a..f123bb87 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileDetailsView.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileDetailsView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/3/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileEmailSection.swift b/Sources/UI/Components/User/UserProfile/UserProfileEmailSection.swift index 6d802e14..3fd90f7c 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileEmailSection.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileEmailSection.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/3/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileExternalAccountSection.swift b/Sources/UI/Components/User/UserProfile/UserProfileExternalAccountSection.swift index 9b6fa058..876d9cd6 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileExternalAccountSection.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileExternalAccountSection.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/3/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import NukeUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileMfaAddSmsView.swift b/Sources/UI/Components/User/UserProfile/UserProfileMfaAddSmsView.swift index 57fa3ad7..bc3a71c7 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileMfaAddSmsView.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileMfaAddSmsView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 1/25/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileMfaAddTotpView.swift b/Sources/UI/Components/User/UserProfile/UserProfileMfaAddTotpView.swift index 45e2ca6f..31e4f077 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileMfaAddTotpView.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileMfaAddTotpView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 2/13/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileMfaBackupCodeListView.swift b/Sources/UI/Components/User/UserProfile/UserProfileMfaBackupCodeListView.swift index af552716..c05579ce 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileMfaBackupCodeListView.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileMfaBackupCodeListView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 1/29/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileMfaSection.swift b/Sources/UI/Components/User/UserProfile/UserProfileMfaSection.swift index 56919bc7..87875939 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileMfaSection.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileMfaSection.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 1/24/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfilePasswordSection.swift b/Sources/UI/Components/User/UserProfile/UserProfilePasswordSection.swift index 94849a32..8507e738 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfilePasswordSection.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfilePasswordSection.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/27/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfilePhoneNumberSection.swift b/Sources/UI/Components/User/UserProfile/UserProfilePhoneNumberSection.swift index b49c0b71..f5aa966b 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfilePhoneNumberSection.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfilePhoneNumberSection.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/3/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileSection.swift b/Sources/UI/Components/User/UserProfile/UserProfileSection.swift index 7f65faf4..229aa3ab 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileSection.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileSection.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/3/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import NukeUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileSectionHeader.swift b/Sources/UI/Components/User/UserProfile/UserProfileSectionHeader.swift index 0ba58429..4f10c668 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileSectionHeader.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileSectionHeader.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/3/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileSecurityView.swift b/Sources/UI/Components/User/UserProfile/UserProfileSecurityView.swift index 764eb9a2..82d23d8a 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileSecurityView.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileSecurityView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/16/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileUpdateProfileView.swift b/Sources/UI/Components/User/UserProfile/UserProfileUpdateProfileView.swift index 92ecda13..778b0979 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileUpdateProfileView.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileUpdateProfileView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/28/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import NukeUI diff --git a/Sources/UI/Components/User/UserProfile/UserProfileView.swift b/Sources/UI/Components/User/UserProfile/UserProfileView.swift index b59ba34d..18bc08c6 100644 --- a/Sources/UI/Components/User/UserProfile/UserProfileView.swift +++ b/Sources/UI/Components/User/UserProfile/UserProfileView.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/16/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Helpers/FeedbackGenerator.swift b/Sources/UI/Helpers/FeedbackGenerator.swift index 189c2e17..8c0bb49f 100644 --- a/Sources/UI/Helpers/FeedbackGenerator.swift +++ b/Sources/UI/Helpers/FeedbackGenerator.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/2/23. // -#if canImport(UIKit) +#if os(iOS) import Foundation import UIKit diff --git a/Sources/UI/Helpers/KeyboardHelpers.swift b/Sources/UI/Helpers/KeyboardHelpers.swift index 9503c5e3..e2972c4f 100644 --- a/Sources/UI/Helpers/KeyboardHelpers.swift +++ b/Sources/UI/Helpers/KeyboardHelpers.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 10/12/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import Combine diff --git a/Sources/UI/Helpers/ReadSize.swift b/Sources/UI/Helpers/ReadSize.swift index 34d73d5d..c7da4158 100644 --- a/Sources/UI/Helpers/ReadSize.swift +++ b/Sources/UI/Helpers/ReadSize.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 10/12/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Styles/ClerkDangerButtonStyle.swift b/Sources/UI/Styles/ClerkDangerButtonStyle.swift index b0d2c0ef..561acbbc 100644 --- a/Sources/UI/Styles/ClerkDangerButtonStyle.swift +++ b/Sources/UI/Styles/ClerkDangerButtonStyle.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 12/15/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Styles/ClerkPrimaryButtonStyle.swift b/Sources/UI/Styles/ClerkPrimaryButtonStyle.swift index 8744dba4..a5b0e68f 100644 --- a/Sources/UI/Styles/ClerkPrimaryButtonStyle.swift +++ b/Sources/UI/Styles/ClerkPrimaryButtonStyle.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 12/15/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/Styles/ClerkSecondaryButtonStyle.swift b/Sources/UI/Styles/ClerkSecondaryButtonStyle.swift index d22fbf1b..88dfc364 100644 --- a/Sources/UI/Styles/ClerkSecondaryButtonStyle.swift +++ b/Sources/UI/Styles/ClerkSecondaryButtonStyle.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 12/15/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI @@ -16,7 +16,7 @@ struct ClerkSecondaryButtonStyle: ButtonStyle { configuration.label .font(.footnote.weight(.medium)) .foregroundStyle(clerkTheme.colors.textPrimary) - .background(Color(.systemBackground)) + .background() .overlay { RoundedRectangle(cornerRadius: 6, style: .continuous) .strokeBorder(clerkTheme.colors.borderPrimary, lineWidth: 1) diff --git a/Sources/UI/ViewModifiers/AuthViewModifier.swift b/Sources/UI/ViewModifiers/AuthViewModifier.swift index 08d45e5d..a66c83b2 100644 --- a/Sources/UI/ViewModifiers/AuthViewModifier.swift +++ b/Sources/UI/ViewModifiers/AuthViewModifier.swift @@ -5,13 +5,14 @@ // Created by Mike Pitre on 10/12/23. // -#if canImport(UIKit) +#if os(iOS) import Foundation import SwiftUI struct AuthViewModifier: ViewModifier { @Environment(\.clerkTheme) private var clerkTheme + @EnvironmentObject private var clerkUIState: ClerkUIState @Binding var isPresented: Bool @@ -19,6 +20,7 @@ struct AuthViewModifier: ViewModifier { content .sheet(isPresented: $isPresented, content: { AuthView() + .environmentObject(clerkUIState) }) } } diff --git a/Sources/UI/ViewModifiers/ClerkBottomBrandingModifier.swift b/Sources/UI/ViewModifiers/ClerkBottomBrandingModifier.swift index 6860b01f..41eb13cf 100644 --- a/Sources/UI/ViewModifiers/ClerkBottomBrandingModifier.swift +++ b/Sources/UI/ViewModifiers/ClerkBottomBrandingModifier.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 12/20/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/ViewModifiers/ClerkProviderModifier.swift b/Sources/UI/ViewModifiers/ClerkProviderModifier.swift index 92277543..6a29843c 100644 --- a/Sources/UI/ViewModifiers/ClerkProviderModifier.swift +++ b/Sources/UI/ViewModifiers/ClerkProviderModifier.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 10/3/23. // -#if canImport(UIKit) +#if os(iOS) import Foundation import SwiftUI diff --git a/Sources/UI/ViewModifiers/ClerkStandardButtonPaddingModifier.swift b/Sources/UI/ViewModifiers/ClerkStandardButtonPaddingModifier.swift index 4a642b17..bafefbad 100644 --- a/Sources/UI/ViewModifiers/ClerkStandardButtonPaddingModifier.swift +++ b/Sources/UI/ViewModifiers/ClerkStandardButtonPaddingModifier.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 1/17/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/ViewModifiers/DismissButtonOverlay.swift b/Sources/UI/ViewModifiers/DismissButtonOverlay.swift index c9b6bc1e..6cee99ea 100644 --- a/Sources/UI/ViewModifiers/DismissButtonOverlay.swift +++ b/Sources/UI/ViewModifiers/DismissButtonOverlay.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 11/22/23. // -#if canImport(UIKit) +#if os(iOS) import Foundation import SwiftUI @@ -37,7 +37,8 @@ extension View { } #Preview { - Color(.systemBackground) + Text("Hello, World!") + .frame(maxWidth: .infinity, maxHeight: .infinity) .dismissButtonOverlay() } diff --git a/Sources/UI/ViewModifiers/KeyboardIgnoringBottomViewModifier.swift b/Sources/UI/ViewModifiers/KeyboardIgnoringBottomViewModifier.swift index 23052461..8e5ce775 100644 --- a/Sources/UI/ViewModifiers/KeyboardIgnoringBottomViewModifier.swift +++ b/Sources/UI/ViewModifiers/KeyboardIgnoringBottomViewModifier.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 12/20/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI diff --git a/Sources/UI/ViewModifiers/LocalAuthOnForegroundModifier.swift b/Sources/UI/ViewModifiers/LocalAuthOnForegroundModifier.swift index 916c79f4..082028fb 100644 --- a/Sources/UI/ViewModifiers/LocalAuthOnForegroundModifier.swift +++ b/Sources/UI/ViewModifiers/LocalAuthOnForegroundModifier.swift @@ -5,7 +5,7 @@ // Created by Mike Pitre on 3/28/24. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI import UIKit diff --git a/Sources/UI/ViewModifiers/UserProfileViewModifier.swift b/Sources/UI/ViewModifiers/UserProfileViewModifier.swift index 291c7b6a..9078ba03 100644 --- a/Sources/UI/ViewModifiers/UserProfileViewModifier.swift +++ b/Sources/UI/ViewModifiers/UserProfileViewModifier.swift @@ -5,12 +5,13 @@ // Created by Mike Pitre on 11/29/23. // -#if canImport(UIKit) +#if os(iOS) import SwiftUI struct UserProfileViewModifier: ViewModifier { @Binding var isPresented: Bool + @EnvironmentObject private var clerkUIState: ClerkUIState func body(content: Content) -> some View { content @@ -23,6 +24,7 @@ struct UserProfileViewModifier: ViewModifier { DismissButton() } }) + .environmentObject(clerkUIState) } } }