Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Update swift theme color usage (#1340)
Leendert de Borstc8277be56f40
diff --git a/apps/mobile-app/ios/VaultUI/Components/LoadingOverlayView.swift b/apps/mobile-app/ios/VaultUI/Components/LoadingOverlayView.swiftindex 23d752162..170589a7e 100644--- a/apps/mobile-app/ios/VaultUI/Components/LoadingOverlayView.swift+++ b/apps/mobile-app/ios/VaultUI/Components/LoadingOverlayView.swift@@ -13,6 +13,10 @@ public struct LoadingOverlayView: View {self.message = message}+ private var colors: ColorConstants.Colors.Type {+ ColorConstants.colors(for: colorScheme)+ }+public var body: some View {GeometryReader { geometry inVStack(spacing: 0) {@@ -25,7 +29,7 @@ public struct LoadingOverlayView: View {HStack(spacing: 10) {ForEach(0..<4) { index inCircle()- .fill(ColorConstants.Light.tertiary)+ .fill(colors.tertiary).frame(width: 8, height: 8).opacity(animatingDots[index] ? 1.0 : 0.3).animation(@@ -43,7 +47,7 @@ public struct LoadingOverlayView: View {.fill(colorScheme == .dark ? Color.clear : Color.white).overlay(RoundedRectangle(cornerRadius: 20)- .stroke(ColorConstants.Light.tertiary, lineWidth: 5)+ .stroke(colors.tertiary, lineWidth: 5)).shadow(color: Color.black.opacity(0.05), radius: 2, x: 0, y: 1))@@ -52,7 +56,7 @@ public struct LoadingOverlayView: View {if !message.isEmpty {Text(message + textDots).font(.body)- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)+ .foregroundColor(colors.text).multilineTextAlignment(.center).padding(.horizontal).padding(.top, 16)diff --git a/apps/mobile-app/ios/VaultUI/Components/ServiceLogoView.swift b/apps/mobile-app/ios/VaultUI/Components/ServiceLogoView.swiftindex 001113265..e8a465af0 100644--- a/apps/mobile-app/ios/VaultUI/Components/ServiceLogoView.swift+++ b/apps/mobile-app/ios/VaultUI/Components/ServiceLogoView.swift@@ -9,6 +9,10 @@ public struct ServiceLogoView: View {let logoData: Data?@Environment(\.colorScheme) private var colorScheme+ private var colors: ColorConstants.Colors.Type {+ ColorConstants.colors(for: colorScheme)+ }+private var placeholderImage: UIImage? {if let data = Data(base64Encoded: placeholderImageBase64) {return UIImage(data: data)@@ -91,11 +95,11 @@ public struct ServiceLogoView: View {} else {// Ultimate fallback if placeholder fails to loadCircle()- .fill(colorScheme == .dark ? ColorConstants.Dark.accentBackground : ColorConstants.Light.background)+ .fill(colors.accentBackground).frame(width: 32, height: 32).overlay(Circle()- .stroke(colorScheme == .dark ? ColorConstants.Dark.accentBorder : ColorConstants.Light.accentBorder, lineWidth: 1)+ .stroke(colors.accentBorder, lineWidth: 1)).clipShape(RoundedRectangle(cornerRadius: 4))}diff --git a/apps/mobile-app/ios/VaultUI/QuickUnlock/QuickUnlockLoadingView.swift b/apps/mobile-app/ios/VaultUI/QuickUnlock/QuickUnlockLoadingView.swiftindex 031dcbf77..78fccafac 100644--- a/apps/mobile-app/ios/VaultUI/QuickUnlock/QuickUnlockLoadingView.swift+++ b/apps/mobile-app/ios/VaultUI/QuickUnlock/QuickUnlockLoadingView.swift@@ -11,6 +11,10 @@ public struct QuickUnlockLoadingView: View {self.type = type}+ private var colors: ColorConstants.Colors.Type {+ ColorConstants.colors(for: colorScheme)+ }+private var localizedMessage: String {switch type {case .credential:@@ -23,7 +27,7 @@ public struct QuickUnlockLoadingView: View {public var body: some View {ZStack {// Background- Color(colorScheme == .dark ? ColorConstants.Dark.background : ColorConstants.Light.background)+ colors.background.ignoresSafeArea()// Loading overlaydiff --git a/apps/mobile-app/ios/VaultUI/Selection/Components/CredentialCardView.swift b/apps/mobile-app/ios/VaultUI/Selection/Components/CredentialCardView.swiftindex 1538b2c48..80b966302 100644--- a/apps/mobile-app/ios/VaultUI/Selection/Components/CredentialCardView.swift+++ b/apps/mobile-app/ios/VaultUI/Selection/Components/CredentialCardView.swift@@ -17,6 +17,10 @@ public struct CredentialCard: View {self.onCopy = onCopy}+ private var colors: ColorConstants.Colors.Type {+ ColorConstants.colors(for: colorScheme)+ }+public var body: some View {Button(action: action) {HStack(spacing: 16) {@@ -27,25 +31,25 @@ public struct CredentialCard: View {VStack(alignment: .leading, spacing: 4) {Text(truncateText(credential.service.name ?? "Unknown", limit: 26)).font(.headline)- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)+ .foregroundColor(colors.text)Text(truncateText(CredentialHelpers.usernameOrEmail(credential: credential), limit: 26)).font(.subheadline)- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.textMuted : ColorConstants.Light.textMuted)+ .foregroundColor(colors.textMuted)}Spacer()Image(systemName: "chevron.right")- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.icon : ColorConstants.Light.icon)+ .foregroundColor(colors.icon)}.padding(8).padding(.horizontal, 8).padding(.vertical, 2)- .background(colorScheme == .dark ? ColorConstants.Dark.accentBackground : ColorConstants.Light.accentBackground)+ .background(colors.accentBackground).overlay(RoundedRectangle(cornerRadius: 8)- .stroke(colorScheme == .dark ? ColorConstants.Dark.accentBorder : ColorConstants.Light.accentBorder, lineWidth: 1)+ .stroke(colors.accentBorder, lineWidth: 1)).cornerRadius(8)}diff --git a/apps/mobile-app/ios/VaultUI/Selection/Components/SearchBar.swift b/apps/mobile-app/ios/VaultUI/Selection/Components/SearchBar.swiftindex 82f4ce85d..83c963da3 100644--- a/apps/mobile-app/ios/VaultUI/Selection/Components/SearchBar.swift+++ b/apps/mobile-app/ios/VaultUI/Selection/Components/SearchBar.swift@@ -8,23 +8,27 @@ public struct SearchBarView: View {@Binding var text: String@Environment(\.colorScheme) private var colorScheme+ private var colors: ColorConstants.Colors.Type {+ ColorConstants.colors(for: colorScheme)+ }+public var body: some View {ZStack {HStack {Image(systemName: "magnifyingglass")- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)+ .foregroundColor(colors.text).padding(.leading, 8)TextField(String(localized: "search_credentials", bundle: locBundle), text: $text).autocapitalization(.none).disableAutocorrection(true)- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)+ .foregroundColor(colors.text).padding(.leading, 4).padding(.trailing, 28) // Space for clear button}.padding(8).padding(.vertical, 2)- .background(colorScheme == .dark ? ColorConstants.Dark.accentBackground : ColorConstants.Light.accentBackground)+ .background(colors.accentBackground).cornerRadius(8)if !text.isEmpty {@@ -34,7 +38,7 @@ public struct SearchBarView: View {text = ""}, label: {Image(systemName: "xmark.circle.fill")- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)+ .foregroundColor(colors.text)}).padding(.trailing, 8)}diff --git a/apps/mobile-app/ios/VaultUI/Selection/CredentialProviderView.swift b/apps/mobile-app/ios/VaultUI/Selection/CredentialProviderView.swiftindex b2e72a19d..196b1828e 100644--- a/apps/mobile-app/ios/VaultUI/Selection/CredentialProviderView.swift+++ b/apps/mobile-app/ios/VaultUI/Selection/CredentialProviderView.swift@@ -15,17 +15,21 @@ public struct CredentialProviderView: View {self._viewModel = ObservedObject(wrappedValue: viewModel)}+ private var colors: ColorConstants.Colors.Type {+ ColorConstants.colors(for: colorScheme)+ }+public var body: some View {NavigationView {ZStack {- (colorScheme == .dark ? ColorConstants.Dark.background : ColorConstants.Light.background)+ colors.background.ignoresSafeArea()VStack(spacing: 0) {SearchBarView(text: $viewModel.searchText).padding(.horizontal).padding(.vertical, 8)- .background(colorScheme == .dark ? ColorConstants.Dark.background : ColorConstants.Light.background)+ .background(colors.background).onChange(of: viewModel.searchText) { _ inviewModel.filterCredentials()}@@ -42,15 +46,15 @@ public struct CredentialProviderView: View {VStack(spacing: 20) {Image(systemName: "magnifyingglass").font(.system(size: 50))- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)+ .foregroundColor(colors.text)Text(String(localized: "no_credentials_found", bundle: locBundle)).font(.headline)- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)+ .foregroundColor(colors.text)Text(String(localized: "no_credentials_match", bundle: locBundle)).font(.subheadline)- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)+ .foregroundColor(colors.text).multilineTextAlignment(.center)if !viewModel.isChoosingTextToInsert {@@ -71,7 +75,7 @@ public struct CredentialProviderView: View {}.padding().frame(maxWidth: .infinity)- .background(ColorConstants.Light.primary)+ .background(colors.primary).foregroundColor(.white).cornerRadius(8)})@@ -112,7 +116,7 @@ public struct CredentialProviderView: View {Button(String(localized: "cancel", bundle: locBundle)) {viewModel.cancel()}- .foregroundColor(ColorConstants.Light.primary)+ .foregroundColor(colors.primary)}ToolbarItem(placement: .navigationBarTrailing) {HStack {@@ -127,7 +131,7 @@ public struct CredentialProviderView: View {}}, label: {Image(systemName: "plus")- .foregroundColor(ColorConstants.Light.primary)+ .foregroundColor(colors.primary)})}}diff --git a/apps/mobile-app/ios/VaultUI/Selection/PasskeyProviderView.swift b/apps/mobile-app/ios/VaultUI/Selection/PasskeyProviderView.swiftindex 2d10565ab..70dfcf43e 100644--- a/apps/mobile-app/ios/VaultUI/Selection/PasskeyProviderView.swift+++ b/apps/mobile-app/ios/VaultUI/Selection/PasskeyProviderView.swift@@ -15,17 +15,21 @@ public struct PasskeyProviderView: View {self._viewModel = ObservedObject(wrappedValue: viewModel)}+ private var colors: ColorConstants.Colors.Type {+ ColorConstants.colors(for: colorScheme)+ }+public var body: some View {NavigationView {ZStack {- (colorScheme == .dark ? ColorConstants.Dark.background : ColorConstants.Light.background)+ colors.background.ignoresSafeArea()VStack(spacing: 0) {SearchBarView(text: $viewModel.searchText).padding(.horizontal).padding(.vertical, 8)- .background(colorScheme == .dark ? ColorConstants.Dark.background : ColorConstants.Light.background)+ .background(colors.background).onChange(of: viewModel.searchText) { _ inviewModel.filterCredentials()}@@ -42,15 +46,15 @@ public struct PasskeyProviderView: View {VStack(spacing: 20) {Image(systemName: "key.fill").font(.system(size: 50))- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)+ .foregroundColor(colors.text)Text(String(localized: "no_passkeys_found", bundle: locBundle)).font(.headline)- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)+ .foregroundColor(colors.text)Text(String(localized: "no_passkeys_match", bundle: locBundle)).font(.subheadline)- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)+ .foregroundColor(colors.text).multilineTextAlignment(.center)}.padding(.top, 60)@@ -83,7 +87,7 @@ public struct PasskeyProviderView: View {Button(String(localized: "cancel", bundle: locBundle)) {viewModel.cancel()}- .foregroundColor(ColorConstants.Light.primary)+ .foregroundColor(colors.primary)}}.alert(String(localized: "error", bundle: locBundle), isPresented: $viewModel.showError) {@@ -113,6 +117,10 @@ private struct PasskeyCredentialCard: View {@Environment(\.colorScheme) private var colorScheme+ private var colors: ColorConstants.Colors.Type {+ ColorConstants.colors(for: colorScheme)+ }+var body: some View {Button(action: action) {VStack(alignment: .leading, spacing: 12) {@@ -129,11 +137,11 @@ private struct PasskeyCredentialCard: View {// Fallback to passkey icon when favicon is not availableZStack {RoundedRectangle(cornerRadius: 8)- .fill(ColorConstants.Light.primary.opacity(0.1))+ .fill(colors.primary.opacity(0.1)).frame(width: 40, height: 40)Image(systemName: "key.fill").font(.system(size: 20))- .foregroundColor(ColorConstants.Light.primary)+ .foregroundColor(colors.primary)}.frame(width: 40, height: 40).padding()@@ -142,34 +150,34 @@ private struct PasskeyCredentialCard: View {VStack(alignment: .leading, spacing: 4) {Text(credential.service.name ?? credential.service.url ?? "-").font(.headline)- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.text : ColorConstants.Light.text)+ .foregroundColor(colors.text)if let username = credential.username, !username.isEmpty {Text(username).font(.subheadline)- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.textMuted : ColorConstants.Light.textMuted)+ .foregroundColor(colors.textMuted)} else if let email = credential.alias?.email {Text(email).font(.subheadline)- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.textMuted : ColorConstants.Light.textMuted)+ .foregroundColor(colors.textMuted)}// Show passkey countif let passkeys = credential.passkeys, !passkeys.isEmpty {Text(String(localized: "passkey", bundle: locBundle)).font(.caption)- .foregroundColor(ColorConstants.Light.primary)+ .foregroundColor(colors.primary)}}Spacer()Image(systemName: "chevron.right")- .foregroundColor(colorScheme == .dark ? ColorConstants.Dark.textMuted : ColorConstants.Light.textMuted)+ .foregroundColor(colors.textMuted)}}.padding()- .background(colorScheme == .dark ? ColorConstants.Dark.accentBackground : ColorConstants.Light.accentBackground)+ .background(colors.accentBackground).cornerRadius(12)}.buttonStyle(PlainButtonStyle())