From c20cb84621e71854f16c1803cb1c06782549dc01 Mon Sep 17 00:00:00 2001 From: Kieran Osgood Date: Mon, 14 Sep 2026 15:17:00 +0100 Subject: [PATCH] refactor(swift): make checkout appearance own native colors Assisted-By: devx/6076b771-cb74-4665-935f-816eba5058f0 --- platforms/swift/README.md | 63 +- .../Sources/App/AppDelegate.swift | 5 +- .../Sources/App/SceneDelegate.swift | 17 +- .../Sources/Scenes/Cart/CartView.swift | 1 - .../Sources/Scenes/SettingsView.swift | 54 +- .../Scenes/AppearanceOptionTests.swift | 41 + .../Wallets/ApplePay/ApplePayButton.swift | 2 +- .../CheckoutAppearance.swift | 13 + .../CheckoutURLDecorator.swift | 9 +- .../CheckoutViewController.swift | 28 +- .../ShopifyCheckoutKit/CheckoutWebView.swift | 28 +- .../CheckoutWebViewController.swift | 71 +- .../ShopifyCheckoutKit/ColorScheme.swift | 70 + .../Sources/ShopifyCheckoutKit/Colors.swift | 35 + .../ShopifyCheckoutKit/Configuration.swift | 31 +- .../CheckoutAppearanceRenderingTests.swift | 262 ++ .../CheckoutAppearanceTests.swift | 31 + .../CheckoutURLDecoratorTests.swift | 19 +- .../CheckoutViewControllerTests.swift | 24 +- .../ColorSchemeTests.swift | 138 + .../ShopifyCheckoutKitTests/ColorsTests.swift | 65 + .../ConfigurationTests.swift | 73 +- .../SwiftUITests.swift | 53 +- platforms/swift/api/ShopifyCheckoutKit.json | 2602 ++++++++++------- 24 files changed, 2407 insertions(+), 1328 deletions(-) create mode 100644 platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemoTests/Scenes/AppearanceOptionTests.swift create mode 100644 platforms/swift/Sources/ShopifyCheckoutKit/CheckoutAppearance.swift create mode 100644 platforms/swift/Sources/ShopifyCheckoutKit/ColorScheme.swift create mode 100644 platforms/swift/Sources/ShopifyCheckoutKit/Colors.swift create mode 100644 platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutAppearanceRenderingTests.swift create mode 100644 platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutAppearanceTests.swift create mode 100644 platforms/swift/Tests/ShopifyCheckoutKitTests/ColorSchemeTests.swift create mode 100644 platforms/swift/Tests/ShopifyCheckoutKitTests/ColorsTests.swift diff --git a/platforms/swift/README.md b/platforms/swift/README.md index ad13250ba..19f192410 100644 --- a/platforms/swift/README.md +++ b/platforms/swift/README.md @@ -142,10 +142,7 @@ struct CartView: View { .sheet(isPresented: $isPresented) { ShopifyCheckout(checkout: checkoutURL) .title("Checkout") - .appearance(.storefront) - .tintColor(.systemBlue) - .backgroundColor(.systemBackground) - .closeButtonTintColor(nil) + .appearance(.storefront(colors: Colors(progressIndicator: .systemBlue))) .onDismiss { isPresented = false } @@ -245,24 +242,18 @@ Configure global presentation defaults before presenting checkout. `ShopifyCheck import ShopifyCheckoutKit ShopifyCheckoutKit.configure { - $0.appearance = .storefront - $0.tintColor = .systemBlue - $0.backgroundColor = .systemBackground - $0.closeButtonTintColor = nil + $0.appearance = .storefront(colors: Colors(progressIndicator: .systemBlue)) $0.logLevel = .debug $0.telemetry.enabled = false } ``` -`ShopifyCheckout` uses the global configuration as its defaults. When present, modifiers such as `.appearance(...)`, `.tintColor(...)`, and `.title(...)` take precedence over the corresponding `ShopifyCheckoutKit.configuration` values for that checkout. Modifiers do not mutate `ShopifyCheckoutKit.configuration`, so they do not invalidate a cached preload. +`ShopifyCheckout` uses the global configuration as its defaults. When present, modifiers such as `.appearance(...)` and `.title(...)` take precedence over the corresponding `ShopifyCheckoutKit.configuration` values for that checkout. Modifiers do not mutate `ShopifyCheckoutKit.configuration`, so they do not invalidate a cached preload. | Option | Default | Purpose | | --- | --- | --- | -| `appearance` | `.storefront` | Match the storefront's web checkout branding with a light color scheme, or use the Checkout Kit style with `.app(.automatic)`, `.app(.light)`, or `.app(.dark)`. | -| `tintColor` | Shopify blue | Progress indicator color while checkout initializes. | -| `backgroundColor` | `.systemBackground` | Background behind the web view while checkout initializes. | +| `appearance` | `.storefront()` | Match the storefront's web checkout branding with a light color scheme, or use the Checkout Kit style with `.app(.automatic())`, `.app(.light())`, or `.app(.dark())`. Each appearance owns its native colors. | | `title` | Localized `shopify_checkout_kit_title` or `Checkout` | Navigation title for the checkout sheet. | -| `closeButtonTintColor` | `nil` | Optional tint for the close button. | | `logLevel` | `.warn` | SDK logging verbosity. Threshold-ordered `.debug` → `.warn` → `.error` → `.none`; use `.debug` during integration. | | `preloading.enabled` | `true` | Enables best-effort checkout preloading before presentation. | | `allowedMessageOrigins` | `[]` | Origins trusted to send incoming checkout messages. Empty trusts every origin (open by default). See [Incoming message origin validation](#incoming-message-origin-validation). | @@ -277,6 +268,52 @@ operating system for delivery. To localize the title, add `shopify_checkout_kit_title` to your app's `Localizable.xcstrings`. +### Appearance and native colors + +`CheckoutAppearance` owns the native palette. Use `.storefront(colors:)` to customize the surrounding native UI without changing the merchant's web checkout branding, or `.app(...)` with a `ColorScheme` to use Checkout Kit branding. + +`Colors` uses native `UIColor` and `UIImage` values. Dynamic colors, accessibility contrast, and transparency remain supported. The default navigation bar remains transparent and the default close button remains the iOS system control. + +| `Colors` property | Default | Purpose | +| --- | --- | --- | +| `webViewBackground` | `.systemBackground` | Background behind the WebView and its overscroll area. | +| `headerBackground` | `.clear` | Navigation-bar background. | +| `headerFont` | `.label` | Navigation-title color. | +| `progressIndicator` | Shopify blue | Progress indicator while checkout loads. | +| `closeIcon` | `nil` | Optional native image for the close button. | +| `closeIconTint` | `nil` | Optional close-button tint. With no icon or tint override, iOS supplies the system close button. | +| `headerBorderColor` | `nil` | Optional navigation-bar shadow color. | + +Light and dark schemes each own one palette. Automatic appearance owns independent `lightColors` and `darkColors`, and switches natively when the system appearance changes: + +```swift +ShopifyCheckoutKit.configure { + $0.appearance = .app(.automatic( + lightColors: Colors(progressIndicator: .systemBlue, closeIconTint: .systemBlue), + darkColors: Colors(progressIndicator: .systemTeal, closeIconTint: .systemTeal) + )) +} +``` + +Use `customize` to derive a modified copy without changing the original palette or scheme. A single customization applies to both automatic palettes; use `customize(light:dark:)` for separate automatic overrides: + +```swift +let appearance = CheckoutAppearance.app( + .automatic().customize( + light: { $0.progressIndicator = .systemBlue }, + dark: { $0.progressIndicator = .systemTeal } + ) +) + +ShopifyCheckoutKit.configure { + $0.appearance = appearance +} +``` + +Set appearance before presenting checkout. Replacing it with `.storefront()`, `.app(.light())`, `.app(.dark())`, or `.app(.automatic())` restores that appearance's default colors. Updating unrelated settings such as logging, preloading, or the checkout title preserves the configured palette. A presented checkout uses the native colors of the configuration it was created with, including a reused preloaded WebView. + +The previous configuration-level `backgroundColor`, `tintColor`, `spinnerColor`, and `closeButtonTintColor` properties, and the corresponding SwiftUI color modifiers, have been removed. Use `Colors.webViewBackground`, `Colors.progressIndicator`, and `Colors.closeIconTint` through `appearance` instead. `CheckoutAppearance` replaces `Configuration.Appearance`, and `ShopifyCheckoutKit.ColorScheme` replaces `Configuration.ColorScheme`; qualify the latter when also importing `SwiftUI`. + ### Incoming message origin validation The native web view is a private, app-controlled runtime, so Checkout Kit is diff --git a/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/App/AppDelegate.swift b/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/App/AppDelegate.swift index f39111669..9d4180c27 100644 --- a/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/App/AppDelegate.swift +++ b/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/App/AppDelegate.swift @@ -30,8 +30,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ) as? Bool ?? true ShopifyCheckoutKit.configure { - $0.appearance = .app(.automatic) - $0.tintColor = ColorPalette.primaryColor + $0.appearance = .app(.automatic().customize { + $0.progressIndicator = ColorPalette.primaryColor + }) $0.logger = ObservingLogger(wrapping: FileLogger("log.txt")) $0.logLevel = checkoutKitLogLevel $0.preloading.enabled = checkoutPreloadingEnabled diff --git a/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/App/SceneDelegate.swift b/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/App/SceneDelegate.swift index f9485a1e5..971267435 100644 --- a/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/App/SceneDelegate.swift +++ b/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/App/SceneDelegate.swift @@ -40,7 +40,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { setupControllers() subscribeToCartUpdates() - subscribeToColorSchemeChanges() + subscribeToAppearanceChanges() var viewControllers: [UIViewController?] = Array(repeating: nil, count: Screen.allCases.count) @@ -70,9 +70,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { self.window = window } - private func subscribeToColorSchemeChanges() { - // Subscribe to color scheme changes on the settings screen - NotificationCenter.default.addObserver(self, selector: #selector(colorSchemeChanged), name: .colorSchemeChanged, object: nil) + private func subscribeToAppearanceChanges() { + NotificationCenter.default.addObserver(self, selector: #selector(appearanceChanged), name: .appearanceChanged, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(navigateToAccountTab), name: .navigateToAccount, object: nil) } @@ -299,7 +298,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { navigateTo(.catalog) } - @objc func colorSchemeChanged() { + @objc func appearanceChanged() { window?.overrideUserInterfaceStyle = ShopifyCheckoutKit.configuration.appearance.userInterfaceStyle } @@ -316,11 +315,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { } extension Notification.Name { - static let colorSchemeChanged = Notification.Name("colorSchemeChanged") + static let appearanceChanged = Notification.Name("appearanceChanged") static let navigateToAccount = Notification.Name("navigateToAccount") } -extension Configuration.ColorScheme { +extension ShopifyCheckoutKit.ColorScheme { var userInterfaceStyle: UIUserInterfaceStyle { switch self { case .light: @@ -333,13 +332,13 @@ extension Configuration.ColorScheme { } } -extension Configuration.Appearance { +extension CheckoutAppearance { var userInterfaceStyle: UIUserInterfaceStyle { switch self { case let .app(colorScheme): return colorScheme.userInterfaceStyle case .storefront: - return Configuration.ColorScheme.light.userInterfaceStyle + return .light } } } diff --git a/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/Scenes/Cart/CartView.swift b/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/Scenes/Cart/CartView.swift index 6f3b0190c..89a478517 100644 --- a/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/Scenes/Cart/CartView.swift +++ b/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/Scenes/Cart/CartView.swift @@ -109,7 +109,6 @@ struct CartView: View { .sheet(isPresented: $showCheckoutSheet) { if let url = cartManager.cart?.checkoutURL { ShopifyCheckout(checkout: url) - .appearance(.app(.automatic)) .title("Checkout (SwiftUI)") .onStart { event in print("[CheckoutKitSwiftDemo] Started: \(event.checkout.id)") diff --git a/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/Scenes/SettingsView.swift b/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/Scenes/SettingsView.swift index 6b2c6a89a..a0b6886a9 100644 --- a/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/Scenes/SettingsView.swift +++ b/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemo/Sources/Scenes/SettingsView.swift @@ -50,7 +50,7 @@ struct SettingsView: View { var windowOpenHandler: WindowOpenHandlerOption = .default @State private var logs: [String?] = LogReader.shared.readLogs() ?? [] - @State private var selectedAppearance = ShopifyCheckoutKit.configuration.appearance + @State private var selectedAppearanceOption = AppearanceOption(appearance: ShopifyCheckoutKit.configuration.appearance) @State private var isResettingSession = false @State private var showingSessionReset = false @@ -134,19 +134,17 @@ struct SettingsView: View { ForEach(AppearanceOption.allCases) { option in AppearanceOptionView( title: option.title, - isSelected: option.appearance == selectedAppearance + isSelected: option == selectedAppearanceOption ) .background(Color.clear) .contentShape(Rectangle()) .onTapGesture { - selectedAppearance = option.appearance + selectedAppearanceOption = option ShopifyCheckoutKit.configure { $0.appearance = option.appearance - $0.tintColor = option.appearance.colorScheme.tintColor - $0.backgroundColor = option.appearance.colorScheme.backgroundColor } NotificationCenter.default.post( - name: .colorSchemeChanged, object: nil + name: .appearanceChanged, object: nil ) } } @@ -306,6 +304,19 @@ enum AppearanceOption: CaseIterable, Identifiable { case appLight case appDark + init(appearance: CheckoutAppearance) { + switch appearance { + case .storefront: + self = .storefront + case .app(.automatic): + self = .appAutomatic + case .app(.light): + self = .appLight + case .app(.dark): + self = .appDark + } + } + var id: Self { self } @@ -323,37 +334,16 @@ enum AppearanceOption: CaseIterable, Identifiable { } } - var appearance: Configuration.Appearance { + var appearance: CheckoutAppearance { switch self { case .storefront: - return .storefront + return .storefront() case .appAutomatic: - return .app(.automatic) + return .app(.automatic()) case .appLight: - return .app(.light) + return .app(.light()) case .appDark: - return .app(.dark) - } - } -} - -extension Configuration.ColorScheme { - var tintColor: UIColor { - return UIColor(red: 0.09, green: 0.45, blue: 0.69, alpha: 1.00) - } - - var backgroundColor: UIColor { - return .systemBackground - } -} - -extension Configuration.Appearance { - var colorScheme: Configuration.ColorScheme { - switch self { - case let .app(colorScheme): - return colorScheme - case .storefront: - return .light + return .app(.dark()) } } } diff --git a/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemoTests/Scenes/AppearanceOptionTests.swift b/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemoTests/Scenes/AppearanceOptionTests.swift new file mode 100644 index 000000000..061775774 --- /dev/null +++ b/platforms/swift/Samples/CheckoutKitSwiftDemo/CheckoutKitSwiftDemoTests/Scenes/AppearanceOptionTests.swift @@ -0,0 +1,41 @@ +@testable import CheckoutKitSwiftDemo +import ShopifyCheckoutKit +import XCTest + +@MainActor +final class AppearanceOptionTests: XCTestCase { + func testDefaultAppearancesSelectTheMatchingOption() { + for (appearance, option) in defaultAppearances() { + XCTAssertEqual(AppearanceOption(appearance: appearance), option) + } + } + + func testCustomNativeColorsDoNotChangeTheSelectedAppearanceOption() { + let colors = Colors(webViewBackground: .red, progressIndicator: .green, closeIconTint: .blue) + let appearances: [(CheckoutAppearance, AppearanceOption)] = [ + (.storefront(colors: colors), .storefront), + (.app(.light(colors: colors)), .appLight), + (.app(.dark(colors: colors)), .appDark), + (.app(.automatic(lightColors: colors, darkColors: Colors(progressIndicator: .purple))), .appAutomatic) + ] + + for (appearance, option) in appearances { + XCTAssertEqual(AppearanceOption(appearance: appearance), option) + } + } + + func testAppearanceOptionsCreateFreshDefaultPalettes() { + for (appearance, option) in defaultAppearances() { + XCTAssertEqual(option.appearance, appearance) + } + } + + private func defaultAppearances() -> [(CheckoutAppearance, AppearanceOption)] { + [ + (.storefront(), .storefront), + (.app(.automatic()), .appAutomatic), + (.app(.light()), .appLight), + (.app(.dark()), .appDark) + ] + } +} diff --git a/platforms/swift/Sources/ShopifyAcceleratedCheckouts/Wallets/ApplePay/ApplePayButton.swift b/platforms/swift/Sources/ShopifyAcceleratedCheckouts/Wallets/ApplePay/ApplePayButton.swift index 14aff4f48..dad6182cd 100644 --- a/platforms/swift/Sources/ShopifyAcceleratedCheckouts/Wallets/ApplePay/ApplePayButton.swift +++ b/platforms/swift/Sources/ShopifyAcceleratedCheckouts/Wallets/ApplePay/ApplePayButton.swift @@ -96,7 +96,7 @@ struct Internal_ApplePayButton: View { private let cornerRadius: CGFloat? @Environment(\.colorScheme) private var colorScheme - func buttonIdentity(colorScheme: ColorScheme) -> String { + func buttonIdentity(colorScheme: SwiftUI.ColorScheme) -> String { return "\(colorScheme)-\(buttonType.rawValue)-\(buttonStyle.rawValue)" } diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutAppearance.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutAppearance.swift new file mode 100644 index 000000000..e225eb2c8 --- /dev/null +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutAppearance.swift @@ -0,0 +1,13 @@ +public enum CheckoutAppearance: Equatable, Sendable { + case app(ColorScheme = .automatic()) + case storefront(colors: Colors = .init()) + + var effectiveColorScheme: ColorScheme { + switch self { + case let .app(colorScheme): + return colorScheme + case let .storefront(colors): + return .light(colors: colors) + } + } +} diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutURLDecorator.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutURLDecorator.swift index 3ba6f3f59..71233f0a6 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutURLDecorator.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutURLDecorator.swift @@ -31,14 +31,9 @@ enum CheckoutURLDecorator { private static let brandingQueryItemName = "ck_branding" } -extension Configuration.Appearance { +extension CheckoutAppearance { fileprivate var colorSchemeValue: String { - switch self { - case let .app(colorScheme): - return colorScheme.rawValue - case .storefront: - return Configuration.ColorScheme.light.rawValue - } + effectiveColorScheme.id } fileprivate var brandingValue: String { diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutViewController.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutViewController.swift index 700e3a7a6..6c1349587 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutViewController.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutViewController.swift @@ -24,13 +24,18 @@ public class CheckoutViewController: UINavigationController { entryPoint: entryPoint ) super.init(rootViewController: rootViewController) - configureNavigationBar() + configureNavigationBar(colorScheme: configuration.appearance.effectiveColorScheme) presentationController?.delegate = rootViewController } - private func configureNavigationBar() { + private func configureNavigationBar(colorScheme: ColorScheme) { + overrideUserInterfaceStyle = colorScheme.userInterfaceStyle + let appearance = UINavigationBarAppearance() appearance.configureWithTransparentBackground() + appearance.backgroundColor = colorScheme.color { $0.headerBackground } + appearance.titleTextAttributes = [.foregroundColor: colorScheme.color { $0.headerFont }] + appearance.shadowColor = colorScheme.optionalColor { $0.headerBorderColor } navigationBar.standardAppearance = appearance navigationBar.scrollEdgeAppearance = appearance @@ -145,34 +150,19 @@ public struct ShopifyCheckout: UIViewControllerRepresentable, CheckoutConfigurab @MainActor public protocol CheckoutConfigurable { - func backgroundColor(_ color: UIColor) -> Self - func appearance(_ appearance: ShopifyCheckoutKit.Configuration.Appearance) -> Self - func tintColor(_ color: UIColor) -> Self + func appearance(_ appearance: CheckoutAppearance) -> Self func title(_ title: String) -> Self - func closeButtonTintColor(_ color: UIColor?) -> Self } extension CheckoutConfigurable { - @discardableResult public func backgroundColor(_ color: UIColor) -> Self { - modifyingConfiguration { $0.backgroundColor = color } - } - - @discardableResult public func appearance(_ appearance: ShopifyCheckoutKit.Configuration.Appearance) -> Self { + @discardableResult public func appearance(_ appearance: CheckoutAppearance) -> Self { modifyingConfiguration { $0.appearance = appearance } } - @discardableResult public func tintColor(_ color: UIColor) -> Self { - modifyingConfiguration { $0.tintColor = color } - } - @discardableResult public func title(_ title: String) -> Self { modifyingConfiguration { $0.title = title } } - @discardableResult public func closeButtonTintColor(_ color: UIColor?) -> Self { - modifyingConfiguration { $0.closeButtonTintColor = color } - } - private func modifyingConfiguration(_ update: (inout Configuration) -> Void) -> Self { guard var copy = self as? ShopifyCheckout else { return self diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift index 33ac1382d..543e7c04b 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift @@ -523,8 +523,23 @@ class CheckoutWebView: WKWebView { translatesAutoresizingMaskIntoConstraints = false scrollView.contentInsetAdjustmentBehavior = .never - setBackgroundColor() + applyColorScheme(ShopifyCheckoutKit.configuration.appearance.effectiveColorScheme) connectBridge() + + if #available(iOS 17.0, *) { + registerForTraitChanges(UITraitCollection.systemTraitsAffectingColorAppearance) { (view: CheckoutWebView, _) in + view.setUnderPageBackgroundColor() + } + } + } + + @available(iOS, deprecated: 17.0) + override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { + super.traitCollectionDidChange(previousTraitCollection) + + if #unavailable(iOS 17.0), traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) { + setUnderPageBackgroundColor() + } } deinit { @@ -567,10 +582,15 @@ class CheckoutWebView: WKWebView { detachBridge() } - private func setBackgroundColor() { + func applyColorScheme(_ colorScheme: ColorScheme) { + overrideUserInterfaceStyle = colorScheme.userInterfaceStyle isOpaque = false - backgroundColor = ShopifyCheckoutKit.configuration.backgroundColor - underPageBackgroundColor = ShopifyCheckoutKit.configuration.backgroundColor + backgroundColor = colorScheme.color { $0.webViewBackground } + setUnderPageBackgroundColor() + } + + private func setUnderPageBackgroundColor() { + underPageBackgroundColor = backgroundColor?.resolvedColor(with: traitCollection) } // MARK: - diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebViewController.swift b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebViewController.swift index 721181df0..cd431fbbe 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebViewController.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebViewController.swift @@ -18,7 +18,7 @@ class CheckoutWebViewController: UIViewController, UIAdaptivePresentationControl var checkoutView: CheckoutWebView? lazy var progressBar: ProgressBarView = { - let progressBar = ProgressBarView(frame: .zero, tintColor: configuration.tintColor) + let progressBar = ProgressBarView(frame: .zero, tintColor: colorScheme.color { $0.progressIndicator }) progressBar.translatesAutoresizingMaskIntoConstraints = false return progressBar }() @@ -27,40 +27,37 @@ class CheckoutWebViewController: UIViewController, UIAdaptivePresentationControl private let checkoutURL: URL private let configuration: Configuration + private let colorScheme: ColorScheme - private lazy var closeBarButtonItem: UIBarButtonItem = { - if let closeButtonTintColor = configuration.closeButtonTintColor { - var item: UIBarButtonItem + private var closeBarButtonItem: UIBarButtonItem { + let colors = colorScheme.colors(isDark: traitCollection.userInterfaceStyle == .dark) + let item: UIBarButtonItem + if colors.closeIcon != nil || colors.closeIconTint != nil { + let defaultSymbolName: String if #available(iOS 26.0, *) { - item = UIBarButtonItem( - image: UIImage(systemName: "xmark"), - style: .plain, - target: self, - action: #selector(close) - ) + defaultSymbolName = "xmark" } else { - item = UIBarButtonItem( - image: UIImage(systemName: "xmark.circle.fill"), - style: .plain, - target: self, - action: #selector(close) - ) + defaultSymbolName = "xmark.circle.fill" } - - item.tintColor = closeButtonTintColor - item.accessibilityIdentifier = Self.closeButtonAccessibilityIdentifier - return item + item = UIBarButtonItem( + image: colors.closeIcon ?? UIImage(systemName: defaultSymbolName), + style: .plain, + target: self, + action: #selector(close) + ) + item.tintColor = colors.closeIconTint + } else { + item = UIBarButtonItem( + barButtonSystemItem: .close, + target: self, + action: #selector(close) + ) } - let item = UIBarButtonItem( - barButtonSystemItem: .close, - target: self, - action: #selector(close) - ) item.accessibilityIdentifier = Self.closeButtonAccessibilityIdentifier return item - }() + } var progressObserver: NSKeyValueObservation? @@ -69,12 +66,12 @@ class CheckoutWebViewController: UIViewController, UIAdaptivePresentationControl public init(checkoutURL url: URL, configuration: Configuration = ShopifyCheckoutKit.configuration, delegate: (any CheckoutDelegate)? = nil, client: (any CheckoutCommunicationProtocol)? = nil, entryPoint: MetaData.EntryPoint? = nil) { checkoutURL = url self.configuration = configuration + colorScheme = configuration.appearance.effectiveColorScheme self.delegate = delegate let checkoutView = CheckoutWebView.for(checkout: url, entryPoint: entryPoint) checkoutView.isPresented = true - checkoutView.backgroundColor = configuration.backgroundColor - checkoutView.underPageBackgroundColor = configuration.backgroundColor + checkoutView.applyColorScheme(colorScheme) checkoutView.translatesAutoresizingMaskIntoConstraints = false checkoutView.scrollView.contentInsetAdjustmentBehavior = .automatic self.checkoutView = checkoutView @@ -88,13 +85,20 @@ class CheckoutWebViewController: UIViewController, UIAdaptivePresentationControl checkoutView.client = CheckoutEventAdapter(base: client, sink: self) + overrideUserInterfaceStyle = colorScheme.userInterfaceStyle title = configuration.title navigationItem.rightBarButtonItem = closeBarButtonItem checkoutView.viewDelegate = self - view.backgroundColor = configuration.backgroundColor + view.backgroundColor = colorScheme.color { $0.webViewBackground } + + if #available(iOS 17.0, *) { + registerForTraitChanges([UITraitUserInterfaceStyle.self]) { (controller: CheckoutWebViewController, _) in + controller.navigationItem.rightBarButtonItem = controller.closeBarButtonItem + } + } } @available(*, unavailable) @@ -104,10 +108,13 @@ class CheckoutWebViewController: UIViewController, UIAdaptivePresentationControl // MARK: UIViewController Lifecycle - override public func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) + @available(iOS, deprecated: 17.0) + override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { + super.traitCollectionDidChange(previousTraitCollection) - view.backgroundColor = configuration.backgroundColor + if #unavailable(iOS 17.0), previousTraitCollection?.userInterfaceStyle != traitCollection.userInterfaceStyle { + navigationItem.rightBarButtonItem = closeBarButtonItem + } } override public func viewDidLoad() { diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/ColorScheme.swift b/platforms/swift/Sources/ShopifyCheckoutKit/ColorScheme.swift new file mode 100644 index 000000000..c5cf82b69 --- /dev/null +++ b/platforms/swift/Sources/ShopifyCheckoutKit/ColorScheme.swift @@ -0,0 +1,70 @@ +import UIKit + +public enum ColorScheme: Equatable, Sendable { + case light(colors: Colors = .init()) + case dark(colors: Colors = .init()) + case automatic(lightColors: Colors = .init(), darkColors: Colors = .init()) + + public var id: String { + switch self { + case .light: return "light" + case .dark: return "dark" + case .automatic: return "automatic" + } + } + + public func customize(_ customizer: (inout Colors) -> Void) -> ColorScheme { + customize(light: customizer, dark: customizer) + } + + public func customize( + light: (inout Colors) -> Void, + dark: (inout Colors) -> Void + ) -> ColorScheme { + switch self { + case let .light(colors): + return .light(colors: colors.customize(light)) + case let .dark(colors): + return .dark(colors: colors.customize(light)) + case let .automatic(lightColors, darkColors): + return .automatic( + lightColors: lightColors.customize(light), + darkColors: darkColors.customize(dark) + ) + } + } + + var userInterfaceStyle: UIUserInterfaceStyle { + switch self { + case .light: return .light + case .dark: return .dark + case .automatic: return .unspecified + } + } + + func color(_ value: @escaping @Sendable (Colors) -> UIColor) -> UIColor { + UIColor { traits in + let resolvedTraits = userInterfaceStyle == .unspecified + ? traits + : UITraitCollection(traitsFrom: [traits, UITraitCollection(userInterfaceStyle: userInterfaceStyle)]) + let colors = colors(isDark: resolvedTraits.userInterfaceStyle == .dark) + return value(colors).resolvedColor(with: resolvedTraits) + } + } + + func optionalColor(_ value: @escaping @Sendable (Colors) -> UIColor?) -> UIColor? { + guard value(colors(isDark: false)) != nil || value(colors(isDark: true)) != nil else { + return nil + } + return color { value($0) ?? .clear } + } + + func colors(isDark: Bool) -> Colors { + switch self { + case let .light(colors), let .dark(colors): + return colors + case let .automatic(lightColors, darkColors): + return isDark ? darkColors : lightColors + } + } +} diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/Colors.swift b/platforms/swift/Sources/ShopifyCheckoutKit/Colors.swift new file mode 100644 index 000000000..79905cc36 --- /dev/null +++ b/platforms/swift/Sources/ShopifyCheckoutKit/Colors.swift @@ -0,0 +1,35 @@ +import UIKit + +public struct Colors: Equatable, Sendable { + public var webViewBackground: UIColor + public var headerBackground: UIColor + public var headerFont: UIColor + public var progressIndicator: UIColor + public var closeIcon: UIImage? + public var closeIconTint: UIColor? + public var headerBorderColor: UIColor? + + public init( + webViewBackground: UIColor = .systemBackground, + headerBackground: UIColor = .clear, + headerFont: UIColor = .label, + progressIndicator: UIColor = .init(red: 0.09, green: 0.45, blue: 0.69, alpha: 1), + closeIcon: UIImage? = nil, + closeIconTint: UIColor? = nil, + headerBorderColor: UIColor? = nil + ) { + self.webViewBackground = webViewBackground + self.headerBackground = headerBackground + self.headerFont = headerFont + self.progressIndicator = progressIndicator + self.closeIcon = closeIcon + self.closeIconTint = closeIconTint + self.headerBorderColor = headerBorderColor + } + + public func customize(_ customizer: (inout Colors) -> Void) -> Colors { + var colors = self + customizer(&colors) + return colors + } +} diff --git a/platforms/swift/Sources/ShopifyCheckoutKit/Configuration.swift b/platforms/swift/Sources/ShopifyCheckoutKit/Configuration.swift index 63e645829..e23ec086c 100644 --- a/platforms/swift/Sources/ShopifyCheckoutKit/Configuration.swift +++ b/platforms/swift/Sources/ShopifyCheckoutKit/Configuration.swift @@ -15,9 +15,7 @@ public struct Configuration: Sendable { /// Determines the appearance used when checkout is presented. /// /// By default, checkout uses the storefront's web checkout branding. - /// Use `.app(.automatic)`, `.app(.light)`, or `.app(.dark)` to use the - /// Checkout Kit style instead. - public var appearance = Appearance.storefront + public var appearance = CheckoutAppearance.storefront() public var confetti = Configuration.Confetti() @@ -26,17 +24,10 @@ public struct Configuration: Sendable { /// Controls anonymous diagnostic metrics sent by Checkout Kit. public var telemetry = Configuration.Telemetry() - public var tintColor: UIColor = .init(red: 0.09, green: 0.45, blue: 0.69, alpha: 1.00) - - public var backgroundColor: UIColor = .systemBackground - public var logger: Logger = NoOpLogger() public var title: String = NSLocalizedString("shopify_checkout_kit_title", value: "Checkout", comment: "The title of the checkout sheet.") - /// The tint color for the close button. If nil, uses the system default. - public var closeButtonTintColor: UIColor? - /// Custom enum for identifying traffic from alternative platforms public var platform: Platform? @@ -63,26 +54,6 @@ public struct Configuration: Sendable { public var allowedMessageOrigins: [String] = [] } -extension Configuration { - public enum ColorScheme: String, CaseIterable, Sendable { - /// Uses a light, idiomatic color scheme. - case light - /// Uses a dark, idiomatic color scheme. - case dark - /// Infers either `.light` or `.dark` based on the current `UIUserInterfaceStyle`. - case automatic - } -} - -extension Configuration { - public enum Appearance: Equatable, Sendable { - /// Uses the Checkout Kit style with the provided color scheme. - case app(ColorScheme = .automatic) - /// Uses the storefront's web checkout branding with a light color scheme. - case storefront - } -} - extension Configuration { public struct Confetti: Sendable { public var enabled: Bool = false diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutAppearanceRenderingTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutAppearanceRenderingTests.swift new file mode 100644 index 000000000..648bf97de --- /dev/null +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutAppearanceRenderingTests.swift @@ -0,0 +1,262 @@ +@testable import ShopifyCheckoutKit +import UIKit +import XCTest + +@MainActor +class CheckoutAppearanceRenderingTests: XCTestCase { + private let checkoutURL = URL(string: "https://example.myshopify.com/checkouts/test")! + + override func setUp() async throws { + try await super.setUp() + ShopifyCheckoutKit.configure { $0 = Configuration() } + ShopifyCheckoutKit.invalidate() + } + + override func tearDown() async throws { + ShopifyCheckoutKit.configure { $0 = Configuration() } + ShopifyCheckoutKit.invalidate() + try await super.tearDown() + } + + func testExplicitAppearancesSetTheCheckoutInterfaceStyle() { + let appearances: [(CheckoutAppearance, UIUserInterfaceStyle)] = [ + (.app(.light()), .light), + (.app(.dark()), .dark), + (.app(.automatic()), .unspecified), + (.storefront(), .light) + ] + + for (appearance, style) in appearances { + let controller = makeViewController(appearance: appearance) + + XCTAssertEqual(controller.overrideUserInterfaceStyle, style) + } + } + + func testExplicitAppearanceAppliesAllNativeColorOverrides() throws { + let colors = makeColors(background: .red, closeIconTint: .blue) + let controller = makeViewController(appearance: .app(.dark(colors: colors))) + let checkoutController = try checkoutController(of: controller) + let checkoutView = try XCTUnwrap(checkoutController.checkoutView) + + assertColor(checkoutView.backgroundColor, equals: colors.webViewBackground) + assertColor(checkoutView.underPageBackgroundColor, equals: colors.webViewBackground) + assertColor(checkoutController.view.backgroundColor, equals: colors.webViewBackground) + assertColor(checkoutController.progressBar.progressBar.tintColor, equals: colors.progressIndicator) + try assertColor(checkoutController.navigationItem.rightBarButtonItem?.tintColor, equals: XCTUnwrap(colors.closeIconTint)) + assertColor(controller.navigationBar.standardAppearance.backgroundColor, equals: colors.headerBackground) + assertColor(controller.navigationBar.standardAppearance.titleTextAttributes[.foregroundColor] as? UIColor, equals: colors.headerFont) + try assertColor(controller.navigationBar.standardAppearance.shadowColor, equals: XCTUnwrap(colors.headerBorderColor)) + } + + func testAutomaticAppearanceKeepsIndependentDynamicPalettesOnNativeViews() throws { + let lightColors = makeColors(background: .red) + let darkColors = makeColors(background: .blue) + let controller = makeViewController(appearance: .app(.automatic(lightColors: lightColors, darkColors: darkColors))) + let checkoutController = try checkoutController(of: controller) + let checkoutView = try XCTUnwrap(checkoutController.checkoutView) + + for (style, colors) in [(UIUserInterfaceStyle.light, lightColors), (.dark, darkColors)] { + assertColor(checkoutView.backgroundColor, equals: colors.webViewBackground, style: style) + assertColor(checkoutController.view.backgroundColor, equals: colors.webViewBackground, style: style) + assertColor(checkoutController.progressBar.progressBar.tintColor, equals: colors.progressIndicator, style: style) + assertColor(controller.navigationBar.standardAppearance.backgroundColor, equals: colors.headerBackground, style: style) + assertColor(controller.navigationBar.standardAppearance.titleTextAttributes[.foregroundColor] as? UIColor, equals: colors.headerFont, style: style) + try assertColor(controller.navigationBar.standardAppearance.shadowColor, equals: XCTUnwrap(colors.headerBorderColor), style: style) + } + } + + func testAutomaticWebViewBackgroundChangesWithTheSystemAppearance() async throws { + let controller = makeViewController(appearance: .app(.automatic( + lightColors: Colors(webViewBackground: .red), + darkColors: Colors(webViewBackground: .blue) + ))) + let window = makeWindow(controller: controller, style: .light) + defer { window.isHidden = true } + let checkoutView = try XCTUnwrap(checkoutController(of: controller).checkoutView) + controller.view.layoutIfNeeded() + + assertColor(checkoutView.underPageBackgroundColor, equals: .red) + + window.overrideUserInterfaceStyle = .dark + controller.view.layoutIfNeeded() + await Task.yield() + + assertColor(checkoutView.backgroundColor, equals: .blue, style: .dark) + assertColor(checkoutView.underPageBackgroundColor, equals: .blue, style: .dark) + + window.overrideUserInterfaceStyle = .light + controller.view.layoutIfNeeded() + await Task.yield() + + assertColor(checkoutView.backgroundColor, equals: .red) + assertColor(checkoutView.underPageBackgroundColor, equals: .red) + } + + func testAutomaticWebViewUsesDarkColorsWhenFirstAttachedToADarkWindow() throws { + let controller = makeViewController(appearance: .app(.automatic( + lightColors: Colors(webViewBackground: .red), + darkColors: Colors(webViewBackground: .blue) + ))) + let window = makeWindow(controller: controller, style: .dark) + defer { window.isHidden = true } + controller.view.layoutIfNeeded() + let checkoutView = try XCTUnwrap(checkoutController(of: controller).checkoutView) + + assertColor(checkoutView.underPageBackgroundColor, equals: .blue, style: .dark) + } + + func testWebViewBackgroundPreservesDynamicColorAccessibilityChanges() async throws { + guard #available(iOS 17.0, *) else { + throw XCTSkip("Trait overrides require iOS 17") + } + let backgroundColor = UIColor { traits in + traits.accessibilityContrast == .high ? .green : .red + } + let controller = makeViewController(appearance: .app(.light(colors: Colors(webViewBackground: backgroundColor)))) + let window = makeWindow(controller: controller, style: .light) + defer { window.isHidden = true } + window.traitOverrides.accessibilityContrast = .normal + controller.view.layoutIfNeeded() + let checkoutView = try XCTUnwrap(checkoutController(of: controller).checkoutView) + + assertColor(checkoutView.underPageBackgroundColor, equals: .red) + + window.traitOverrides.accessibilityContrast = .high + controller.view.layoutIfNeeded() + await Task.yield() + + assertColor(checkoutView.underPageBackgroundColor, equals: .green) + } + + func testStorefrontCanCustomizeNativeColorsAndPreserveTheTitle() throws { + ShopifyCheckoutKit.configure { $0.title = "Complete your order" } + let colors = makeColors(background: .purple) + let controller = makeViewController(appearance: .storefront(colors: colors)) + let checkoutController = try checkoutController(of: controller) + + XCTAssertEqual(checkoutController.title, "Complete your order") + XCTAssertEqual(controller.overrideUserInterfaceStyle, .light) + assertColor(checkoutController.checkoutView?.backgroundColor, equals: colors.webViewBackground) + assertColor(checkoutController.progressBar.progressBar.tintColor, equals: colors.progressIndicator) + } + + func testDefaultAppearancePreservesTransparentNavigationAndTheSystemCloseButton() throws { + let controller = makeViewController(appearance: .storefront()) + let checkoutController = try checkoutController(of: controller) + let closeButton = try XCTUnwrap(checkoutController.navigationItem.rightBarButtonItem) + + assertColor(controller.navigationBar.standardAppearance.backgroundColor, equals: .clear) + XCTAssertNil(controller.navigationBar.standardAppearance.backgroundEffect) + XCTAssertNil(controller.navigationBar.standardAppearance.shadowColor) + XCTAssertNil(closeButton.image) + XCTAssertEqual(closeButton.accessibilityIdentifier, "shopify_checkout_kit_close_button") + } + + func testCloseIconCanBeCustomizedIndependentlyOfItsTint() throws { + let icon = try XCTUnwrap(UIImage(systemName: "multiply")) + let controller = makeViewController(appearance: .storefront(colors: Colors(closeIcon: icon))) + let checkoutController = try checkoutController(of: controller) + let closeButton = try XCTUnwrap(checkoutController.navigationItem.rightBarButtonItem) + + XCTAssertEqual(closeButton.image, icon) + XCTAssertEqual(closeButton.accessibilityIdentifier, "shopify_checkout_kit_close_button") + } + + func testAutomaticCloseButtonSwitchesBetweenSystemAndCustomAppearance() async throws { + let icon = try XCTUnwrap(UIImage(systemName: "multiply")) + let controller = makeViewController(appearance: .app(.automatic( + darkColors: Colors(closeIcon: icon, closeIconTint: .red) + ))) + let window = makeWindow(controller: controller, style: .light) + defer { window.isHidden = true } + let checkoutController = try checkoutController(of: controller) + controller.view.layoutIfNeeded() + + XCTAssertNil(checkoutController.navigationItem.rightBarButtonItem?.image) + + window.overrideUserInterfaceStyle = .dark + controller.view.layoutIfNeeded() + await Task.yield() + + XCTAssertEqual(checkoutController.navigationItem.rightBarButtonItem?.image, icon) + assertColor(checkoutController.navigationItem.rightBarButtonItem?.tintColor, equals: .red, style: .dark) + + window.overrideUserInterfaceStyle = .light + controller.view.layoutIfNeeded() + await Task.yield() + + XCTAssertNil(checkoutController.navigationItem.rightBarButtonItem?.image) + } + + func testPresentedPreloadedWebViewUsesThePresentingConfigurationColors() throws { + ShopifyCheckoutKit.configure { $0.appearance = .app(.automatic(lightColors: Colors(webViewBackground: .red))) } + ShopifyCheckoutKit.preload(checkout: checkoutURL) + var configuration = ShopifyCheckoutKit.configuration + configuration.appearance = .app(.automatic(lightColors: Colors(webViewBackground: .blue))) + let decoratedURL = CheckoutURLDecorator.decorate(checkoutURL, configuration: configuration) + + let controller = CheckoutViewController(checkout: decoratedURL, configuration: configuration) + let checkoutView = try XCTUnwrap(checkoutController(of: controller).checkoutView) + + XCTAssertTrue(checkoutView === CheckoutWebView.preloadCache.view(for: PreloadKey(url: decoratedURL, entryPoint: nil))) + assertColor(checkoutView.backgroundColor, equals: .blue) + assertColor(checkoutView.underPageBackgroundColor, equals: .blue) + } + + private func makeViewController(appearance: CheckoutAppearance) -> CheckoutViewController { + ShopifyCheckoutKit.configure { $0.appearance = appearance } + return CheckoutViewController(checkout: checkoutURL) + } + + private func makeWindow(controller: CheckoutViewController, style: UIUserInterfaceStyle) -> UIWindow { + let window = UIWindow(frame: CGRect(x: 0, y: 0, width: 390, height: 844)) + window.overrideUserInterfaceStyle = style + window.rootViewController = controller + window.makeKeyAndVisible() + return window + } + + private func checkoutController(of controller: CheckoutViewController) throws -> CheckoutWebViewController { + try XCTUnwrap(controller.viewControllers.first as? CheckoutWebViewController) + } + + private func makeColors(background: UIColor, closeIconTint: UIColor? = nil) -> Colors { + Colors( + webViewBackground: background.withAlphaComponent(0.7), + headerBackground: background.withAlphaComponent(0.4), + headerFont: background, + progressIndicator: background, + closeIconTint: closeIconTint, + headerBorderColor: background + ) + } + + private func assertColor( + _ actual: UIColor?, + equals expected: UIColor, + style: UIUserInterfaceStyle = .light, + file: StaticString = #filePath, + line: UInt = #line + ) { + guard let actual else { + XCTFail("Expected a color", file: file, line: line) + return + } + let traits = UITraitCollection(userInterfaceStyle: style) + let actualComponents = components(of: actual.resolvedColor(with: traits)) + let expectedComponents = components(of: expected.resolvedColor(with: traits)) + for (actualComponent, expectedComponent) in zip(actualComponents, expectedComponents) { + XCTAssertEqual(actualComponent, expectedComponent, accuracy: 1.0 / 255.0, file: file, line: line) + } + } + + private func components(of color: UIColor) -> [CGFloat] { + var red: CGFloat = 0 + var green: CGFloat = 0 + var blue: CGFloat = 0 + var alpha: CGFloat = 0 + XCTAssertTrue(color.getRed(&red, green: &green, blue: &blue, alpha: &alpha)) + return [red, green, blue, alpha] + } +} diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutAppearanceTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutAppearanceTests.swift new file mode 100644 index 000000000..0a4cad9f3 --- /dev/null +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutAppearanceTests.swift @@ -0,0 +1,31 @@ +@testable import ShopifyCheckoutKit +import UIKit +import XCTest + +@MainActor +class CheckoutAppearanceTests: XCTestCase { + func testAppDefaultsToAutomatic() { + XCTAssertEqual(CheckoutAppearance.app().effectiveColorScheme, .automatic()) + } + + func testAppPreservesTheConfiguredSchemeAndColors() { + let scheme = ColorScheme.dark(colors: Colors(webViewBackground: .red)) + + XCTAssertEqual(CheckoutAppearance.app(scheme).effectiveColorScheme, scheme) + } + + func testStorefrontUsesLightNativeColors() { + XCTAssertEqual(CheckoutAppearance.storefront().effectiveColorScheme, .light()) + } + + func testStorefrontCanCustomizeNativeColorsWithoutBecomingAnAppAppearance() { + let colors = Colors().customize { + $0.progressIndicator = .red + $0.closeIconTint = .blue + } + let appearance = CheckoutAppearance.storefront(colors: colors) + + XCTAssertEqual(appearance.effectiveColorScheme, .light(colors: colors)) + XCTAssertNotEqual(appearance, .app(.light(colors: colors))) + } +} diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutURLDecoratorTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutURLDecoratorTests.swift index 7221c2e2c..2b4a895db 100644 --- a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutURLDecoratorTests.swift +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutURLDecoratorTests.swift @@ -9,7 +9,7 @@ import Testing struct CheckoutURLDecoratorTests { @Test func appendsAppAppearanceAndBranding() throws { var configuration = Configuration() - configuration.appearance = .app(.dark) + configuration.appearance = .app(.dark()) let url = try #require(URL(string: "https://shop.com/cart/c/abc?key=cart_token")) let items = queryItems(CheckoutURLDecorator.decorate(url, configuration: configuration)) @@ -21,7 +21,7 @@ struct CheckoutURLDecoratorTests { @Test func replacesCallerSuppliedVersionAndBrandingAndIsIdempotent() throws { var configuration = Configuration() - configuration.appearance = .app(.light) + configuration.appearance = .app(.light()) let url = try #require(URL(string: "https://shop.com/cart/c/abc?ec_version=caller-supplied&ck_branding=app&ec_color_scheme=dark")) let once = CheckoutURLDecorator.decorate(url, configuration: configuration) @@ -34,14 +34,19 @@ struct CheckoutURLDecoratorTests { } @Test func derivesCheckoutParamsForEachAppearance() throws { - try assertAppearanceDecoratesWith(.app(.light), colorScheme: "light", branding: "app") - try assertAppearanceDecoratesWith(.app(.dark), colorScheme: "dark", branding: "app") - try assertAppearanceDecoratesWith(.app(.automatic), colorScheme: "automatic", branding: "app") - try assertAppearanceDecoratesWith(.storefront, colorScheme: "light", branding: "shop") + try assertAppearanceDecoratesWith(.app(.light()), colorScheme: "light", branding: "app") + try assertAppearanceDecoratesWith(.app(.dark()), colorScheme: "dark", branding: "app") + try assertAppearanceDecoratesWith(.app(.automatic()), colorScheme: "automatic", branding: "app") + try assertAppearanceDecoratesWith(.storefront(), colorScheme: "light", branding: "shop") + } + + @Test func nativeColorOverridesDoNotChangeCheckoutBranding() throws { + try assertAppearanceDecoratesWith(.app(.automatic().customize { $0.webViewBackground = .red }), colorScheme: "automatic", branding: "app") + try assertAppearanceDecoratesWith(.storefront(colors: Colors(webViewBackground: .red)), colorScheme: "light", branding: "shop") } private func assertAppearanceDecoratesWith( - _ appearance: Configuration.Appearance, + _ appearance: CheckoutAppearance, colorScheme expectedColorScheme: String, branding expectedBranding: String ) throws { diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutViewControllerTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutViewControllerTests.swift index de124d5c6..0a389dbf6 100644 --- a/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutViewControllerTests.swift +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/CheckoutViewControllerTests.swift @@ -13,6 +13,7 @@ class CheckoutViewDelegateTests: XCTestCase { override func setUp() async throws { try await super.setUp() + ShopifyCheckoutKit.configure { $0 = Configuration() } ShopifyCheckoutKit.configure { $0.title = customTitle ?? "Checkout" } @@ -25,6 +26,7 @@ class CheckoutViewDelegateTests: XCTestCase { override func tearDown() async throws { customTitle = nil + ShopifyCheckoutKit.configure { $0 = Configuration() } try await super.tearDown() } @@ -42,7 +44,7 @@ class CheckoutViewDelegateTests: XCTestCase { ] for appearance in appearances { - XCTAssertNil(appearance?.backgroundColor) + XCTAssertEqual(appearance?.backgroundColor?.resolvedColor(with: UITraitCollection(userInterfaceStyle: .light)), .clear) XCTAssertNil(appearance?.backgroundEffect) } } @@ -58,10 +60,12 @@ class CheckoutViewDelegateTests: XCTestCase { func testInstanceConfigurationIsAppliedToCheckoutChrome() throws { var configuration = Configuration() - configuration.backgroundColor = .red - configuration.tintColor = .blue + configuration.appearance = .app(.light(colors: Colors( + webViewBackground: .red, + progressIndicator: .blue, + closeIconTint: .green + ))) configuration.title = "Instance checkout" - configuration.closeButtonTintColor = .green let controller = MockCheckoutWebViewController( checkoutURL: checkoutURL, @@ -137,8 +141,8 @@ class CheckoutViewDelegateTests: XCTestCase { XCTAssertFalse(viewController.progressBar.isHidden) } - func testCloseButtonUsesSystemDefaultWhenTintColorIsNil() { - ShopifyCheckoutKit.configure { $0.closeButtonTintColor = nil } + func testCloseButtonUsesSystemDefaultWhenCloseIconTintIsNil() { + ShopifyCheckoutKit.configure { $0.appearance = .storefront() } let controller = MockCheckoutWebViewController(checkoutURL: checkoutURL) let closeButton = controller.navigationItem.rightBarButtonItem @@ -148,9 +152,9 @@ class CheckoutViewDelegateTests: XCTestCase { XCTAssertEqual(closeButton?.accessibilityIdentifier, expectedCloseButtonIdentifier) } - func testCloseButtonUsesCustomImageAndTintWhenColorIsSet() { + func testCloseButtonUsesCustomImageAndTintWhenCloseIconTintIsSet() { let customColor = UIColor.red - ShopifyCheckoutKit.configure { $0.closeButtonTintColor = customColor } + ShopifyCheckoutKit.configure { $0.appearance = .storefront(colors: Colors(closeIconTint: customColor)) } let controller = MockCheckoutWebViewController(checkoutURL: checkoutURL) let closeButton = controller.navigationItem.rightBarButtonItem @@ -161,8 +165,8 @@ class CheckoutViewDelegateTests: XCTestCase { XCTAssertEqual(closeButton?.accessibilityIdentifier, expectedCloseButtonIdentifier) } - func testCloseButtonImageIsXMarkCircleFill() { - ShopifyCheckoutKit.configure { $0.closeButtonTintColor = .blue } + func testCloseButtonHasAnImageWhenCloseIconTintIsSet() { + ShopifyCheckoutKit.configure { $0.appearance = .storefront(colors: Colors(closeIconTint: .blue)) } let controller = MockCheckoutWebViewController(checkoutURL: checkoutURL) let closeButton = controller.navigationItem.rightBarButtonItem diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/ColorSchemeTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/ColorSchemeTests.swift new file mode 100644 index 000000000..8ccccaf1e --- /dev/null +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/ColorSchemeTests.swift @@ -0,0 +1,138 @@ +@testable import ShopifyCheckoutKit +import UIKit +import XCTest + +@MainActor +class ColorSchemeTests: XCTestCase { + func testExplicitSchemesKeepTheirPaletteRegardlessOfSystemPreference() { + let colors = makeColors(background: .red) + + for scheme in [ColorScheme.light(colors: colors), .dark(colors: colors)] { + XCTAssertEqual(scheme.colors(isDark: false), colors) + XCTAssertEqual(scheme.colors(isDark: true), colors) + } + } + + func testAutomaticSelectsIndependentLightAndDarkPalettes() { + let lightColors = makeColors(background: .white) + let darkColors = makeColors(background: .black) + let scheme = ColorScheme.automatic(lightColors: lightColors, darkColors: darkColors) + + XCTAssertEqual(scheme.colors(isDark: false), lightColors) + XCTAssertEqual(scheme.colors(isDark: true), darkColors) + } + + func testDefaultPalettesPreserveNativeIosColors() { + XCTAssertEqual(ColorScheme.light().colors(isDark: false), Colors()) + XCTAssertEqual(ColorScheme.dark().colors(isDark: true), Colors()) + XCTAssertEqual(ColorScheme.automatic().colors(isDark: false), Colors()) + XCTAssertEqual(ColorScheme.automatic().colors(isDark: true), Colors()) + } + + func testIdentifiersDoNotDependOnCustomColors() { + let colors = makeColors(background: .red) + + XCTAssertEqual(ColorScheme.light(colors: colors).id, "light") + XCTAssertEqual(ColorScheme.dark(colors: colors).id, "dark") + XCTAssertEqual(ColorScheme.automatic(lightColors: colors, darkColors: colors).id, "automatic") + } + + func testCustomizePreservesExplicitSchemeAndOriginalPalette() { + let original = ColorScheme.dark() + + let customized = original.customize { + $0.closeIconTint = .red + } + + XCTAssertEqual(customized.id, original.id) + XCTAssertNil(original.colors(isDark: true).closeIconTint) + XCTAssertEqual(customized.colors(isDark: true).closeIconTint, .red) + XCTAssertEqual(customized.colors(isDark: true).webViewBackground, original.colors(isDark: true).webViewBackground) + } + + func testCustomizeAppliesSharedOverridesToBothAutomaticPalettes() { + let original = ColorScheme.automatic( + lightColors: makeColors(background: .white), + darkColors: makeColors(background: .black) + ) + + let customized = original.customize { + $0.closeIconTint = .red + } + + XCTAssertNil(original.colors(isDark: false).closeIconTint) + XCTAssertNil(original.colors(isDark: true).closeIconTint) + XCTAssertEqual(customized.colors(isDark: false).closeIconTint, .red) + XCTAssertEqual(customized.colors(isDark: true).closeIconTint, .red) + XCTAssertEqual(customized.colors(isDark: false).webViewBackground, .white) + XCTAssertEqual(customized.colors(isDark: true).webViewBackground, .black) + } + + func testCustomizeSupportsIndependentAutomaticOverrides() { + let original = ColorScheme.automatic() + + let customized = original.customize( + light: { $0.closeIconTint = .red }, + dark: { $0.closeIconTint = .blue } + ) + + XCTAssertEqual(customized.colors(isDark: false).closeIconTint, .red) + XCTAssertEqual(customized.colors(isDark: true).closeIconTint, .blue) + XCTAssertEqual(original, .automatic()) + } + + func testAutomaticColorsResolveUsingTheCurrentSystemStyle() { + let scheme = ColorScheme.automatic( + lightColors: makeColors(background: .red), + darkColors: makeColors(background: .blue) + ) + let color = scheme.color { $0.webViewBackground } + + XCTAssertEqual(color.resolvedColor(with: UITraitCollection(userInterfaceStyle: .light)), .red) + XCTAssertEqual(color.resolvedColor(with: UITraitCollection(userInterfaceStyle: .dark)), .blue) + } + + func testExplicitSchemesResolveDynamicColorsUsingTheirOwnStyle() { + let dynamicColor = UIColor { traits in + traits.userInterfaceStyle == .dark ? .blue : .red + } + let colors = makeColors(background: dynamicColor) + let lightColor = ColorScheme.light(colors: colors).color { $0.webViewBackground } + let darkColor = ColorScheme.dark(colors: colors).color { $0.webViewBackground } + + XCTAssertEqual(lightColor.resolvedColor(with: UITraitCollection(userInterfaceStyle: .dark)), .red) + XCTAssertEqual(darkColor.resolvedColor(with: UITraitCollection(userInterfaceStyle: .light)), .blue) + } + + func testExplicitSchemesPreserveAccessibilityTraitsWhenResolvingColors() { + let dynamicColor = UIColor { traits in + traits.accessibilityContrast == .high ? .green : .red + } + let scheme = ColorScheme.dark(colors: makeColors(background: dynamicColor)) + let color = scheme.color { $0.webViewBackground } + let traits = UITraitCollection(traitsFrom: [ + UITraitCollection(userInterfaceStyle: .light), + UITraitCollection(accessibilityContrast: .high) + ]) + + XCTAssertEqual(color.resolvedColor(with: traits), .green) + } + + func testOptionalColorsRemainNilWhenBothPalettesUseTheSystemDefault() { + let scheme = ColorScheme.automatic() + + XCTAssertNil(scheme.optionalColor { $0.headerBorderColor }) + } + + func testOptionalColorsCanDifferBetweenAutomaticPalettes() throws { + let scheme = ColorScheme.automatic(darkColors: Colors(headerBorderColor: .blue)) + let color = try XCTUnwrap(scheme.optionalColor { $0.headerBorderColor }) + + XCTAssertEqual(color.resolvedColor(with: UITraitCollection(userInterfaceStyle: .light)), .clear) + XCTAssertEqual(color.resolvedColor(with: UITraitCollection(userInterfaceStyle: .dark)), .blue) + } + + private func makeColors(background: UIColor) -> Colors { + Colors(webViewBackground: background) + } +} diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/ColorsTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/ColorsTests.swift new file mode 100644 index 000000000..10f025435 --- /dev/null +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/ColorsTests.swift @@ -0,0 +1,65 @@ +@testable import ShopifyCheckoutKit +import UIKit +import XCTest + +@MainActor +class ColorsTests: XCTestCase { + func testDefaultsPreserveNativeIosColorsAndControls() { + let colors = Colors() + + XCTAssertEqual(colors.webViewBackground, .systemBackground) + XCTAssertEqual(colors.headerBackground, .clear) + XCTAssertEqual(colors.headerFont, .label) + XCTAssertEqual(colors.progressIndicator, UIColor(red: 0.09, green: 0.45, blue: 0.69, alpha: 1)) + XCTAssertNil(colors.closeIcon) + XCTAssertNil(colors.closeIconTint) + XCTAssertNil(colors.headerBorderColor) + } + + func testCustomizeReturnsACopyAndPreservesUnspecifiedColors() { + let original = Colors() + + let customized = original.customize { + $0.webViewBackground = .red + } + + XCTAssertEqual(original.webViewBackground, .systemBackground) + XCTAssertEqual(customized.webViewBackground, .red) + XCTAssertEqual(customized.headerBackground, original.headerBackground) + XCTAssertEqual(customized.headerFont, original.headerFont) + XCTAssertEqual(customized.progressIndicator, original.progressIndicator) + } + + func testCustomizeCanRestoreSystemCloseButtonAndBorderDefaults() { + let original = Colors( + closeIcon: UIImage(systemName: "multiply"), + closeIconTint: .red, + headerBorderColor: .blue + ) + + let customized = original.customize { + $0.closeIcon = nil + $0.closeIconTint = nil + $0.headerBorderColor = nil + } + + XCTAssertNotNil(original.closeIcon) + XCTAssertEqual(original.closeIconTint, .red) + XCTAssertNil(customized.closeIcon) + XCTAssertNil(customized.closeIconTint) + XCTAssertNil(customized.headerBorderColor) + } + + func testColorsPreserveUIKitDynamicColorsAndTransparency() { + let lightColor = UIColor.red.withAlphaComponent(0.4) + let darkColor = UIColor.blue.withAlphaComponent(0.7) + let dynamicColor = UIColor { traits in + traits.userInterfaceStyle == .dark ? darkColor : lightColor + } + let colors = Colors(webViewBackground: dynamicColor) + + XCTAssertEqual(colors.webViewBackground, dynamicColor) + XCTAssertEqual(colors.webViewBackground.resolvedColor(with: UITraitCollection(userInterfaceStyle: .light)), lightColor) + XCTAssertEqual(colors.webViewBackground.resolvedColor(with: UITraitCollection(userInterfaceStyle: .dark)), darkColor) + } +} diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/ConfigurationTests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/ConfigurationTests.swift index d105c5d36..473e80dc2 100644 --- a/platforms/swift/Tests/ShopifyCheckoutKitTests/ConfigurationTests.swift +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/ConfigurationTests.swift @@ -19,23 +19,27 @@ class ConfigurationTests: XCTestCase { CheckoutWebView.invalidate() } - func testCloseButtonTintColorDefaultsToNil() { - XCTAssertNil(ShopifyCheckoutKit.configuration.closeButtonTintColor) + func testCloseIconTintDefaultsToNil() { + XCTAssertNil(checkoutColors().closeIconTint) } - func testCloseButtonTintColorCanBeSet() { - let customColor = UIColor.red - ShopifyCheckoutKit.configure { $0.closeButtonTintColor = customColor } + func testCloseIconTintCanBeSetOnTheAppearance() { + ShopifyCheckoutKit.configure { $0.appearance = .storefront(colors: Colors(closeIconTint: .red)) } - XCTAssertEqual(ShopifyCheckoutKit.configuration.closeButtonTintColor, customColor) + XCTAssertEqual(checkoutColors().closeIconTint, .red) } - func testCloseButtonTintColorCanBeReset() { - ShopifyCheckoutKit.configure { $0.closeButtonTintColor = .blue } - XCTAssertNotNil(ShopifyCheckoutKit.configuration.closeButtonTintColor) + func testReplacingAppearanceRestoresDefaultColors() { + ShopifyCheckoutKit.configure { $0.appearance = .app(.dark(colors: Colors( + webViewBackground: .red, + progressIndicator: .green, + closeIconTint: .blue + ))) } - ShopifyCheckoutKit.configure { $0.closeButtonTintColor = nil } - XCTAssertNil(ShopifyCheckoutKit.configuration.closeButtonTintColor) + ShopifyCheckoutKit.configure { $0.appearance = .app(.automatic()) } + + XCTAssertEqual(checkoutColors(isDark: false), Colors()) + XCTAssertEqual(checkoutColors(isDark: true), Colors()) } func testPreloadingDefaultsToEnabled() { @@ -43,7 +47,7 @@ class ConfigurationTests: XCTestCase { } func testAppearanceDefaultsToStorefront() { - XCTAssertEqual(ShopifyCheckoutKit.configuration.appearance, .storefront) + XCTAssertEqual(ShopifyCheckoutKit.configuration.appearance, .storefront()) } func testAllowedMessageOriginsDefaultsToEmpty() { @@ -95,13 +99,50 @@ class ConfigurationTests: XCTestCase { } func testConfigureCanBatchConfigurationChanges() { + let appearance = CheckoutAppearance.app(.dark(colors: Colors(closeIconTint: .blue))) + + ShopifyCheckoutKit.configure { + $0.appearance = appearance + $0.title = "Complete your order" + } + + XCTAssertEqual(ShopifyCheckoutKit.configuration.appearance, appearance) + XCTAssertEqual(ShopifyCheckoutKit.configuration.title, "Complete your order") + } + + func testUnrelatedConfigurationUpdatesPreserveAppearanceAndColors() { + let appearance = CheckoutAppearance.app(.dark(colors: Colors( + webViewBackground: .red, + progressIndicator: .green, + closeIconTint: .blue + ))) + ShopifyCheckoutKit.configure { $0.appearance = appearance } + + ShopifyCheckoutKit.configure { + $0.title = "Complete your order" + $0.logLevel = .debug + $0.preloading.enabled = false + } + + XCTAssertEqual(ShopifyCheckoutKit.configuration.appearance, appearance) + } + + func testAppearanceUpdatesPreserveIosSpecificConfiguration() { ShopifyCheckoutKit.configure { - $0.appearance = .app(.dark) - $0.closeButtonTintColor = .blue + $0.title = "Complete your order" + $0.confetti.enabled = true } - XCTAssertEqual(ShopifyCheckoutKit.configuration.appearance, .app(.dark)) - XCTAssertEqual(ShopifyCheckoutKit.configuration.closeButtonTintColor, .blue) + ShopifyCheckoutKit.configure { + $0.appearance = .storefront(colors: Colors(closeIconTint: .red)) + } + + XCTAssertEqual(ShopifyCheckoutKit.configuration.title, "Complete your order") + XCTAssertTrue(ShopifyCheckoutKit.configuration.confetti.enabled) + } + + private func checkoutColors(isDark: Bool = false) -> Colors { + ShopifyCheckoutKit.configuration.appearance.effectiveColorScheme.colors(isDark: isDark) } func testConfigureUpdatesLogger() { diff --git a/platforms/swift/Tests/ShopifyCheckoutKitTests/SwiftUITests.swift b/platforms/swift/Tests/ShopifyCheckoutKitTests/SwiftUITests.swift index 03b5e269c..a0bcb74d3 100644 --- a/platforms/swift/Tests/ShopifyCheckoutKitTests/SwiftUITests.swift +++ b/platforms/swift/Tests/ShopifyCheckoutKitTests/SwiftUITests.swift @@ -101,20 +101,9 @@ class CheckoutConfigurableTests: XCTestCase { try await super.tearDown() } - func testBackgroundColorIsCapturedWithoutChangingGlobalConfiguration() { - let globalColor = ShopifyCheckoutKit.configuration.backgroundColor - let color = UIColor.red - - let sheet = shopifyCheckout.backgroundColor(color) - - XCTAssertEqual(sheet.configuration.backgroundColor, color) - XCTAssertEqual(shopifyCheckout.configuration.backgroundColor, globalColor) - XCTAssertEqual(ShopifyCheckoutKit.configuration.backgroundColor, globalColor) - } - func testAppearanceIsCapturedWithoutChangingGlobalConfiguration() { let globalAppearance = ShopifyCheckoutKit.configuration.appearance - let appearance = ShopifyCheckoutKit.Configuration.Appearance.app(.light) + let appearance = CheckoutAppearance.app(.light()) let sheet = shopifyCheckout.appearance(appearance) @@ -124,22 +113,21 @@ class CheckoutConfigurableTests: XCTestCase { } func testAppearanceDecoratesCheckoutURLFromCapturedConfiguration() throws { - let sheet = shopifyCheckout.appearance(.app(.dark)) + let sheet = shopifyCheckout.appearance(.app(.dark())) let items = try XCTUnwrap(URLComponents(url: sheet.decoratedCheckoutURL, resolvingAgainstBaseURL: false)?.queryItems) XCTAssertEqual(items.first(where: { $0.name == "ec_color_scheme" })?.value, "dark") XCTAssertEqual(items.first(where: { $0.name == "ck_branding" })?.value, "app") } - func testTintColorIsCapturedWithoutChangingGlobalConfiguration() { - let globalColor = ShopifyCheckoutKit.configuration.tintColor - let color = UIColor.blue + func testAppearanceColorsAreCapturedWithoutChangingGlobalConfiguration() { + let globalAppearance = ShopifyCheckoutKit.configuration.appearance + let colors = Colors(webViewBackground: .red, progressIndicator: .blue, closeIconTint: .green) - let sheet = shopifyCheckout.tintColor(color) + let sheet = shopifyCheckout.appearance(.app(.light(colors: colors))) - XCTAssertEqual(sheet.configuration.tintColor, color) - XCTAssertEqual(shopifyCheckout.configuration.tintColor, globalColor) - XCTAssertEqual(ShopifyCheckoutKit.configuration.tintColor, globalColor) + XCTAssertEqual(sheet.configuration.appearance.effectiveColorScheme.colors(isDark: false), colors) + XCTAssertEqual(ShopifyCheckoutKit.configuration.appearance, globalAppearance) } func testTitleIsCapturedWithoutChangingGlobalConfiguration() { @@ -153,36 +141,13 @@ class CheckoutConfigurableTests: XCTestCase { XCTAssertEqual(ShopifyCheckoutKit.configuration.title, globalTitle) } - func testCloseButtonTintColorIsCapturedWithoutChangingGlobalConfiguration() { - let globalColor = ShopifyCheckoutKit.configuration.closeButtonTintColor - let color = UIColor.green - - let sheet = shopifyCheckout.closeButtonTintColor(color) - - XCTAssertEqual(sheet.configuration.closeButtonTintColor, color) - XCTAssertEqual(shopifyCheckout.configuration.closeButtonTintColor, globalColor) - XCTAssertEqual(ShopifyCheckoutKit.configuration.closeButtonTintColor, globalColor) - } - - func testCloseButtonTintColorCanBeClearedOnInstance() { - let sheet = shopifyCheckout - .closeButtonTintColor(.green) - .closeButtonTintColor(nil) - - XCTAssertNil(sheet.configuration.closeButtonTintColor) - XCTAssertNil(ShopifyCheckoutKit.configuration.closeButtonTintColor) - } - func testModifiersDoNotInvalidatePreload() { ShopifyCheckoutKit.preload(checkout: checkoutURL) XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) _ = shopifyCheckout - .backgroundColor(.red) - .appearance(.app(.dark)) - .tintColor(.blue) + .appearance(.app(.dark(colors: Colors(webViewBackground: .red)))) .title("Instance checkout") - .closeButtonTintColor(.green) XCTAssertTrue(CheckoutWebView.preloadCache.hasEntry()) } diff --git a/platforms/swift/api/ShopifyCheckoutKit.json b/platforms/swift/api/ShopifyCheckoutKit.json index 3cd34cffa..f47ac1354 100644 --- a/platforms/swift/api/ShopifyCheckoutKit.json +++ b/platforms/swift/api/ShopifyCheckoutKit.json @@ -2306,6 +2306,197 @@ } ] }, + { + "kind": "TypeDecl", + "name": "CheckoutAppearance", + "printedName": "CheckoutAppearance", + "children": [ + { + "kind": "Var", + "name": "app", + "printedName": "app", + "children": [ + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(ShopifyCheckoutKit.CheckoutAppearance.Type) -> (ShopifyCheckoutKit.ColorScheme) -> ShopifyCheckoutKit.CheckoutAppearance", + "children": [ + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(ShopifyCheckoutKit.ColorScheme) -> ShopifyCheckoutKit.CheckoutAppearance", + "children": [ + { + "kind": "TypeNominal", + "name": "CheckoutAppearance", + "printedName": "ShopifyCheckoutKit.CheckoutAppearance", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO" + }, + { + "kind": "TypeNominal", + "name": "ColorScheme", + "printedName": "ShopifyCheckoutKit.ColorScheme", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO" + } + ] + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "ShopifyCheckoutKit.CheckoutAppearance.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "CheckoutAppearance", + "printedName": "ShopifyCheckoutKit.CheckoutAppearance", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO" + } + ] + } + ] + } + ], + "declKind": "EnumElement", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO3appyAcA11ColorSchemeOcACmF", + "mangledName": "$s18ShopifyCheckoutKit0B10AppearanceO3appyAcA11ColorSchemeOcACmF", + "moduleName": "ShopifyCheckoutKit" + }, + { + "kind": "Var", + "name": "storefront", + "printedName": "storefront", + "children": [ + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(ShopifyCheckoutKit.CheckoutAppearance.Type) -> (ShopifyCheckoutKit.Colors) -> ShopifyCheckoutKit.CheckoutAppearance", + "children": [ + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(ShopifyCheckoutKit.Colors) -> ShopifyCheckoutKit.CheckoutAppearance", + "children": [ + { + "kind": "TypeNominal", + "name": "CheckoutAppearance", + "printedName": "ShopifyCheckoutKit.CheckoutAppearance", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO" + }, + { + "kind": "TypeNominal", + "name": "Tuple", + "printedName": "(colors: ShopifyCheckoutKit.Colors)", + "children": [ + { + "kind": "TypeNominal", + "name": "Colors", + "printedName": "ShopifyCheckoutKit.Colors", + "usr": "s:18ShopifyCheckoutKit6ColorsV" + } + ] + } + ] + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "ShopifyCheckoutKit.CheckoutAppearance.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "CheckoutAppearance", + "printedName": "ShopifyCheckoutKit.CheckoutAppearance", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO" + } + ] + } + ] + } + ], + "declKind": "EnumElement", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO10storefrontyAcA6ColorsV_tcACmF", + "mangledName": "$s18ShopifyCheckoutKit0B10AppearanceO10storefrontyAcA6ColorsV_tcACmF", + "moduleName": "ShopifyCheckoutKit" + }, + { + "kind": "Function", + "name": "__derived_enum_equals", + "printedName": "__derived_enum_equals(_:_:)", + "children": [ + { + "kind": "TypeNominal", + "name": "Bool", + "printedName": "Swift.Bool", + "usr": "s:Sb" + }, + { + "kind": "TypeNominal", + "name": "CheckoutAppearance", + "printedName": "ShopifyCheckoutKit.CheckoutAppearance", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO" + }, + { + "kind": "TypeNominal", + "name": "CheckoutAppearance", + "printedName": "ShopifyCheckoutKit.CheckoutAppearance", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO" + } + ], + "declKind": "Func", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO21__derived_enum_equalsySbAC_ACtFZ", + "mangledName": "$s18ShopifyCheckoutKit0B10AppearanceO21__derived_enum_equalsySbAC_ACtFZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "implicit": true, + "declAttributes": [ + "Implements" + ], + "funcSelfKind": "NonMutating" + } + ], + "declKind": "Enum", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO", + "mangledName": "$s18ShopifyCheckoutKit0B10AppearanceO", + "moduleName": "ShopifyCheckoutKit", + "isEnumExhaustive": true, + "conformances": [ + { + "kind": "Conformance", + "name": "Equatable", + "printedName": "Equatable", + "usr": "s:SQ", + "mangledName": "$sSQ" + }, + { + "kind": "Conformance", + "name": "Sendable", + "printedName": "Sendable", + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" + }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + }, + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + } + ] + }, { "kind": "TypeDecl", "name": "CheckoutCommunicationProtocol", @@ -2553,14 +2744,14 @@ }, { "kind": "TypeNominal", - "name": "Appearance", - "printedName": "ShopifyCheckoutKit.Configuration.Appearance", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO" + "name": "CheckoutAppearance", + "printedName": "ShopifyCheckoutKit.CheckoutAppearance", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO" } ], "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit0B12ConfigurableP10appearanceyxAA13ConfigurationV10AppearanceOF", - "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurableP10appearanceyxAA13ConfigurationV10AppearanceOF", + "usr": "s:18ShopifyCheckoutKit0B12ConfigurableP10appearanceyxAA0B10AppearanceOF", + "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurableP10appearanceyxAA0B10AppearanceOF", "moduleName": "ShopifyCheckoutKit", "genericSig": "", "protocolReq": true, @@ -2582,14 +2773,14 @@ }, { "kind": "TypeNominal", - "name": "Appearance", - "printedName": "ShopifyCheckoutKit.Configuration.Appearance", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO" + "name": "CheckoutAppearance", + "printedName": "ShopifyCheckoutKit.CheckoutAppearance", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO" } ], "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit0B12ConfigurablePAAE10appearanceyxAA13ConfigurationV10AppearanceOF", - "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurablePAAE10appearanceyxAA13ConfigurationV10AppearanceOF", + "usr": "s:18ShopifyCheckoutKit0B12ConfigurablePAAE10appearanceyxAA0B10AppearanceOF", + "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurablePAAE10appearanceyxAA0B10AppearanceOF", "moduleName": "ShopifyCheckoutKit", "genericSig": "", "declAttributes": [ @@ -2601,8 +2792,8 @@ }, { "kind": "Function", - "name": "backgroundColor", - "printedName": "backgroundColor(_:)", + "name": "title", + "printedName": "title(_:)", "children": [ { "kind": "TypeNominal", @@ -2611,14 +2802,14 @@ }, { "kind": "TypeNominal", - "name": "UIColor", - "printedName": "UIKit.UIColor", - "usr": "c:objc(cs)UIColor" + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" } ], "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit0B12ConfigurableP15backgroundColoryxSo7UIColorCF", - "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurableP15backgroundColoryxSo7UIColorCF", + "usr": "s:18ShopifyCheckoutKit0B12ConfigurableP5titleyxSSF", + "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurableP5titleyxSSF", "moduleName": "ShopifyCheckoutKit", "genericSig": "", "protocolReq": true, @@ -2630,8 +2821,8 @@ }, { "kind": "Function", - "name": "backgroundColor", - "printedName": "backgroundColor(_:)", + "name": "title", + "printedName": "title(_:)", "children": [ { "kind": "TypeNominal", @@ -2640,14 +2831,14 @@ }, { "kind": "TypeNominal", - "name": "UIColor", - "printedName": "UIKit.UIColor", - "usr": "c:objc(cs)UIColor" + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" } ], "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit0B12ConfigurablePAAE15backgroundColoryxSo7UIColorCF", - "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurablePAAE15backgroundColoryxSo7UIColorCF", + "usr": "s:18ShopifyCheckoutKit0B12ConfigurablePAAE5titleyxSSF", + "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurablePAAE5titleyxSSF", "moduleName": "ShopifyCheckoutKit", "genericSig": "", "declAttributes": [ @@ -2656,37 +2847,60 @@ ], "isFromExtension": true, "funcSelfKind": "NonMutating" + } + ], + "declKind": "Protocol", + "usr": "s:18ShopifyCheckoutKit0B12ConfigurableP", + "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurableP", + "moduleName": "ShopifyCheckoutKit", + "declAttributes": [ + "Custom" + ], + "conformances": [ + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" }, + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + } + ] + }, + { + "kind": "TypeDecl", + "name": "CheckoutDelegate", + "printedName": "CheckoutDelegate", + "children": [ { "kind": "Function", - "name": "closeButtonTintColor", - "printedName": "closeButtonTintColor(_:)", + "name": "checkoutAction", + "printedName": "checkoutAction(for:)", "children": [ { "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "Self" + "name": "CheckoutLinkAction", + "printedName": "ShopifyCheckoutKit.CheckoutLinkAction", + "usr": "s:18ShopifyCheckoutKit0B10LinkActionO" }, { "kind": "TypeNominal", - "name": "Optional", - "printedName": "UIKit.UIColor?", - "children": [ - { - "kind": "TypeNominal", - "name": "UIColor", - "printedName": "UIKit.UIColor", - "usr": "c:objc(cs)UIColor" - } - ], - "usr": "s:Sq" + "name": "CheckoutLink", + "printedName": "ShopifyCheckoutKit.CheckoutLink", + "usr": "s:18ShopifyCheckoutKit0B4LinkV" } ], "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit0B12ConfigurableP20closeButtonTintColoryxSo7UIColorCSgF", - "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurableP20closeButtonTintColoryxSo7UIColorCSgF", + "usr": "s:18ShopifyCheckoutKit0B8DelegateP14checkoutAction3forAA0b4LinkF0OAA0bH0V_tF", + "mangledName": "$s18ShopifyCheckoutKit0B8DelegateP14checkoutAction3forAA0b4LinkF0OAA0bH0V_tF", "moduleName": "ShopifyCheckoutKit", - "genericSig": "", + "genericSig": "", "protocolReq": true, "declAttributes": [ "Custom" @@ -2696,36 +2910,28 @@ }, { "kind": "Function", - "name": "closeButtonTintColor", - "printedName": "closeButtonTintColor(_:)", + "name": "checkoutAction", + "printedName": "checkoutAction(for:)", "children": [ { "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "Self" + "name": "CheckoutLinkAction", + "printedName": "ShopifyCheckoutKit.CheckoutLinkAction", + "usr": "s:18ShopifyCheckoutKit0B10LinkActionO" }, { "kind": "TypeNominal", - "name": "Optional", - "printedName": "UIKit.UIColor?", - "children": [ - { - "kind": "TypeNominal", - "name": "UIColor", - "printedName": "UIKit.UIColor", - "usr": "c:objc(cs)UIColor" - } - ], - "usr": "s:Sq" + "name": "CheckoutLink", + "printedName": "ShopifyCheckoutKit.CheckoutLink", + "usr": "s:18ShopifyCheckoutKit0B4LinkV" } ], "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit0B12ConfigurablePAAE20closeButtonTintColoryxSo7UIColorCSgF", - "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurablePAAE20closeButtonTintColoryxSo7UIColorCSgF", + "usr": "s:18ShopifyCheckoutKit0B8DelegatePAAE14checkoutAction3forAA0b4LinkF0OAA0bH0V_tF", + "mangledName": "$s18ShopifyCheckoutKit0B8DelegatePAAE14checkoutAction3forAA0b4LinkF0OAA0bH0V_tF", "moduleName": "ShopifyCheckoutKit", - "genericSig": "", + "genericSig": "", "declAttributes": [ - "DiscardableResult", "Custom" ], "isFromExtension": true, @@ -2733,218 +2939,13 @@ }, { "kind": "Function", - "name": "tintColor", - "printedName": "tintColor(_:)", + "name": "checkoutDidComplete", + "printedName": "checkoutDidComplete(_:)", "children": [ { "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "Self" - }, - { - "kind": "TypeNominal", - "name": "UIColor", - "printedName": "UIKit.UIColor", - "usr": "c:objc(cs)UIColor" - } - ], - "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit0B12ConfigurableP9tintColoryxSo7UIColorCF", - "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurableP9tintColoryxSo7UIColorCF", - "moduleName": "ShopifyCheckoutKit", - "genericSig": "", - "protocolReq": true, - "declAttributes": [ - "Custom" - ], - "reqNewWitnessTableEntry": true, - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "tintColor", - "printedName": "tintColor(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "Self" - }, - { - "kind": "TypeNominal", - "name": "UIColor", - "printedName": "UIKit.UIColor", - "usr": "c:objc(cs)UIColor" - } - ], - "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit0B12ConfigurablePAAE9tintColoryxSo7UIColorCF", - "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurablePAAE9tintColoryxSo7UIColorCF", - "moduleName": "ShopifyCheckoutKit", - "genericSig": "", - "declAttributes": [ - "DiscardableResult", - "Custom" - ], - "isFromExtension": true, - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "title", - "printedName": "title(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "Self" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit0B12ConfigurableP5titleyxSSF", - "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurableP5titleyxSSF", - "moduleName": "ShopifyCheckoutKit", - "genericSig": "", - "protocolReq": true, - "declAttributes": [ - "Custom" - ], - "reqNewWitnessTableEntry": true, - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "title", - "printedName": "title(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "Self" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit0B12ConfigurablePAAE5titleyxSSF", - "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurablePAAE5titleyxSSF", - "moduleName": "ShopifyCheckoutKit", - "genericSig": "", - "declAttributes": [ - "DiscardableResult", - "Custom" - ], - "isFromExtension": true, - "funcSelfKind": "NonMutating" - } - ], - "declKind": "Protocol", - "usr": "s:18ShopifyCheckoutKit0B12ConfigurableP", - "mangledName": "$s18ShopifyCheckoutKit0B12ConfigurableP", - "moduleName": "ShopifyCheckoutKit", - "declAttributes": [ - "Custom" - ], - "conformances": [ - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" - }, - { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" - } - ] - }, - { - "kind": "TypeDecl", - "name": "CheckoutDelegate", - "printedName": "CheckoutDelegate", - "children": [ - { - "kind": "Function", - "name": "checkoutAction", - "printedName": "checkoutAction(for:)", - "children": [ - { - "kind": "TypeNominal", - "name": "CheckoutLinkAction", - "printedName": "ShopifyCheckoutKit.CheckoutLinkAction", - "usr": "s:18ShopifyCheckoutKit0B10LinkActionO" - }, - { - "kind": "TypeNominal", - "name": "CheckoutLink", - "printedName": "ShopifyCheckoutKit.CheckoutLink", - "usr": "s:18ShopifyCheckoutKit0B4LinkV" - } - ], - "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit0B8DelegateP14checkoutAction3forAA0b4LinkF0OAA0bH0V_tF", - "mangledName": "$s18ShopifyCheckoutKit0B8DelegateP14checkoutAction3forAA0b4LinkF0OAA0bH0V_tF", - "moduleName": "ShopifyCheckoutKit", - "genericSig": "", - "protocolReq": true, - "declAttributes": [ - "Custom" - ], - "reqNewWitnessTableEntry": true, - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "checkoutAction", - "printedName": "checkoutAction(for:)", - "children": [ - { - "kind": "TypeNominal", - "name": "CheckoutLinkAction", - "printedName": "ShopifyCheckoutKit.CheckoutLinkAction", - "usr": "s:18ShopifyCheckoutKit0B10LinkActionO" - }, - { - "kind": "TypeNominal", - "name": "CheckoutLink", - "printedName": "ShopifyCheckoutKit.CheckoutLink", - "usr": "s:18ShopifyCheckoutKit0B4LinkV" - } - ], - "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit0B8DelegatePAAE14checkoutAction3forAA0b4LinkF0OAA0bH0V_tF", - "mangledName": "$s18ShopifyCheckoutKit0B8DelegatePAAE14checkoutAction3forAA0b4LinkF0OAA0bH0V_tF", - "moduleName": "ShopifyCheckoutKit", - "genericSig": "", - "declAttributes": [ - "Custom" - ], - "isFromExtension": true, - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "checkoutDidComplete", - "printedName": "checkoutDidComplete(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" + "name": "Void", + "printedName": "()" }, { "kind": "TypeNominal", @@ -6796,73 +6797,562 @@ }, { "kind": "TypeDecl", - "name": "Configuration", - "printedName": "Configuration", + "name": "ColorScheme", + "printedName": "ColorScheme", "children": [ { "kind": "Var", - "name": "appearance", - "printedName": "appearance", + "name": "light", + "printedName": "light", "children": [ { - "kind": "TypeNominal", - "name": "Appearance", - "printedName": "ShopifyCheckoutKit.Configuration.Appearance", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO" - } - ], - "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10appearanceAC10AppearanceOvp", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10appearanceAC10AppearanceOvp", - "moduleName": "ShopifyCheckoutKit", - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Appearance", - "printedName": "ShopifyCheckoutKit.Configuration.Appearance", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO" - } - ], - "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10appearanceAC10AppearanceOvg", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10appearanceAC10AppearanceOvg", - "moduleName": "ShopifyCheckoutKit", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - }, - { - "kind": "Accessor", - "name": "Set", - "printedName": "Set()", + "kind": "TypeFunc", + "name": "Function", + "printedName": "(ShopifyCheckoutKit.ColorScheme.Type) -> (ShopifyCheckoutKit.Colors) -> ShopifyCheckoutKit.ColorScheme", "children": [ { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" + "kind": "TypeFunc", + "name": "Function", + "printedName": "(ShopifyCheckoutKit.Colors) -> ShopifyCheckoutKit.ColorScheme", + "children": [ + { + "kind": "TypeNominal", + "name": "ColorScheme", + "printedName": "ShopifyCheckoutKit.ColorScheme", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO" + }, + { + "kind": "TypeNominal", + "name": "Tuple", + "printedName": "(colors: ShopifyCheckoutKit.Colors)", + "children": [ + { + "kind": "TypeNominal", + "name": "Colors", + "printedName": "ShopifyCheckoutKit.Colors", + "usr": "s:18ShopifyCheckoutKit6ColorsV" + } + ] + } + ] }, { "kind": "TypeNominal", - "name": "Appearance", - "printedName": "ShopifyCheckoutKit.Configuration.Appearance", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO" - } + "name": "Metatype", + "printedName": "ShopifyCheckoutKit.ColorScheme.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "ColorScheme", + "printedName": "ShopifyCheckoutKit.ColorScheme", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO" + } + ] + } + ] + } + ], + "declKind": "EnumElement", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO5lightyAcA6ColorsV_tcACmF", + "mangledName": "$s18ShopifyCheckoutKit11ColorSchemeO5lightyAcA6ColorsV_tcACmF", + "moduleName": "ShopifyCheckoutKit" + }, + { + "kind": "Var", + "name": "dark", + "printedName": "dark", + "children": [ + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(ShopifyCheckoutKit.ColorScheme.Type) -> (ShopifyCheckoutKit.Colors) -> ShopifyCheckoutKit.ColorScheme", + "children": [ + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(ShopifyCheckoutKit.Colors) -> ShopifyCheckoutKit.ColorScheme", + "children": [ + { + "kind": "TypeNominal", + "name": "ColorScheme", + "printedName": "ShopifyCheckoutKit.ColorScheme", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO" + }, + { + "kind": "TypeNominal", + "name": "Tuple", + "printedName": "(colors: ShopifyCheckoutKit.Colors)", + "children": [ + { + "kind": "TypeNominal", + "name": "Colors", + "printedName": "ShopifyCheckoutKit.Colors", + "usr": "s:18ShopifyCheckoutKit6ColorsV" + } + ] + } + ] + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "ShopifyCheckoutKit.ColorScheme.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "ColorScheme", + "printedName": "ShopifyCheckoutKit.ColorScheme", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO" + } + ] + } + ] + } + ], + "declKind": "EnumElement", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO4darkyAcA6ColorsV_tcACmF", + "mangledName": "$s18ShopifyCheckoutKit11ColorSchemeO4darkyAcA6ColorsV_tcACmF", + "moduleName": "ShopifyCheckoutKit" + }, + { + "kind": "Var", + "name": "automatic", + "printedName": "automatic", + "children": [ + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(ShopifyCheckoutKit.ColorScheme.Type) -> (ShopifyCheckoutKit.Colors, ShopifyCheckoutKit.Colors) -> ShopifyCheckoutKit.ColorScheme", + "children": [ + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(ShopifyCheckoutKit.Colors, ShopifyCheckoutKit.Colors) -> ShopifyCheckoutKit.ColorScheme", + "children": [ + { + "kind": "TypeNominal", + "name": "ColorScheme", + "printedName": "ShopifyCheckoutKit.ColorScheme", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO" + }, + { + "kind": "TypeNominal", + "name": "Tuple", + "printedName": "(lightColors: ShopifyCheckoutKit.Colors, darkColors: ShopifyCheckoutKit.Colors)", + "children": [ + { + "kind": "TypeNominal", + "name": "Colors", + "printedName": "ShopifyCheckoutKit.Colors", + "usr": "s:18ShopifyCheckoutKit6ColorsV" + }, + { + "kind": "TypeNominal", + "name": "Colors", + "printedName": "ShopifyCheckoutKit.Colors", + "usr": "s:18ShopifyCheckoutKit6ColorsV" + } + ] + } + ] + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "ShopifyCheckoutKit.ColorScheme.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "ColorScheme", + "printedName": "ShopifyCheckoutKit.ColorScheme", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO" + } + ] + } + ] + } + ], + "declKind": "EnumElement", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO9automaticyAcA6ColorsV_AFtcACmF", + "mangledName": "$s18ShopifyCheckoutKit11ColorSchemeO9automaticyAcA6ColorsV_AFtcACmF", + "moduleName": "ShopifyCheckoutKit" + }, + { + "kind": "Function", + "name": "__derived_enum_equals", + "printedName": "__derived_enum_equals(_:_:)", + "children": [ + { + "kind": "TypeNominal", + "name": "Bool", + "printedName": "Swift.Bool", + "usr": "s:Sb" + }, + { + "kind": "TypeNominal", + "name": "ColorScheme", + "printedName": "ShopifyCheckoutKit.ColorScheme", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO" + }, + { + "kind": "TypeNominal", + "name": "ColorScheme", + "printedName": "ShopifyCheckoutKit.ColorScheme", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO" + } + ], + "declKind": "Func", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO21__derived_enum_equalsySbAC_ACtFZ", + "mangledName": "$s18ShopifyCheckoutKit11ColorSchemeO21__derived_enum_equalsySbAC_ACtFZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "implicit": true, + "declAttributes": [ + "Implements" + ], + "funcSelfKind": "NonMutating" + }, + { + "kind": "Function", + "name": "customize", + "printedName": "customize(_:)", + "children": [ + { + "kind": "TypeNominal", + "name": "ColorScheme", + "printedName": "ShopifyCheckoutKit.ColorScheme", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO" + }, + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(inout ShopifyCheckoutKit.Colors) -> Swift.Void", + "children": [ + { + "kind": "TypeNameAlias", + "name": "Void", + "printedName": "Swift.Void", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + } + ] + }, + { + "kind": "TypeNominal", + "name": "Colors", + "printedName": "ShopifyCheckoutKit.Colors", + "usr": "s:18ShopifyCheckoutKit6ColorsV" + } + ], + "typeAttributes": [ + "noescape" + ] + } + ], + "declKind": "Func", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO9customizeyACyAA6ColorsVzXEF", + "mangledName": "$s18ShopifyCheckoutKit11ColorSchemeO9customizeyACyAA6ColorsVzXEF", + "moduleName": "ShopifyCheckoutKit", + "funcSelfKind": "NonMutating" + }, + { + "kind": "Function", + "name": "customize", + "printedName": "customize(light:dark:)", + "children": [ + { + "kind": "TypeNominal", + "name": "ColorScheme", + "printedName": "ShopifyCheckoutKit.ColorScheme", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO" + }, + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(inout ShopifyCheckoutKit.Colors) -> Swift.Void", + "children": [ + { + "kind": "TypeNameAlias", + "name": "Void", + "printedName": "Swift.Void", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + } + ] + }, + { + "kind": "TypeNominal", + "name": "Colors", + "printedName": "ShopifyCheckoutKit.Colors", + "usr": "s:18ShopifyCheckoutKit6ColorsV" + } + ], + "typeAttributes": [ + "noescape" + ] + }, + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(inout ShopifyCheckoutKit.Colors) -> Swift.Void", + "children": [ + { + "kind": "TypeNameAlias", + "name": "Void", + "printedName": "Swift.Void", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + } + ] + }, + { + "kind": "TypeNominal", + "name": "Colors", + "printedName": "ShopifyCheckoutKit.Colors", + "usr": "s:18ShopifyCheckoutKit6ColorsV" + } + ], + "typeAttributes": [ + "noescape" + ] + } + ], + "declKind": "Func", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO9customize5light4darkACyAA6ColorsVzXE_yAHzXEtF", + "mangledName": "$s18ShopifyCheckoutKit11ColorSchemeO9customize5light4darkACyAA6ColorsVzXE_yAHzXEtF", + "moduleName": "ShopifyCheckoutKit", + "funcSelfKind": "NonMutating" + }, + { + "kind": "Var", + "name": "id", + "printedName": "id", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO2idSSvp", + "mangledName": "$s18ShopifyCheckoutKit11ColorSchemeO2idSSvp", + "moduleName": "ShopifyCheckoutKit", + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO2idSSvg", + "mangledName": "$s18ShopifyCheckoutKit11ColorSchemeO2idSSvg", + "moduleName": "ShopifyCheckoutKit", + "accessorKind": "get" + } + ] + } + ], + "declKind": "Enum", + "usr": "s:18ShopifyCheckoutKit11ColorSchemeO", + "mangledName": "$s18ShopifyCheckoutKit11ColorSchemeO", + "moduleName": "ShopifyCheckoutKit", + "isEnumExhaustive": true, + "conformances": [ + { + "kind": "Conformance", + "name": "Equatable", + "printedName": "Equatable", + "usr": "s:SQ", + "mangledName": "$sSQ" + }, + { + "kind": "Conformance", + "name": "Sendable", + "printedName": "Sendable", + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" + }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + }, + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" + }, + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + } + ] + }, + { + "kind": "TypeDecl", + "name": "Colors", + "printedName": "Colors", + "children": [ + { + "kind": "Var", + "name": "webViewBackground", + "printedName": "webViewBackground", + "children": [ + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit6ColorsV17webViewBackgroundSo7UIColorCvp", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV17webViewBackgroundSo7UIColorCvp", + "moduleName": "ShopifyCheckoutKit", + "declAttributes": [ + "HasStorage" + ], + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit6ColorsV17webViewBackgroundSo7UIColorCvg", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV17webViewBackgroundSo7UIColorCvg", + "moduleName": "ShopifyCheckoutKit", + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + }, + { + "kind": "Accessor", + "name": "Set", + "printedName": "Set()", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + }, + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit6ColorsV17webViewBackgroundSo7UIColorCvs", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV17webViewBackgroundSo7UIColorCvs", + "moduleName": "ShopifyCheckoutKit", + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "set" + } + ] + }, + { + "kind": "Var", + "name": "headerBackground", + "printedName": "headerBackground", + "children": [ + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit6ColorsV16headerBackgroundSo7UIColorCvp", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV16headerBackgroundSo7UIColorCvp", + "moduleName": "ShopifyCheckoutKit", + "declAttributes": [ + "HasStorage" + ], + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10appearanceAC10AppearanceOvs", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10appearanceAC10AppearanceOvs", + "usr": "s:18ShopifyCheckoutKit6ColorsV16headerBackgroundSo7UIColorCvg", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV16headerBackgroundSo7UIColorCvg", + "moduleName": "ShopifyCheckoutKit", + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + }, + { + "kind": "Accessor", + "name": "Set", + "printedName": "Set()", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + }, + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit6ColorsV16headerBackgroundSo7UIColorCvs", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV16headerBackgroundSo7UIColorCvs", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -6874,19 +7364,171 @@ }, { "kind": "Var", - "name": "confetti", - "printedName": "confetti", + "name": "headerFont", + "printedName": "headerFont", "children": [ { "kind": "TypeNominal", - "name": "Confetti", - "printedName": "ShopifyCheckoutKit.Configuration.Confetti", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV8ConfettiV" + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" } ], "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV8confettiAC8ConfettiVvp", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8confettiAC8ConfettiVvp", + "usr": "s:18ShopifyCheckoutKit6ColorsV10headerFontSo7UIColorCvp", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV10headerFontSo7UIColorCvp", + "moduleName": "ShopifyCheckoutKit", + "declAttributes": [ + "HasStorage" + ], + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit6ColorsV10headerFontSo7UIColorCvg", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV10headerFontSo7UIColorCvg", + "moduleName": "ShopifyCheckoutKit", + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + }, + { + "kind": "Accessor", + "name": "Set", + "printedName": "Set()", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + }, + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit6ColorsV10headerFontSo7UIColorCvs", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV10headerFontSo7UIColorCvs", + "moduleName": "ShopifyCheckoutKit", + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "set" + } + ] + }, + { + "kind": "Var", + "name": "progressIndicator", + "printedName": "progressIndicator", + "children": [ + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit6ColorsV17progressIndicatorSo7UIColorCvp", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV17progressIndicatorSo7UIColorCvp", + "moduleName": "ShopifyCheckoutKit", + "declAttributes": [ + "HasStorage" + ], + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit6ColorsV17progressIndicatorSo7UIColorCvg", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV17progressIndicatorSo7UIColorCvg", + "moduleName": "ShopifyCheckoutKit", + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "get" + }, + { + "kind": "Accessor", + "name": "Set", + "printedName": "Set()", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + }, + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit6ColorsV17progressIndicatorSo7UIColorCvs", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV17progressIndicatorSo7UIColorCvs", + "moduleName": "ShopifyCheckoutKit", + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "set" + } + ] + }, + { + "kind": "Var", + "name": "closeIcon", + "printedName": "closeIcon", + "children": [ + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "UIKit.UIImage?", + "children": [ + { + "kind": "TypeNominal", + "name": "UIImage", + "printedName": "UIKit.UIImage", + "usr": "c:objc(cs)UIImage" + } + ], + "usr": "s:Sq" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit6ColorsV9closeIconSo7UIImageCSgvp", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV9closeIconSo7UIImageCSgvp", "moduleName": "ShopifyCheckoutKit", "declAttributes": [ "HasInitialValue", @@ -6901,14 +7543,22 @@ "children": [ { "kind": "TypeNominal", - "name": "Confetti", - "printedName": "ShopifyCheckoutKit.Configuration.Confetti", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV8ConfettiV" + "name": "Optional", + "printedName": "UIKit.UIImage?", + "children": [ + { + "kind": "TypeNominal", + "name": "UIImage", + "printedName": "UIKit.UIImage", + "usr": "c:objc(cs)UIImage" + } + ], + "usr": "s:Sq" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV8confettiAC8ConfettiVvg", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8confettiAC8ConfettiVvg", + "usr": "s:18ShopifyCheckoutKit6ColorsV9closeIconSo7UIImageCSgvg", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV9closeIconSo7UIImageCSgvg", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -6928,14 +7578,22 @@ }, { "kind": "TypeNominal", - "name": "Confetti", - "printedName": "ShopifyCheckoutKit.Configuration.Confetti", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV8ConfettiV" + "name": "Optional", + "printedName": "UIKit.UIImage?", + "children": [ + { + "kind": "TypeNominal", + "name": "UIImage", + "printedName": "UIKit.UIImage", + "usr": "c:objc(cs)UIImage" + } + ], + "usr": "s:Sq" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV8confettiAC8ConfettiVvs", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8confettiAC8ConfettiVvs", + "usr": "s:18ShopifyCheckoutKit6ColorsV9closeIconSo7UIImageCSgvs", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV9closeIconSo7UIImageCSgvs", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -6947,19 +7605,27 @@ }, { "kind": "Var", - "name": "preloading", - "printedName": "preloading", + "name": "closeIconTint", + "printedName": "closeIconTint", "children": [ { "kind": "TypeNominal", - "name": "Preloading", - "printedName": "ShopifyCheckoutKit.Configuration.Preloading", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10PreloadingV" + "name": "Optional", + "printedName": "UIKit.UIColor?", + "children": [ + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "usr": "s:Sq" } ], "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10preloadingAC10PreloadingVvp", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10preloadingAC10PreloadingVvp", + "usr": "s:18ShopifyCheckoutKit6ColorsV13closeIconTintSo7UIColorCSgvp", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV13closeIconTintSo7UIColorCSgvp", "moduleName": "ShopifyCheckoutKit", "declAttributes": [ "HasInitialValue", @@ -6974,14 +7640,22 @@ "children": [ { "kind": "TypeNominal", - "name": "Preloading", - "printedName": "ShopifyCheckoutKit.Configuration.Preloading", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10PreloadingV" + "name": "Optional", + "printedName": "UIKit.UIColor?", + "children": [ + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "usr": "s:Sq" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10preloadingAC10PreloadingVvg", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10preloadingAC10PreloadingVvg", + "usr": "s:18ShopifyCheckoutKit6ColorsV13closeIconTintSo7UIColorCSgvg", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV13closeIconTintSo7UIColorCSgvg", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7001,14 +7675,22 @@ }, { "kind": "TypeNominal", - "name": "Preloading", - "printedName": "ShopifyCheckoutKit.Configuration.Preloading", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10PreloadingV" + "name": "Optional", + "printedName": "UIKit.UIColor?", + "children": [ + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "usr": "s:Sq" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10preloadingAC10PreloadingVvs", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10preloadingAC10PreloadingVvs", + "usr": "s:18ShopifyCheckoutKit6ColorsV13closeIconTintSo7UIColorCSgvs", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV13closeIconTintSo7UIColorCSgvs", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7020,19 +7702,27 @@ }, { "kind": "Var", - "name": "telemetry", - "printedName": "telemetry", + "name": "headerBorderColor", + "printedName": "headerBorderColor", "children": [ { "kind": "TypeNominal", - "name": "Telemetry", - "printedName": "ShopifyCheckoutKit.Configuration.Telemetry", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV9TelemetryV" + "name": "Optional", + "printedName": "UIKit.UIColor?", + "children": [ + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "usr": "s:Sq" } ], "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV9telemetryAC9TelemetryVvp", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV9telemetryAC9TelemetryVvp", + "usr": "s:18ShopifyCheckoutKit6ColorsV17headerBorderColorSo7UIColorCSgvp", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV17headerBorderColorSo7UIColorCSgvp", "moduleName": "ShopifyCheckoutKit", "declAttributes": [ "HasInitialValue", @@ -7047,14 +7737,22 @@ "children": [ { "kind": "TypeNominal", - "name": "Telemetry", - "printedName": "ShopifyCheckoutKit.Configuration.Telemetry", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV9TelemetryV" + "name": "Optional", + "printedName": "UIKit.UIColor?", + "children": [ + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "usr": "s:Sq" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV9telemetryAC9TelemetryVvg", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV9telemetryAC9TelemetryVvg", + "usr": "s:18ShopifyCheckoutKit6ColorsV17headerBorderColorSo7UIColorCSgvg", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV17headerBorderColorSo7UIColorCSgvg", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7074,14 +7772,22 @@ }, { "kind": "TypeNominal", - "name": "Telemetry", - "printedName": "ShopifyCheckoutKit.Configuration.Telemetry", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV9TelemetryV" + "name": "Optional", + "printedName": "UIKit.UIColor?", + "children": [ + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "usr": "c:objc(cs)UIColor" + } + ], + "usr": "s:Sq" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV9telemetryAC9TelemetryVvs", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV9telemetryAC9TelemetryVvs", + "usr": "s:18ShopifyCheckoutKit6ColorsV17headerBorderColorSo7UIColorCSgvs", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV17headerBorderColorSo7UIColorCSgvs", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7092,31 +7798,63 @@ ] }, { - "kind": "Var", - "name": "tintColor", - "printedName": "tintColor", + "kind": "Constructor", + "name": "init", + "printedName": "init(webViewBackground:headerBackground:headerFont:progressIndicator:closeIcon:closeIconTint:headerBorderColor:)", "children": [ + { + "kind": "TypeNominal", + "name": "Colors", + "printedName": "ShopifyCheckoutKit.Colors", + "usr": "s:18ShopifyCheckoutKit6ColorsV" + }, { "kind": "TypeNominal", "name": "UIColor", "printedName": "UIKit.UIColor", + "hasDefaultArg": true, "usr": "c:objc(cs)UIColor" - } - ], - "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV9tintColorSo7UIColorCvp", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV9tintColorSo7UIColorCvp", - "moduleName": "ShopifyCheckoutKit", - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "hasStorage": true, - "accessors": [ + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "hasDefaultArg": true, + "usr": "c:objc(cs)UIColor" + }, + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "hasDefaultArg": true, + "usr": "c:objc(cs)UIColor" + }, + { + "kind": "TypeNominal", + "name": "UIColor", + "printedName": "UIKit.UIColor", + "hasDefaultArg": true, + "usr": "c:objc(cs)UIColor" + }, + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "UIKit.UIImage?", + "children": [ + { + "kind": "TypeNominal", + "name": "UIImage", + "printedName": "UIKit.UIImage", + "usr": "c:objc(cs)UIImage" + } + ], + "hasDefaultArg": true, + "usr": "s:Sq" + }, + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "UIKit.UIColor?", "children": [ { "kind": "TypeNominal", @@ -7125,26 +7863,14 @@ "usr": "c:objc(cs)UIColor" } ], - "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV9tintColorSo7UIColorCvg", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV9tintColorSo7UIColorCvg", - "moduleName": "ShopifyCheckoutKit", - "implicit": true, - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" + "hasDefaultArg": true, + "usr": "s:Sq" }, { - "kind": "Accessor", - "name": "Set", - "printedName": "Set()", + "kind": "TypeNominal", + "name": "Optional", + "printedName": "UIKit.UIColor?", "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, { "kind": "TypeNominal", "name": "UIColor", @@ -7152,33 +7878,160 @@ "usr": "c:objc(cs)UIColor" } ], - "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV9tintColorSo7UIColorCvs", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV9tintColorSo7UIColorCvs", - "moduleName": "ShopifyCheckoutKit", - "implicit": true, - "declAttributes": [ - "Transparent" + "hasDefaultArg": true, + "usr": "s:Sq" + } + ], + "declKind": "Constructor", + "usr": "s:18ShopifyCheckoutKit6ColorsV17webViewBackground06headerG00H4Font17progressIndicator9closeIcon0lM4Tint0H11BorderColorACSo7UIColorC_A3LSo7UIImageCSgALSgAPtcfc", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV17webViewBackground06headerG00H4Font17progressIndicator9closeIcon0lM4Tint0H11BorderColorACSo7UIColorC_A3LSo7UIImageCSgALSgAPtcfc", + "moduleName": "ShopifyCheckoutKit", + "init_kind": "Designated" + }, + { + "kind": "Function", + "name": "__derived_struct_equals", + "printedName": "__derived_struct_equals(_:_:)", + "children": [ + { + "kind": "TypeNominal", + "name": "Bool", + "printedName": "Swift.Bool", + "usr": "s:Sb" + }, + { + "kind": "TypeNominal", + "name": "Colors", + "printedName": "ShopifyCheckoutKit.Colors", + "usr": "s:18ShopifyCheckoutKit6ColorsV" + }, + { + "kind": "TypeNominal", + "name": "Colors", + "printedName": "ShopifyCheckoutKit.Colors", + "usr": "s:18ShopifyCheckoutKit6ColorsV" + } + ], + "declKind": "Func", + "usr": "s:18ShopifyCheckoutKit6ColorsV23__derived_struct_equalsySbAC_ACtFZ", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV23__derived_struct_equalsySbAC_ACtFZ", + "moduleName": "ShopifyCheckoutKit", + "static": true, + "implicit": true, + "declAttributes": [ + "Implements" + ], + "funcSelfKind": "NonMutating" + }, + { + "kind": "Function", + "name": "customize", + "printedName": "customize(_:)", + "children": [ + { + "kind": "TypeNominal", + "name": "Colors", + "printedName": "ShopifyCheckoutKit.Colors", + "usr": "s:18ShopifyCheckoutKit6ColorsV" + }, + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(inout ShopifyCheckoutKit.Colors) -> Swift.Void", + "children": [ + { + "kind": "TypeNameAlias", + "name": "Void", + "printedName": "Swift.Void", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + } + ] + }, + { + "kind": "TypeNominal", + "name": "Colors", + "printedName": "ShopifyCheckoutKit.Colors", + "usr": "s:18ShopifyCheckoutKit6ColorsV" + } ], - "accessorKind": "set" + "typeAttributes": [ + "noescape" + ] } - ] + ], + "declKind": "Func", + "usr": "s:18ShopifyCheckoutKit6ColorsV9customizeyACyACzXEF", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV9customizeyACyACzXEF", + "moduleName": "ShopifyCheckoutKit", + "funcSelfKind": "NonMutating" + } + ], + "declKind": "Struct", + "usr": "s:18ShopifyCheckoutKit6ColorsV", + "mangledName": "$s18ShopifyCheckoutKit6ColorsV", + "moduleName": "ShopifyCheckoutKit", + "conformances": [ + { + "kind": "Conformance", + "name": "Equatable", + "printedName": "Equatable", + "usr": "s:SQ", + "mangledName": "$sSQ" + }, + { + "kind": "Conformance", + "name": "Sendable", + "printedName": "Sendable", + "usr": "s:s8SendableP", + "mangledName": "$ss8SendableP" + }, + { + "kind": "Conformance", + "name": "SendableMetatype", + "printedName": "SendableMetatype", + "usr": "s:s16SendableMetatypeP", + "mangledName": "$ss16SendableMetatypeP" + }, + { + "kind": "Conformance", + "name": "Copyable", + "printedName": "Copyable", + "usr": "s:s8CopyableP", + "mangledName": "$ss8CopyableP" }, + { + "kind": "Conformance", + "name": "Escapable", + "printedName": "Escapable", + "usr": "s:s9EscapableP", + "mangledName": "$ss9EscapableP" + } + ] + }, + { + "kind": "TypeDecl", + "name": "Configuration", + "printedName": "Configuration", + "children": [ { "kind": "Var", - "name": "backgroundColor", - "printedName": "backgroundColor", + "name": "appearance", + "printedName": "appearance", "children": [ { "kind": "TypeNominal", - "name": "UIColor", - "printedName": "UIKit.UIColor", - "usr": "c:objc(cs)UIColor" + "name": "CheckoutAppearance", + "printedName": "ShopifyCheckoutKit.CheckoutAppearance", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO" } ], "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV15backgroundColorSo7UIColorCvp", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV15backgroundColorSo7UIColorCvp", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV10appearanceAA0B10AppearanceOvp", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10appearanceAA0B10AppearanceOvp", "moduleName": "ShopifyCheckoutKit", "declAttributes": [ "HasInitialValue", @@ -7193,14 +8046,14 @@ "children": [ { "kind": "TypeNominal", - "name": "UIColor", - "printedName": "UIKit.UIColor", - "usr": "c:objc(cs)UIColor" + "name": "CheckoutAppearance", + "printedName": "ShopifyCheckoutKit.CheckoutAppearance", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV15backgroundColorSo7UIColorCvg", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV15backgroundColorSo7UIColorCvg", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV10appearanceAA0B10AppearanceOvg", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10appearanceAA0B10AppearanceOvg", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7220,14 +8073,14 @@ }, { "kind": "TypeNominal", - "name": "UIColor", - "printedName": "UIKit.UIColor", - "usr": "c:objc(cs)UIColor" + "name": "CheckoutAppearance", + "printedName": "ShopifyCheckoutKit.CheckoutAppearance", + "usr": "s:18ShopifyCheckoutKit0B10AppearanceO" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV15backgroundColorSo7UIColorCvs", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV15backgroundColorSo7UIColorCvs", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV10appearanceAA0B10AppearanceOvs", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10appearanceAA0B10AppearanceOvs", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7239,19 +8092,19 @@ }, { "kind": "Var", - "name": "logger", - "printedName": "logger", + "name": "confetti", + "printedName": "confetti", "children": [ { "kind": "TypeNominal", - "name": "Logger", - "printedName": "any ShopifyCheckoutKit.Logger", - "usr": "s:18ShopifyCheckoutKit6LoggerP" + "name": "Confetti", + "printedName": "ShopifyCheckoutKit.Configuration.Confetti", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV8ConfettiV" } ], "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV6loggerAA6Logger_pvp", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV6loggerAA6Logger_pvp", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV8confettiAC8ConfettiVvp", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8confettiAC8ConfettiVvp", "moduleName": "ShopifyCheckoutKit", "declAttributes": [ "HasInitialValue", @@ -7266,14 +8119,14 @@ "children": [ { "kind": "TypeNominal", - "name": "Logger", - "printedName": "any ShopifyCheckoutKit.Logger", - "usr": "s:18ShopifyCheckoutKit6LoggerP" + "name": "Confetti", + "printedName": "ShopifyCheckoutKit.Configuration.Confetti", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV8ConfettiV" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV6loggerAA6Logger_pvg", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV6loggerAA6Logger_pvg", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV8confettiAC8ConfettiVvg", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8confettiAC8ConfettiVvg", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7293,14 +8146,14 @@ }, { "kind": "TypeNominal", - "name": "Logger", - "printedName": "any ShopifyCheckoutKit.Logger", - "usr": "s:18ShopifyCheckoutKit6LoggerP" + "name": "Confetti", + "printedName": "ShopifyCheckoutKit.Configuration.Confetti", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV8ConfettiV" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV6loggerAA6Logger_pvs", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV6loggerAA6Logger_pvs", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV8confettiAC8ConfettiVvs", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8confettiAC8ConfettiVvs", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7312,19 +8165,19 @@ }, { "kind": "Var", - "name": "title", - "printedName": "title", + "name": "preloading", + "printedName": "preloading", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "Preloading", + "printedName": "ShopifyCheckoutKit.Configuration.Preloading", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV10PreloadingV" } ], "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV5titleSSvp", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV5titleSSvp", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV10preloadingAC10PreloadingVvp", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10preloadingAC10PreloadingVvp", "moduleName": "ShopifyCheckoutKit", "declAttributes": [ "HasInitialValue", @@ -7339,14 +8192,14 @@ "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "Preloading", + "printedName": "ShopifyCheckoutKit.Configuration.Preloading", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV10PreloadingV" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV5titleSSvg", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV5titleSSvg", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV10preloadingAC10PreloadingVvg", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10preloadingAC10PreloadingVvg", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7366,14 +8219,14 @@ }, { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "Preloading", + "printedName": "ShopifyCheckoutKit.Configuration.Preloading", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV10PreloadingV" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV5titleSSvs", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV5titleSSvs", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV10preloadingAC10PreloadingVvs", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10preloadingAC10PreloadingVvs", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7385,27 +8238,19 @@ }, { "kind": "Var", - "name": "closeButtonTintColor", - "printedName": "closeButtonTintColor", + "name": "telemetry", + "printedName": "telemetry", "children": [ { "kind": "TypeNominal", - "name": "Optional", - "printedName": "UIKit.UIColor?", - "children": [ - { - "kind": "TypeNominal", - "name": "UIColor", - "printedName": "UIKit.UIColor", - "usr": "c:objc(cs)UIColor" - } - ], - "usr": "s:Sq" + "name": "Telemetry", + "printedName": "ShopifyCheckoutKit.Configuration.Telemetry", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV9TelemetryV" } ], "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV20closeButtonTintColorSo7UIColorCSgvp", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV20closeButtonTintColorSo7UIColorCSgvp", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV9telemetryAC9TelemetryVvp", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV9telemetryAC9TelemetryVvp", "moduleName": "ShopifyCheckoutKit", "declAttributes": [ "HasInitialValue", @@ -7420,22 +8265,14 @@ "children": [ { "kind": "TypeNominal", - "name": "Optional", - "printedName": "UIKit.UIColor?", - "children": [ - { - "kind": "TypeNominal", - "name": "UIColor", - "printedName": "UIKit.UIColor", - "usr": "c:objc(cs)UIColor" - } - ], - "usr": "s:Sq" + "name": "Telemetry", + "printedName": "ShopifyCheckoutKit.Configuration.Telemetry", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV9TelemetryV" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV20closeButtonTintColorSo7UIColorCSgvg", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV20closeButtonTintColorSo7UIColorCSgvg", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV9telemetryAC9TelemetryVvg", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV9telemetryAC9TelemetryVvg", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7455,22 +8292,14 @@ }, { "kind": "TypeNominal", - "name": "Optional", - "printedName": "UIKit.UIColor?", - "children": [ - { - "kind": "TypeNominal", - "name": "UIColor", - "printedName": "UIKit.UIColor", - "usr": "c:objc(cs)UIColor" - } - ], - "usr": "s:Sq" + "name": "Telemetry", + "printedName": "ShopifyCheckoutKit.Configuration.Telemetry", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV9TelemetryV" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV20closeButtonTintColorSo7UIColorCSgvs", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV20closeButtonTintColorSo7UIColorCSgvs", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV9telemetryAC9TelemetryVvs", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV9telemetryAC9TelemetryVvs", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7482,27 +8311,19 @@ }, { "kind": "Var", - "name": "platform", - "printedName": "platform", + "name": "logger", + "printedName": "logger", "children": [ { "kind": "TypeNominal", - "name": "Optional", - "printedName": "ShopifyCheckoutKit.Platform?", - "children": [ - { - "kind": "TypeNominal", - "name": "Platform", - "printedName": "ShopifyCheckoutKit.Platform", - "usr": "s:18ShopifyCheckoutKit8PlatformV" - } - ], - "usr": "s:Sq" + "name": "Logger", + "printedName": "any ShopifyCheckoutKit.Logger", + "usr": "s:18ShopifyCheckoutKit6LoggerP" } ], "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV8platformAA8PlatformVSgvp", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8platformAA8PlatformVSgvp", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV6loggerAA6Logger_pvp", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV6loggerAA6Logger_pvp", "moduleName": "ShopifyCheckoutKit", "declAttributes": [ "HasInitialValue", @@ -7517,22 +8338,14 @@ "children": [ { "kind": "TypeNominal", - "name": "Optional", - "printedName": "ShopifyCheckoutKit.Platform?", - "children": [ - { - "kind": "TypeNominal", - "name": "Platform", - "printedName": "ShopifyCheckoutKit.Platform", - "usr": "s:18ShopifyCheckoutKit8PlatformV" - } - ], - "usr": "s:Sq" + "name": "Logger", + "printedName": "any ShopifyCheckoutKit.Logger", + "usr": "s:18ShopifyCheckoutKit6LoggerP" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV8platformAA8PlatformVSgvg", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8platformAA8PlatformVSgvg", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV6loggerAA6Logger_pvg", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV6loggerAA6Logger_pvg", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7552,22 +8365,14 @@ }, { "kind": "TypeNominal", - "name": "Optional", - "printedName": "ShopifyCheckoutKit.Platform?", - "children": [ - { - "kind": "TypeNominal", - "name": "Platform", - "printedName": "ShopifyCheckoutKit.Platform", - "usr": "s:18ShopifyCheckoutKit8PlatformV" - } - ], - "usr": "s:Sq" + "name": "Logger", + "printedName": "any ShopifyCheckoutKit.Logger", + "usr": "s:18ShopifyCheckoutKit6LoggerP" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV8platformAA8PlatformVSgvs", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8platformAA8PlatformVSgvs", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV6loggerAA6Logger_pvs", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV6loggerAA6Logger_pvs", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7579,19 +8384,19 @@ }, { "kind": "Var", - "name": "logLevel", - "printedName": "logLevel", + "name": "title", + "printedName": "title", "children": [ { "kind": "TypeNominal", - "name": "LogLevel", - "printedName": "ShopifyCheckoutKit.LogLevel", - "usr": "s:18ShopifyCheckoutKit8LogLevelO" + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" } ], "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV8logLevelAA03LogF0Ovp", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8logLevelAA03LogF0Ovp", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV5titleSSvp", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV5titleSSvp", "moduleName": "ShopifyCheckoutKit", "declAttributes": [ "HasInitialValue", @@ -7606,14 +8411,14 @@ "children": [ { "kind": "TypeNominal", - "name": "LogLevel", - "printedName": "ShopifyCheckoutKit.LogLevel", - "usr": "s:18ShopifyCheckoutKit8LogLevelO" + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV8logLevelAA03LogF0Ovg", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8logLevelAA03LogF0Ovg", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV5titleSSvg", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV5titleSSvg", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7633,14 +8438,14 @@ }, { "kind": "TypeNominal", - "name": "LogLevel", - "printedName": "ShopifyCheckoutKit.LogLevel", - "usr": "s:18ShopifyCheckoutKit8LogLevelO" + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV8logLevelAA03LogF0Ovs", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8logLevelAA03LogF0Ovs", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV5titleSSvs", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV5titleSSvs", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7652,27 +8457,27 @@ }, { "kind": "Var", - "name": "allowedMessageOrigins", - "printedName": "allowedMessageOrigins", + "name": "platform", + "printedName": "platform", "children": [ { "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", + "name": "Optional", + "printedName": "ShopifyCheckoutKit.Platform?", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "Platform", + "printedName": "ShopifyCheckoutKit.Platform", + "usr": "s:18ShopifyCheckoutKit8PlatformV" } ], - "usr": "s:Sa" + "usr": "s:Sq" } ], "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV21allowedMessageOriginsSaySSGvp", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV21allowedMessageOriginsSaySSGvp", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV8platformAA8PlatformVSgvp", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8platformAA8PlatformVSgvp", "moduleName": "ShopifyCheckoutKit", "declAttributes": [ "HasInitialValue", @@ -7687,22 +8492,22 @@ "children": [ { "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", + "name": "Optional", + "printedName": "ShopifyCheckoutKit.Platform?", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "Platform", + "printedName": "ShopifyCheckoutKit.Platform", + "usr": "s:18ShopifyCheckoutKit8PlatformV" } ], - "usr": "s:Sa" + "usr": "s:Sq" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV21allowedMessageOriginsSaySSGvg", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV21allowedMessageOriginsSaySSGvg", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV8platformAA8PlatformVSgvg", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8platformAA8PlatformVSgvg", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7722,22 +8527,22 @@ }, { "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", + "name": "Optional", + "printedName": "ShopifyCheckoutKit.Platform?", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "Platform", + "printedName": "ShopifyCheckoutKit.Platform", + "usr": "s:18ShopifyCheckoutKit8PlatformV" } ], - "usr": "s:Sa" + "usr": "s:Sq" } ], "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV21allowedMessageOriginsSaySSGvs", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV21allowedMessageOriginsSaySSGvs", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV8platformAA8PlatformVSgvs", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8platformAA8PlatformVSgvs", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ @@ -7748,359 +8553,87 @@ ] }, { - "kind": "TypeDecl", - "name": "Appearance", - "printedName": "Appearance", + "kind": "Var", + "name": "logLevel", + "printedName": "logLevel", "children": [ { - "kind": "Var", - "name": "app", - "printedName": "app", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(ShopifyCheckoutKit.Configuration.Appearance.Type) -> (ShopifyCheckoutKit.Configuration.ColorScheme) -> ShopifyCheckoutKit.Configuration.Appearance", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(ShopifyCheckoutKit.Configuration.ColorScheme) -> ShopifyCheckoutKit.Configuration.Appearance", - "children": [ - { - "kind": "TypeNominal", - "name": "Appearance", - "printedName": "ShopifyCheckoutKit.Configuration.Appearance", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO" - }, - { - "kind": "TypeNominal", - "name": "ColorScheme", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO" - } - ] - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "ShopifyCheckoutKit.Configuration.Appearance.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "Appearance", - "printedName": "ShopifyCheckoutKit.Configuration.Appearance", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO3appyAeC11ColorSchemeOcAEmF", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10AppearanceO3appyAeC11ColorSchemeOcAEmF", - "moduleName": "ShopifyCheckoutKit" - }, - { - "kind": "Var", - "name": "storefront", - "printedName": "storefront", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(ShopifyCheckoutKit.Configuration.Appearance.Type) -> ShopifyCheckoutKit.Configuration.Appearance", - "children": [ - { - "kind": "TypeNominal", - "name": "Appearance", - "printedName": "ShopifyCheckoutKit.Configuration.Appearance", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "ShopifyCheckoutKit.Configuration.Appearance.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "Appearance", - "printedName": "ShopifyCheckoutKit.Configuration.Appearance", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO10storefrontyA2EmF", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10AppearanceO10storefrontyA2EmF", - "moduleName": "ShopifyCheckoutKit" - }, - { - "kind": "Function", - "name": "__derived_enum_equals", - "printedName": "__derived_enum_equals(_:_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Bool", - "printedName": "Swift.Bool", - "usr": "s:Sb" - }, - { - "kind": "TypeNominal", - "name": "Appearance", - "printedName": "ShopifyCheckoutKit.Configuration.Appearance", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO" - }, - { - "kind": "TypeNominal", - "name": "Appearance", - "printedName": "ShopifyCheckoutKit.Configuration.Appearance", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO" - } - ], - "declKind": "Func", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO21__derived_enum_equalsySbAE_AEtFZ", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10AppearanceO21__derived_enum_equalsySbAE_AEtFZ", - "moduleName": "ShopifyCheckoutKit", - "static": true, - "implicit": true, - "declAttributes": [ - "Implements" - ], - "funcSelfKind": "NonMutating" + "kind": "TypeNominal", + "name": "LogLevel", + "printedName": "ShopifyCheckoutKit.LogLevel", + "usr": "s:18ShopifyCheckoutKit8LogLevelO" } ], - "declKind": "Enum", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV10AppearanceO", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV10AppearanceO", + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV8logLevelAA03LogF0Ovp", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8logLevelAA03LogF0Ovp", "moduleName": "ShopifyCheckoutKit", - "isFromExtension": true, - "isEnumExhaustive": true, - "conformances": [ - { - "kind": "Conformance", - "name": "Equatable", - "printedName": "Equatable", - "usr": "s:SQ", - "mangledName": "$sSQ" - }, - { - "kind": "Conformance", - "name": "Sendable", - "printedName": "Sendable", - "usr": "s:s8SendableP", - "mangledName": "$ss8SendableP" - }, - { - "kind": "Conformance", - "name": "SendableMetatype", - "printedName": "SendableMetatype", - "usr": "s:s16SendableMetatypeP", - "mangledName": "$ss16SendableMetatypeP" - }, - { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" - }, - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" - } - ] - }, - { - "kind": "TypeDecl", - "name": "ColorScheme", - "printedName": "ColorScheme", - "children": [ - { - "kind": "Var", - "name": "light", - "printedName": "light", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(ShopifyCheckoutKit.Configuration.ColorScheme.Type) -> ShopifyCheckoutKit.Configuration.ColorScheme", - "children": [ - { - "kind": "TypeNominal", - "name": "ColorScheme", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "ColorScheme", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO5lightyA2EmF", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO5lightyA2EmF", - "moduleName": "ShopifyCheckoutKit" - }, - { - "kind": "Var", - "name": "dark", - "printedName": "dark", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(ShopifyCheckoutKit.Configuration.ColorScheme.Type) -> ShopifyCheckoutKit.Configuration.ColorScheme", - "children": [ - { - "kind": "TypeNominal", - "name": "ColorScheme", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "ColorScheme", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO4darkyA2EmF", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO4darkyA2EmF", - "moduleName": "ShopifyCheckoutKit" - }, - { - "kind": "Var", - "name": "automatic", - "printedName": "automatic", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(ShopifyCheckoutKit.Configuration.ColorScheme.Type) -> ShopifyCheckoutKit.Configuration.ColorScheme", - "children": [ - { - "kind": "TypeNominal", - "name": "ColorScheme", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "ColorScheme", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO9automaticyA2EmF", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO9automaticyA2EmF", - "moduleName": "ShopifyCheckoutKit" - }, + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "hasStorage": true, + "accessors": [ { - "kind": "Constructor", - "name": "init", - "printedName": "init(rawValue:)", + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", "children": [ { "kind": "TypeNominal", - "name": "Optional", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme?", - "children": [ - { - "kind": "TypeNominal", - "name": "ColorScheme", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO" - } - ], - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" + "name": "LogLevel", + "printedName": "ShopifyCheckoutKit.LogLevel", + "usr": "s:18ShopifyCheckoutKit8LogLevelO" } ], - "declKind": "Constructor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO8rawValueAESgSS_tcfc", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO8rawValueAESgSS_tcfc", + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV8logLevelAA03LogF0Ovg", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8logLevelAA03LogF0Ovg", "moduleName": "ShopifyCheckoutKit", "implicit": true, "declAttributes": [ - "Inlinable" + "Transparent" ], - "init_kind": "Designated" + "accessorKind": "get" }, { - "kind": "TypeAlias", - "name": "AllCases", - "printedName": "AllCases", + "kind": "Accessor", + "name": "Set", + "printedName": "Set()", "children": [ { "kind": "TypeNominal", - "name": "Array", - "printedName": "[ShopifyCheckoutKit.Configuration.ColorScheme]", - "children": [ - { - "kind": "TypeNominal", - "name": "ColorScheme", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO" - } - ], - "usr": "s:Sa" + "name": "Void", + "printedName": "()" + }, + { + "kind": "TypeNominal", + "name": "LogLevel", + "printedName": "ShopifyCheckoutKit.LogLevel", + "usr": "s:18ShopifyCheckoutKit8LogLevelO" } ], - "declKind": "TypeAlias", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO8AllCasesa", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO8AllCasesa", + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV8logLevelAA03LogF0Ovs", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV8logLevelAA03LogF0Ovs", "moduleName": "ShopifyCheckoutKit", - "implicit": true - }, + "implicit": true, + "declAttributes": [ + "Transparent" + ], + "accessorKind": "set" + } + ] + }, + { + "kind": "Var", + "name": "allowedMessageOrigins", + "printedName": "allowedMessageOrigins", + "children": [ { - "kind": "TypeAlias", - "name": "RawValue", - "printedName": "RawValue", + "kind": "TypeNominal", + "name": "Array", + "printedName": "[Swift.String]", "children": [ { "kind": "TypeNominal", @@ -8109,94 +8642,63 @@ "usr": "s:SS" } ], - "declKind": "TypeAlias", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO8RawValuea", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO8RawValuea", - "moduleName": "ShopifyCheckoutKit", - "implicit": true - }, + "usr": "s:Sa" + } + ], + "declKind": "Var", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV21allowedMessageOriginsSaySSGvp", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV21allowedMessageOriginsSaySSGvp", + "moduleName": "ShopifyCheckoutKit", + "declAttributes": [ + "HasInitialValue", + "HasStorage" + ], + "hasStorage": true, + "accessors": [ { - "kind": "Var", - "name": "allCases", - "printedName": "allCases", + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", "children": [ { "kind": "TypeNominal", "name": "Array", - "printedName": "[ShopifyCheckoutKit.Configuration.ColorScheme]", + "printedName": "[Swift.String]", "children": [ { "kind": "TypeNominal", - "name": "ColorScheme", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO" + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" } ], "usr": "s:Sa" } ], - "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO8allCasesSayAEGvpZ", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO8allCasesSayAEGvpZ", + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV21allowedMessageOriginsSaySSGvg", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV21allowedMessageOriginsSaySSGvg", "moduleName": "ShopifyCheckoutKit", - "static": true, "implicit": true, "declAttributes": [ - "Nonisolated" + "Transparent" ], - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Array", - "printedName": "[ShopifyCheckoutKit.Configuration.ColorScheme]", - "children": [ - { - "kind": "TypeNominal", - "name": "ColorScheme", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO" - } - ], - "usr": "s:Sa" - } - ], - "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO8allCasesSayAEGvgZ", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO8allCasesSayAEGvgZ", - "moduleName": "ShopifyCheckoutKit", - "static": true, - "implicit": true, - "accessorKind": "get" - } - ] + "accessorKind": "get" }, { - "kind": "Var", - "name": "rawValue", - "printedName": "rawValue", + "kind": "Accessor", + "name": "Set", + "printedName": "Set()", "children": [ { "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Var", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO8rawValueSSvp", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO8rawValueSSvp", - "moduleName": "ShopifyCheckoutKit", - "implicit": true, - "accessors": [ + "name": "Void", + "printedName": "()" + }, { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "TypeNominal", + "name": "Array", + "printedName": "[Swift.String]", "children": [ { "kind": "TypeNominal", @@ -8205,120 +8707,18 @@ "usr": "s:SS" } ], - "declKind": "Accessor", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO8rawValueSSvg", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO8rawValueSSvg", - "moduleName": "ShopifyCheckoutKit", - "implicit": true, - "declAttributes": [ - "Inlinable" - ], - "accessorKind": "get" - } - ] - } - ], - "declKind": "Enum", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO", - "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO", - "moduleName": "ShopifyCheckoutKit", - "isFromExtension": true, - "enumRawTypeName": "String", - "isEnumExhaustive": true, - "conformances": [ - { - "kind": "Conformance", - "name": "Equatable", - "printedName": "Equatable", - "usr": "s:SQ", - "mangledName": "$sSQ" - }, - { - "kind": "Conformance", - "name": "Hashable", - "printedName": "Hashable", - "usr": "s:SH", - "mangledName": "$sSH" - }, - { - "kind": "Conformance", - "name": "RawRepresentable", - "printedName": "RawRepresentable", - "children": [ - { - "kind": "TypeWitness", - "name": "RawValue", - "printedName": "RawValue", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ] + "usr": "s:Sa" } ], - "usr": "s:SY", - "mangledName": "$sSY" - }, - { - "kind": "Conformance", - "name": "CaseIterable", - "printedName": "CaseIterable", - "children": [ - { - "kind": "TypeWitness", - "name": "AllCases", - "printedName": "AllCases", - "children": [ - { - "kind": "TypeNominal", - "name": "Array", - "printedName": "[ShopifyCheckoutKit.Configuration.ColorScheme]", - "children": [ - { - "kind": "TypeNominal", - "name": "ColorScheme", - "printedName": "ShopifyCheckoutKit.Configuration.ColorScheme", - "usr": "s:18ShopifyCheckoutKit13ConfigurationV11ColorSchemeO" - } - ], - "usr": "s:Sa" - } - ] - } + "declKind": "Accessor", + "usr": "s:18ShopifyCheckoutKit13ConfigurationV21allowedMessageOriginsSaySSGvs", + "mangledName": "$s18ShopifyCheckoutKit13ConfigurationV21allowedMessageOriginsSaySSGvs", + "moduleName": "ShopifyCheckoutKit", + "implicit": true, + "declAttributes": [ + "Transparent" ], - "usr": "s:s12CaseIterableP", - "mangledName": "$ss12CaseIterableP" - }, - { - "kind": "Conformance", - "name": "Sendable", - "printedName": "Sendable", - "usr": "s:s8SendableP", - "mangledName": "$ss8SendableP" - }, - { - "kind": "Conformance", - "name": "SendableMetatype", - "printedName": "SendableMetatype", - "usr": "s:s16SendableMetatypeP", - "mangledName": "$ss16SendableMetatypeP" - }, - { - "kind": "Conformance", - "name": "Copyable", - "printedName": "Copyable", - "usr": "s:s8CopyableP", - "mangledName": "$ss8CopyableP" - }, - { - "kind": "Conformance", - "name": "Escapable", - "printedName": "Escapable", - "usr": "s:s9EscapableP", - "mangledName": "$ss9EscapableP" + "accessorKind": "set" } ] },