Skip to content

Commit

Permalink
Merge branch 'master' into porter/MOBILESDK-3001
Browse files Browse the repository at this point in the history
  • Loading branch information
porter-stripe authored Feb 3, 2025
2 parents 4c21ed7 + af6a3c2 commit 71d1fb0
Show file tree
Hide file tree
Showing 41 changed files with 416 additions and 232 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,14 @@
492651682C25C0C2001DDBCA /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 492651672C25C0C2001DDBCA /* [email protected] */; };
49424EB02D48050A0088F3D9 /* WebPrefillDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49424EAF2D48050A0088F3D9 /* WebPrefillDetails.swift */; };
494D62072C45B9B700106519 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 494D62062C45B9B700106519 /* [email protected] */; };
4964F13A2D4C114800EE6BC9 /* PresentationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4964F1392D4C114800EE6BC9 /* PresentationManager.swift */; };
4964F13C2D4C14D100EE6BC9 /* PresentationManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4964F13B2D4C14D100EE6BC9 /* PresentationManagerTests.swift */; };
496A6AE72C29E0BB00D34F8E /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 496A6AE62C29E0BB00D34F8E /* [email protected] */; };
497142BC2C514B08000DFA64 /* FlowRouterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 497142BB2C514B08000DFA64 /* FlowRouterTests.swift */; };
499EEAFD2D3E948B00E1BE85 /* FinancialConnectionsAPIClientLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 499EEAFC2D3E948B00E1BE85 /* FinancialConnectionsAPIClientLogger.swift */; };
49A0B5862C5D2F3C00D697D9 /* FinancialConnectionsAPIClientTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49A0B5852C5D2F3C00D697D9 /* FinancialConnectionsAPIClientTests.swift */; };
49AC518C2C52DE2C00B712CC /* FinancialConnectionsLinkLoginPane.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49AC518B2C52DE2C00B712CC /* FinancialConnectionsLinkLoginPane.swift */; };
49AED8FF2D4D244B00FD7C23 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 49AED8FE2D4D244B00FD7C23 /* [email protected] */; };
49B5BF762D43E1D500AB6C3F /* FinancialConnectionsAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B5BF752D43E1D500AB6C3F /* FinancialConnectionsAppearance.swift */; };
49C911372C597EAF00589E0D /* LinkLoginDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49C911332C597EAF00589E0D /* LinkLoginDataSource.swift */; };
49C911392C597EAF00589E0D /* LinkLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49C911352C597EAF00589E0D /* LinkLoginViewController.swift */; };
Expand Down Expand Up @@ -220,7 +223,6 @@
EABA08E892B087D89C97AE4F /* FinancialConnectionsEvent+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B23D2BD3CD4071A40D9AE9 /* FinancialConnectionsEvent+Extensions.swift */; };
EC74B719F0FA1A977EF4708C /* FinancialConnectionsAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = 359BF8ACFB35A16EBD96C4F0 /* FinancialConnectionsAccount.swift */; };
ED818E10F37230678B9B73CC /* SoftLinkTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90A06A97D714450321A5D76D /* SoftLinkTests.swift */; };
F0397F4E1D6A91416897F45E /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 7413C9D80DF7190CA6FB82EE /* [email protected] */; };
F03F840B9E896F1B09742191 /* PartnerAuthViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 25BDE722D8A827955C3182E8 /* PartnerAuthViewController.swift */; };
F0495231F4C70E054149C03A /* LinkAccountPickerNewAccountRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFF070262170A321F5622CCF /* LinkAccountPickerNewAccountRowView.swift */; };
F0FB346A0F86C3561CD3C048 /* UITableView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B52F27D0FACAE9D4F4D15A73 /* UITableView+Extensions.swift */; };
Expand Down Expand Up @@ -330,11 +332,14 @@
492651672C25C0C2001DDBCA /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
49424EAF2D48050A0088F3D9 /* WebPrefillDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebPrefillDetails.swift; sourceTree = "<group>"; };
494D62062C45B9B700106519 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
4964F1392D4C114800EE6BC9 /* PresentationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PresentationManager.swift; sourceTree = "<group>"; };
4964F13B2D4C14D100EE6BC9 /* PresentationManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PresentationManagerTests.swift; sourceTree = "<group>"; };
496A6AE62C29E0BB00D34F8E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
497142BB2C514B08000DFA64 /* FlowRouterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlowRouterTests.swift; sourceTree = "<group>"; };
499EEAFC2D3E948B00E1BE85 /* FinancialConnectionsAPIClientLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinancialConnectionsAPIClientLogger.swift; sourceTree = "<group>"; };
49A0B5852C5D2F3C00D697D9 /* FinancialConnectionsAPIClientTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinancialConnectionsAPIClientTests.swift; sourceTree = "<group>"; };
49AC518B2C52DE2C00B712CC /* FinancialConnectionsLinkLoginPane.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinancialConnectionsLinkLoginPane.swift; sourceTree = "<group>"; };
49AED8FE2D4D244B00FD7C23 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
49B5BF752D43E1D500AB6C3F /* FinancialConnectionsAppearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinancialConnectionsAppearance.swift; sourceTree = "<group>"; };
49C911332C597EAF00589E0D /* LinkLoginDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LinkLoginDataSource.swift; sourceTree = "<group>"; };
49C911352C597EAF00589E0D /* LinkLoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LinkLoginViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -428,7 +433,6 @@
72DEDE8871A732D603E96E2B /* AccountPickerSelectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountPickerSelectionView.swift; sourceTree = "<group>"; };
73AB8A480620B5C3567F453C /* FinancialConnectionsAnalyticsTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinancialConnectionsAnalyticsTest.swift; sourceTree = "<group>"; };
73C03F4DDC67B50C5E1993F6 /* ManualEntryFormView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManualEntryFormView.swift; sourceTree = "<group>"; };
7413C9D80DF7190CA6FB82EE /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
742D94AC4B2D17F8282A6788 /* fil */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fil; path = fil.lproj/Localizable.strings; sourceTree = "<group>"; };
75B23D2BD3CD4071A40D9AE9 /* FinancialConnectionsEvent+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FinancialConnectionsEvent+Extensions.swift"; sourceTree = "<group>"; };
77A71EBB1B98CD285DD17D5F /* AccountFetcherTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountFetcherTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -574,7 +578,7 @@
children = (
782A419DCF59BE6AB6439D04 /* [email protected] */,
C4DA5D0EB4ED760B3F9818C5 /* [email protected] */,
7413C9D80DF7190CA6FB82EE /* brandicon_default@3x.png */,
49AED8FE2D4D244B00FD7C23 /* bank@3x.png */,
07BCA9D23511A3494C82B632 /* [email protected] */,
A4CC00446B086B2987114099 /* [email protected] */,
5B77DE6D7A86CC847977396A /* [email protected] */,
Expand Down Expand Up @@ -1044,6 +1048,7 @@
49F047522C63B430006BAD3E /* StripeSchemeAddress.swift */,
49424EAF2D48050A0088F3D9 /* WebPrefillDetails.swift */,
49F883F72D496D7A00A104B0 /* ExperimentStore.swift */,
4964F1392D4C114800EE6BC9 /* PresentationManager.swift */,
);
path = Shared;
sourceTree = "<group>";
Expand Down Expand Up @@ -1098,6 +1103,7 @@
CF731140836AE438C7F4F6AB /* StringExtensionsTests.swift */,
497142BB2C514B08000DFA64 /* FlowRouterTests.swift */,
492039942CA4972B00CE2072 /* FinancialConnectionsWebFlowTests.swift */,
4964F13B2D4C14D100EE6BC9 /* PresentationManagerTests.swift */,
);
path = StripeFinancialConnectionsTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -1276,7 +1282,7 @@
files = (
4DC8EB63806434ABF4C9CC43 /* [email protected] in Resources */,
D10FB0DAC5E452D4569CEA14 /* [email protected] in Resources */,
F0397F4E1D6A91416897F45E /* brandicon_default@3x.png in Resources */,
49AED8FF2D4D244B00FD7C23 /* bank@3x.png in Resources */,
645D6FF67167263F9A1C2BB0 /* [email protected] in Resources */,
F10147CF75C2A09D66CB5C14 /* [email protected] in Resources */,
755140DEEE50DCD6E939E528 /* [email protected] in Resources */,
Expand Down Expand Up @@ -1481,6 +1487,7 @@
6A78141C2B462D5D00168992 /* LegalDetailsNoticeViewController.swift in Sources */,
6A7814112B32462100168992 /* CloseConfirmationViewController.swift in Sources */,
AB7C9A26484953762FFBB4A5 /* FinancialConnectionsWebFlowViewController.swift in Sources */,
4964F13A2D4C114800EE6BC9 /* PresentationManager.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -1500,6 +1507,7 @@
846D1D7429B9E414744DEC99 /* FinancialConnectionsSheetTests.swift in Sources */,
C19996D0AC7E046DA87B6B32 /* ManualEntryValidatorTests.swift in Sources */,
779C729BB49FD4B99DCD517B /* MarkdownBoldAttributedStringTests.swift in Sources */,
4964F13C2D4C14D100EE6BC9 /* PresentationManagerTests.swift in Sources */,
49A0B5862C5D2F3C00D697D9 /* FinancialConnectionsAPIClientTests.swift in Sources */,
BF5F964E1CA6312755D4161E /* SessionFetcherTests.swift in Sources */,
ED818E10F37230678B9B73CC /* SoftLinkTests.swift in Sources */,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ class TestModeAutofillBannerView: UIView {
let label = UILabel()
label.attributedText = attributedString
label.font = FinancialConnectionsFont.body(.small).uiFont
// Staticly use the light-mode font color here to contrast with yellow background.
let lightTrait = UITraitCollection(userInterfaceStyle: .light)
label.textColor = FinancialConnectionsAppearance.Colors.textDefault.resolvedColor(with: lightTrait)
label.textColor = FinancialConnectionsAppearance.Colors.textDefault
label.numberOfLines = 0
label.lineBreakMode = .byWordWrapping
return label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ final public class FinancialConnectionsSheet {
private var wrapperViewController: ModalPresentationWrapperViewController?

/// Contains all configurable properties of Financial Connections.
@_spi(STP) public var configuration: FinancialConnectionsSheet.Configuration = .init()
@_spi(STP) public var configuration: FinancialConnectionsSheet.Configuration = .init() {
didSet {
PresentationManager.shared.configuration = configuration
}
}

/// Any additional Elements context useful for the Financial Connections SDK.
@_spi(STP) public var elementsSessionContext: StripeCore.ElementsSessionContext?
Expand Down Expand Up @@ -303,7 +307,7 @@ final public class FinancialConnectionsSheet {
toPresent = wrapperViewController!
animated = false
}
presentingViewController.present(toPresent, animated: animated, completion: nil)
PresentationManager.shared.present(toPresent, from: presentingViewController, animated: animated)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ struct FinancialConnectionsAppearance: Equatable {
static let icon: UIColor = .dynamic(light: .neutral700, dark: .neutral25)
static let borderNeutral: UIColor = .dynamic(light: .neutral100, dark: .neutral100Dark)
static let spinnerNeutral: UIColor = .neutral200
static let warningLight: UIColor = .attention50
static let warningLight: UIColor = .dynamic(light: .attention50, dark: .attention50Dark)
static let warning: UIColor = .attention300
static let shadow: UIColor = .dynamic(light: .black, dark: .neutral0)

// These colors change based on the manifest's theme.
let primary: UIColor
Expand Down Expand Up @@ -138,6 +139,10 @@ private extension UIColor {
return UIColor(red: 254 / 255.0, green: 249 / 255.0, blue: 218 / 255.0, alpha: 1) // #fef9da
}

static var attention50Dark: UIColor {
return UIColor(red: 64 / 255.0, green: 10 / 255.0, blue: 0 / 255.0, alpha: 1) // #400a00
}

static var attention300: UIColor {
return UIColor(red: 247 / 255.0, green: 135 / 255.0, blue: 15 / 255.0, alpha: 1) // #f7870f
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ enum Image: String, ImageMaker {

case add
case back_arrow
case brandicon_default
case bank
case cancel_circle
case check
case chevron_down
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ private let ellipsisViewWidth: CGFloat = 32.0
final class ConsentLogoView: UIView {

private var multipleDotView: UIView?
private var shadowLayers: [CALayer] = []

init(merchantLogo: [String], showsAnimatedDots: Bool) {
super.init(frame: .zero)
Expand All @@ -25,9 +26,9 @@ final class ConsentLogoView: UIView {
if merchantLogo.count == 2 || merchantLogo.count == 3 {
for i in 0..<merchantLogo.count {
let urlString = merchantLogo[i]
horizontalStackView.addArrangedSubview(
CreateRoundedLogoView(urlString: urlString)
)
let logoView = CreateRoundedLogoView(urlString: urlString)
self.shadowLayers.append(logoView.layer)
horizontalStackView.addArrangedSubview(logoView)

let isLastLogo = (i == merchantLogo.count - 1)
if !isLastLogo, showsAnimatedDots {
Expand Down Expand Up @@ -93,12 +94,22 @@ final class ConsentLogoView: UIView {
}
)
}

// CGColor's need to be manually updated when the system theme changes.
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
guard traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) else { return }

for shadow in shadowLayers {
shadow.shadowColor = FinancialConnectionsAppearance.Colors.shadow.cgColor
}
}
}

private func CreateRoundedLogoView(urlString: String) -> UIView {
let cornerRadius: CGFloat = 16.0
let shadowContainerView = UIView()
shadowContainerView.layer.shadowColor = UIColor.black.cgColor
shadowContainerView.layer.shadowColor = FinancialConnectionsAppearance.Colors.shadow.cgColor
shadowContainerView.layer.shadowOpacity = 0.18
shadowContainerView.layer.shadowOffset = CGSize(width: 0, height: 3)
shadowContainerView.layer.shadowRadius = 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class InstitutionPickerViewController: UIViewController {
private let dataSource: InstitutionDataSource
weak var delegate: InstitutionPickerViewControllerDelegate?

private var shadowLayer: CALayer?

private lazy var headerView: UIView = {
let verticalStackView = UIStackView(
arrangedSubviews: [
Expand Down Expand Up @@ -88,6 +90,7 @@ class InstitutionPickerViewController: UIViewController {
// appear IF the user scrolls up very quickly
height: -Self.headerAndSearchBarSpacing
)
self.shadowLayer = verticalStackView.layer
return verticalStackView
}()
private lazy var searchBar: InstitutionSearchBar = {
Expand Down Expand Up @@ -241,6 +244,14 @@ class InstitutionPickerViewController: UIViewController {
animated: true
)
}

// CGColor's need to be manually updated when the system theme changes.
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
guard traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) else { return }

shadowLayer?.shadowColor = FinancialConnectionsAppearance.Colors.background.cgColor
}
}

// MARK: - Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ final class InstitutionSearchBar: UIView {
height: 1 / UIScreen.main.nativeScale
)
}

// CGColor's need to be manually updated when the system theme changes.
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
guard traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) else { return }

layer.shadowColor = FinancialConnectionsAppearance.Colors.shadow.cgColor
}
}

// MARK: - UITextFieldDelegate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ final class LinkAccountPickerNewAccountRowView: UIView {
@objc private func didTapView() {
self.didSelect()
}

// CGColor's need to be manually updated when the system theme changes.
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
guard traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) else { return }

layer.borderColor = FinancialConnectionsAppearance.Colors.borderNeutral.cgColor
}
}

private func CreateIconView(imageUrl: String, appearance: FinancialConnectionsAppearance) -> UIView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,26 @@ import Foundation
import UIKit

final class NetworkingLinkLoginWarmupBodyView: HitTestView {
var borderLayer: CALayer?

init(email: String) {
super.init(frame: .zero)
let emailView = CreateEmailView(email: email)
self.borderLayer = emailView.layer
addAndPinSubview(emailView)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

// CGColor's need to be manually updated when the system theme changes.
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
guard traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) else { return }

borderLayer?.borderColor = FinancialConnectionsAppearance.Colors.borderNeutral.cgColor
}
}

private func CreateEmailView(
Expand Down
Loading

0 comments on commit 71d1fb0

Please sign in to comment.