diff --git a/.circleci/config.yml b/.circleci/config.yml index e5288ef0..745e4911 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,11 +2,11 @@ version: 2 jobs: build-and-test: macos: - xcode: "15.0.0" + xcode: "15.4.0" shell: /bin/bash --login -o pipefail steps: - checkout - - run: xcodebuild build test -project 'CharcoalDemo/CharcoalDemo.xcodeproj' -scheme 'CharcoalDemo' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14 Pro,OS=16.4' -scmProvider system | xcpretty + - run: xcodebuild build test -project 'CharcoalDemo/CharcoalDemo.xcodeproj' -scheme 'CharcoalDemo' -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 15 Pro,OS=17.5' -scmProvider system | xcpretty swiftlint: docker: diff --git a/CharcoalDemo/CharcoalDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/CharcoalDemo/CharcoalDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index a9fb3ee7..115497ee 100644 --- a/CharcoalDemo/CharcoalDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/CharcoalDemo/CharcoalDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/finn-no/FinniversKit.git", "state" : { - "revision" : "2021c0371174f91c8225e4a621be1f5e87617bd7", - "version" : "134.0.0" + "revision" : "f717edf981afd685282d6d2d92e5d95430b603e8", + "version" : "143.1.0" } }, { @@ -23,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/warp-ds/warp-ios.git", "state" : { - "revision" : "cad18003de0e0900a152a461c47f48e96c7487d8", - "version" : "0.0.4" + "revision" : "528dc6eacf33b5bb18d094b6154df3071d261620", + "version" : "0.0.16" } } ], diff --git a/CharcoalDemo/CharcoalDemo/AppDelegate.swift b/CharcoalDemo/CharcoalDemo/AppDelegate.swift index ea806ea6..8a786590 100644 --- a/CharcoalDemo/CharcoalDemo/AppDelegate.swift +++ b/CharcoalDemo/CharcoalDemo/AppDelegate.swift @@ -8,13 +8,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate { let navigationBarAppearance = UINavigationBar.appearance() navigationBarAppearance.isTranslucent = false - navigationBarAppearance.tintColor = .textAction + navigationBarAppearance.tintColor = .textLink let appearance = UINavigationBarAppearance() appearance.backgroundColor = Theme.mainBackground appearance.titleTextAttributes = [ - .foregroundColor: UIColor.textPrimary, + .foregroundColor: UIColor.text, .font: UIFont.bodyStrong ] diff --git a/CharcoalDemo/CharcoalDemo/Components/MapFilterDemoViewController.swift b/CharcoalDemo/CharcoalDemo/Components/MapFilterDemoViewController.swift index 15d0515c..885884c0 100644 --- a/CharcoalDemo/CharcoalDemo/Components/MapFilterDemoViewController.swift +++ b/CharcoalDemo/CharcoalDemo/Components/MapFilterDemoViewController.swift @@ -4,6 +4,7 @@ @testable import Charcoal import MapKit +import Warp class MapFilterDemoViewController: DemoViewController { // MARK: - Private properties @@ -33,8 +34,8 @@ class MapFilterDemoViewController: DemoViewController { NSLayoutConstraint.activate([ mapView.centerYAnchor.constraint(equalTo: view.centerYAnchor), mapView.heightAnchor.constraint(equalToConstant: 568), - mapView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: .spacingM), - mapView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -.spacingM), + mapView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: Warp.Spacing.spacing200), + mapView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -Warp.Spacing.spacing200), ]) } } diff --git a/CharcoalDemo/CharcoalDemo/DemoTableViewController.swift b/CharcoalDemo/CharcoalDemo/DemoTableViewController.swift index 8e545578..01b402c2 100644 --- a/CharcoalDemo/CharcoalDemo/DemoTableViewController.swift +++ b/CharcoalDemo/CharcoalDemo/DemoTableViewController.swift @@ -16,7 +16,7 @@ class DemoTableViewController: UIViewController { private lazy var tableView: UITableView = { let tableView = UITableView(frame: .zero, style: .grouped) - tableView.backgroundColor = .bgPrimary + tableView.backgroundColor = .background tableView.dataSource = dataSource tableView.delegate = self tableView.register(DemoTableViewCell.self) diff --git a/CharcoalDemo/CharcoalDemo/Utils/DemoTableViewCell.swift b/CharcoalDemo/CharcoalDemo/Utils/DemoTableViewCell.swift index 254ecd7d..6acd9a99 100644 --- a/CharcoalDemo/CharcoalDemo/Utils/DemoTableViewCell.swift +++ b/CharcoalDemo/CharcoalDemo/Utils/DemoTableViewCell.swift @@ -11,7 +11,7 @@ class DemoTableViewCell: UITableViewCell { override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) textLabel?.font = .title3 - textLabel?.textColor = .textPrimary + textLabel?.textColor = .text backgroundColor = .clear let view = UIView(frame: .zero) @@ -31,7 +31,7 @@ class DemoTableViewCell: UITableViewCell { override func setHighlighted(_ highlighted: Bool, animated: Bool) { super.setHighlighted(highlighted, animated: animated) - selectedBackgroundView?.backgroundColor = UIColor.bgSecondary + selectedBackgroundView?.backgroundColor = .backgroundInfoSubtle } override func setSelected(_ selected: Bool, animated: Bool) { diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPad_darkMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPad_darkMode.png index 198abb6a..728bcd9a 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPad_darkMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPad_darkMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPad_lightMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPad_lightMode.png index 77a8e7c5..e2457473 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPad_lightMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPad_lightMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPhone_darkMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPhone_darkMode.png index 4a4d0701..3ba149cb 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPhone_darkMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPhone_darkMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPhone_lightMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPhone_lightMode.png index 15fffff7..e0772019 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPhone_lightMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testInlineFilter.iPhone_lightMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPad_darkMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPad_darkMode.png index 3b2175c5..0f652cc7 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPad_darkMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPad_darkMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPad_lightMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPad_lightMode.png index 25e96fa7..18daa28d 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPad_lightMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPad_lightMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPhone_darkMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPhone_darkMode.png index d232a50d..ccdad8a5 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPhone_darkMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPhone_darkMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPhone_lightMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPhone_lightMode.png index 969e0481..f8a7e984 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPhone_lightMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testRangeFilter.iPhone_lightMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPad_darkMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPad_darkMode.png index b4221ddf..42a2ca6e 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPad_darkMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPad_darkMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPad_lightMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPad_lightMode.png index 746de0e8..a1560c53 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPad_lightMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPad_lightMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPhone_darkMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPhone_darkMode.png index dc5a27ce..6395652c 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPhone_darkMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPhone_darkMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPhone_lightMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPhone_lightMode.png index f5d43964..cb961240 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPhone_lightMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/ComponentTests/testStepperFilter.iPhone_lightMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPad_darkMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPad_darkMode.png index fc728312..e155885a 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPad_darkMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPad_darkMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPad_lightMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPad_lightMode.png index 5a08e451..a90be983 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPad_lightMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPad_lightMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPhone_darkMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPhone_darkMode.png index e699038b..acc8496b 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPhone_darkMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPhone_darkMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPhone_lightMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPhone_lightMode.png index 0909c458..f9986350 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPhone_lightMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testContextFilter.iPhone_lightMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPad_darkMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPad_darkMode.png index 1db3793c..6653dfe2 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPad_darkMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPad_darkMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPad_lightMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPad_lightMode.png index 2bdb2a88..3119d37e 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPad_lightMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPad_lightMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPhone_darkMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPhone_darkMode.png index ca4ebbd3..8970d239 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPhone_darkMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPhone_darkMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPhone_lightMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPhone_lightMode.png index e230736b..82f2826a 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPhone_lightMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testMultipleVerticals.iPhone_lightMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPad_darkMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPad_darkMode.png index 1db3793c..6653dfe2 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPad_darkMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPad_darkMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPad_lightMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPad_lightMode.png index 2bdb2a88..3119d37e 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPad_lightMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPad_lightMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPhone_darkMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPhone_darkMode.png index ca4ebbd3..8970d239 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPhone_darkMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPhone_darkMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPhone_lightMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPhone_lightMode.png index e230736b..82f2826a 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPhone_lightMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testPolygonSearchDisabled.iPhone_lightMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPad_darkMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPad_darkMode.png index 1db3793c..6653dfe2 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPad_darkMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPad_darkMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPad_lightMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPad_lightMode.png index 2bdb2a88..3119d37e 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPad_lightMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPad_lightMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPhone_darkMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPhone_darkMode.png index ca4ebbd3..8970d239 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPhone_darkMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPhone_darkMode.png differ diff --git a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPhone_lightMode.png b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPhone_lightMode.png index e230736b..82f2826a 100644 Binary files a/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPhone_lightMode.png and b/CharcoalDemo/SnapshotTests/__Snapshots__/FilterContainerTests/testSingleVertical.iPhone_lightMode.png differ diff --git a/Package.swift b/Package.swift index 18d0b50d..56d2ecd4 100644 --- a/Package.swift +++ b/Package.swift @@ -13,7 +13,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/finn-no/FinniversKit.git", "134.0.0"..."999.0.0") + .package(url: "https://github.com/finn-no/FinniversKit.git", "143.1.0"..."999.0.0") ], targets: [ .target( diff --git a/Sources/Charcoal/Extensions/UIKit/UITableViewCellExtensions.swift b/Sources/Charcoal/Extensions/UIKit/UITableViewCellExtensions.swift index 89e102e9..54ebdd0f 100644 --- a/Sources/Charcoal/Extensions/UIKit/UITableViewCellExtensions.swift +++ b/Sources/Charcoal/Extensions/UIKit/UITableViewCellExtensions.swift @@ -3,6 +3,7 @@ // import UIKit +import Warp extension UITableViewCell { func layoutAccessoryView(size: CGFloat = 14) { @@ -10,9 +11,9 @@ extension UITableViewCell { return } - let xPosition = bounds.width - size - .spacingXS * 3 + let xPosition = bounds.width - size - Warp.Spacing.spacing50 * 3 accessoryView.frame = CGRect(x: xPosition, y: (bounds.height - size) / 2, width: size, height: size) - contentView.frame.size.width = xPosition - .spacingS + contentView.frame.size.width = xPosition - Warp.Spacing.spacing100 } } diff --git a/Sources/Charcoal/Filters/FreeText/FreeTextFilterSearchBar.swift b/Sources/Charcoal/Filters/FreeText/FreeTextFilterSearchBar.swift index 34427759..37ae2d67 100644 --- a/Sources/Charcoal/Filters/FreeText/FreeTextFilterSearchBar.swift +++ b/Sources/Charcoal/Filters/FreeText/FreeTextFilterSearchBar.swift @@ -10,14 +10,14 @@ class FreeTextFilterSearchBar: UISearchBar { let textFieldAppearanceInRoot = UITextField.appearance(whenContainedInInstancesOf: [AppearanceColoredTableView.self]) textFieldAppearanceInRoot.adjustsFontForContentSizeCategory = true textFieldAppearanceInRoot.defaultTextAttributes = [ - .foregroundColor: UIColor.textAction, + .foregroundColor: UIColor.textLink, .font: UIFont.bodyRegular, ] let textFieldAppearanceInSearch = UITextField.appearance(whenContainedInInstancesOf: [FreeTextFilterSearchBar.self]) textFieldAppearanceInRoot.adjustsFontForContentSizeCategory = true textFieldAppearanceInSearch.defaultTextAttributes = [ - .foregroundColor: UIColor.textPrimary, + .foregroundColor: UIColor.text, .font: UIFont.bodyRegular, ] diff --git a/Sources/Charcoal/Filters/FreeText/FreeTextFilterViewController.swift b/Sources/Charcoal/Filters/FreeText/FreeTextFilterViewController.swift index d664c8f7..621e0829 100644 --- a/Sources/Charcoal/Filters/FreeText/FreeTextFilterViewController.swift +++ b/Sources/Charcoal/Filters/FreeText/FreeTextFilterViewController.swift @@ -4,6 +4,7 @@ import FinniversKit import UIKit +import Warp public protocol FreeTextFilterDataSource: AnyObject { func numberOfSuggestions(in freeTextFilterViewController: FreeTextFilterViewController) -> Int @@ -250,9 +251,9 @@ private extension FreeTextFilterViewController { view.addSubview(searchBar) NSLayoutConstraint.activate([ - searchBar.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: .spacingS), + searchBar.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: Warp.Spacing.spacing100), searchBar.topAnchor.constraint(equalTo: view.topAnchor), - searchBar.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -.spacingS), + searchBar.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -Warp.Spacing.spacing100), topShadowView.bottomAnchor.constraint(equalTo: searchBar.bottomAnchor), diff --git a/Sources/Charcoal/Filters/Grid/GridFilterCell.swift b/Sources/Charcoal/Filters/Grid/GridFilterCell.swift index 0d4dda74..c5ea130b 100644 --- a/Sources/Charcoal/Filters/Grid/GridFilterCell.swift +++ b/Sources/Charcoal/Filters/Grid/GridFilterCell.swift @@ -49,15 +49,15 @@ final class GridFilterCell: UICollectionViewCell { private func setupStyles() { if isSelected { - backgroundColor = .nmpBrandControlSelected - layer.borderColor = UIColor.nmpBrandControlSelected.cgColor + backgroundColor = .backgroundPrimary + layer.borderColor = UIColor.backgroundPrimary.cgColor titleLabel.font = UIFont.bodyStrong(withSize: 20) - titleLabel.textColor = .textTertiary + titleLabel.textColor = .textInverted } else { backgroundColor = Theme.mainBackground - layer.borderColor = UIColor.btnDisabled.cgColor + layer.borderColor = UIColor.backgroundDisabled.cgColor titleLabel.font = UIFont.bodyRegular(withSize: 20) - titleLabel.textColor = .textPrimary + titleLabel.textColor = .text } } } diff --git a/Sources/Charcoal/Filters/Grid/GridFilterViewController.swift b/Sources/Charcoal/Filters/Grid/GridFilterViewController.swift index e7ceecb1..21a7bf23 100644 --- a/Sources/Charcoal/Filters/Grid/GridFilterViewController.swift +++ b/Sources/Charcoal/Filters/Grid/GridFilterViewController.swift @@ -3,6 +3,7 @@ // import FinniversKit +import Warp public final class GridFilterViewController: FilterViewController { private lazy var collectionView: UICollectionView = { @@ -12,7 +13,7 @@ public final class GridFilterViewController: FilterViewController { collectionView.allowsMultipleSelection = true collectionView.dataSource = self collectionView.delegate = self - collectionView.contentInset = UIEdgeInsets(top: .spacingM, left: edgeInset, bottom: 0, right: edgeInset) + collectionView.contentInset = UIEdgeInsets(top: Warp.Spacing.spacing200, left: edgeInset, bottom: 0, right: edgeInset) collectionView.register(GridFilterCell.self) return collectionView }() @@ -98,7 +99,7 @@ extension GridFilterViewController: UICollectionViewDelegateFlowLayout { layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let numberOfItemsPerRow: CGFloat = 5 - let side = ((collectionView.frame.width - edgeInset * 2) / numberOfItemsPerRow) - .spacingS + let side = ((collectionView.frame.width - edgeInset * 2) / numberOfItemsPerRow) - Warp.Spacing.spacing100 return CGSize(width: side, height: side) } @@ -106,7 +107,7 @@ extension GridFilterViewController: UICollectionViewDelegateFlowLayout { public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { - return .spacingS + return Warp.Spacing.spacing100 } public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { diff --git a/Sources/Charcoal/Filters/Inline/InlineFilterView.swift b/Sources/Charcoal/Filters/Inline/InlineFilterView.swift index 04b9dd2b..49f00d26 100644 --- a/Sources/Charcoal/Filters/Inline/InlineFilterView.swift +++ b/Sources/Charcoal/Filters/Inline/InlineFilterView.swift @@ -3,6 +3,7 @@ // import UIKit +import Warp protocol InlineFilterViewDelegate: AnyObject { func inlineFilterView(_ inlineFilteView: InlineFilterView, didChange segment: Segment, at index: Int) @@ -14,7 +15,7 @@ final class InlineFilterView: UIView { weak var delegate: InlineFilterViewDelegate? override var intrinsicContentSize: CGSize { - return CGSize(width: collectionView.bounds.width, height: InlineSegmentCell.cellHeight + .spacingM) + return CGSize(width: collectionView.bounds.width, height: InlineSegmentCell.cellHeight + Warp.Spacing.spacing200) } // MARK: - Private properties @@ -29,7 +30,7 @@ final class InlineFilterView: UIView { collectionView.showsHorizontalScrollIndicator = false collectionView.dataSource = self collectionView.delegate = self - collectionView.contentInset = UIEdgeInsets(top: 0, leading: .spacingM, bottom: 0, trailing: .spacingM) + collectionView.contentInset = UIEdgeInsets(top: 0, leading: Warp.Spacing.spacing200, bottom: 0, trailing: Warp.Spacing.spacing200) collectionView.register(InlineSegmentCell.self) collectionView.translatesAutoresizingMaskIntoConstraints = false return collectionView @@ -118,13 +119,13 @@ extension InlineFilterView: UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { - return .spacingS + return Warp.Spacing.spacing100 } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { - return .spacingS + return Warp.Spacing.spacing100 } } @@ -133,7 +134,7 @@ extension InlineFilterView: UICollectionViewDelegateFlowLayout { private extension InlineFilterView { func setup() { addSubview(collectionView) - collectionView.fillInSuperview(insets: UIEdgeInsets(top: .spacingS, leading: 0, bottom: -.spacingS, trailing: 0)) + collectionView.fillInSuperview(insets: UIEdgeInsets(top: Warp.Spacing.spacing100, leading: 0, bottom: -Warp.Spacing.spacing100, trailing: 0)) collectionView.heightAnchor.constraint(equalToConstant: InlineSegmentCell.cellHeight).isActive = true } diff --git a/Sources/Charcoal/Filters/Inline/SegmentButton.swift b/Sources/Charcoal/Filters/Inline/SegmentButton.swift index ddd7d9a2..92031421 100644 --- a/Sources/Charcoal/Filters/Inline/SegmentButton.swift +++ b/Sources/Charcoal/Filters/Inline/SegmentButton.swift @@ -3,6 +3,7 @@ // import UIKit +import Warp extension SegmentButton { enum BorderStyle { @@ -15,7 +16,7 @@ protocol SegmentButtonDelegate: AnyObject { } final class SegmentButton: UIButton { - static let borderColor: UIColor = .btnDisabled + static let borderColor: UIColor = .backgroundDisabled static let borderWidth: CGFloat = 1.5 weak var delegate: SegmentButtonDelegate? @@ -29,7 +30,7 @@ final class SegmentButton: UIButton { private var borderLayer = CAShapeLayer() private var maskLayer = CAShapeLayer() - private var selectedBackgroundColor: UIColor = .nmpBrandControlSelected + private var selectedBackgroundColor: UIColor = .backgroundPrimary init(title: String) { super.init(frame: .zero) @@ -57,10 +58,10 @@ private extension SegmentButton { titleLabel?.adjustsFontForContentSizeCategory = true setTitle(title, for: .normal) - setTitleColor(.textPrimary, for: .normal) - setTitleColor(.textTertiary, for: .selected) + setTitleColor(.text, for: .normal) + setTitleColor(.textInverted, for: .selected) backgroundColor = Theme.mainBackground - contentEdgeInsets = UIEdgeInsets(top: 0, leading: .spacingM, bottom: 0, trailing: .spacingM) + contentEdgeInsets = UIEdgeInsets(top: 0, leading: Warp.Spacing.spacing200, bottom: 0, trailing: Warp.Spacing.spacing200) borderLayer.lineWidth = SegmentButton.borderWidth borderLayer.fillColor = UIColor.clear.cgColor diff --git a/Sources/Charcoal/Filters/List/ListFilterViewController.swift b/Sources/Charcoal/Filters/List/ListFilterViewController.swift index 00f95f5e..e6a5980e 100644 --- a/Sources/Charcoal/Filters/List/ListFilterViewController.swift +++ b/Sources/Charcoal/Filters/List/ListFilterViewController.swift @@ -3,6 +3,7 @@ // import FinniversKit +import Warp public final class ListFilterViewController: FilterViewController { private enum Section: Int { @@ -107,9 +108,9 @@ public final class ListFilterViewController: FilterViewController { topShadowViewBottomAnchor.isActive = false let searchBarConstraints = [ - searchBar.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: .spacingS), + searchBar.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: Warp.Spacing.spacing100), searchBar.topAnchor.constraint(equalTo: view.topAnchor), - searchBar.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -.spacingS), + searchBar.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -Warp.Spacing.spacing100), topShadowView.bottomAnchor.constraint(equalTo: searchBar.bottomAnchor), tableView.topAnchor.constraint(equalTo: searchBar.bottomAnchor), diff --git a/Sources/Charcoal/Filters/List/Views/ListFilterCell.swift b/Sources/Charcoal/Filters/List/Views/ListFilterCell.swift index d55427a4..64581b72 100644 --- a/Sources/Charcoal/Filters/List/Views/ListFilterCell.swift +++ b/Sources/Charcoal/Filters/List/Views/ListFilterCell.swift @@ -3,6 +3,7 @@ // import FinniversKit +import Warp final class ListFilterCell: CheckboxTableViewCell { private lazy var checkboxImageView = ListFilterImageView(withAutoLayout: true) @@ -89,7 +90,7 @@ final class ListFilterCell: CheckboxTableViewCell { switch viewModel.checkboxStyle { case .selectedBordered: - checkboxImageView.tintColor = .nmpBrandControlSelected + checkboxImageView.tintColor = .backgroundPrimary checkboxImageView.setImage(UIImage(named: .checkboxBordered).withRenderingMode(.alwaysTemplate), for: .normal) checkboxImageView.setImage(UIImage(named: .checkboxBorderedDisabled), for: .disabled) case .selectedFilled: @@ -151,7 +152,7 @@ final class ListFilterCell: CheckboxTableViewCell { private func detailLabelConstraint(constantFor accessoryStyle: ListFilterCellViewModel.AccessoryStyle) -> CGFloat { guard accessoryStyle == .chevron else { return 0 } - return -.spacingS + return -Warp.Spacing.spacing100 } private func showSelectedBackground(_ show: Bool) { diff --git a/Sources/Charcoal/Filters/Map/Polygon/MapPolygonFilterViewController.swift b/Sources/Charcoal/Filters/Map/Polygon/MapPolygonFilterViewController.swift index 898f924b..42af1ba1 100644 --- a/Sources/Charcoal/Filters/Map/Polygon/MapPolygonFilterViewController.swift +++ b/Sources/Charcoal/Filters/Map/Polygon/MapPolygonFilterViewController.swift @@ -570,7 +570,7 @@ extension MapPolygonFilterViewController: MKMapViewDelegate { } polygon.fillColor = state != .invalidPolygon ? MapPolygonFilterView.overlayColor.withAlphaComponent(validPolygonAlphaComponent) : - UIColor.textCritical.withAlphaComponent(invalidPolygonAlphaComponent) + UIColor.textNegative.withAlphaComponent(invalidPolygonAlphaComponent) polygon.lineWidth = 2 // MapKit renders overlays as vectors by default from iOS 13, but we are opting out of it. diff --git a/Sources/Charcoal/Filters/Map/Polygon/Views/InfoView.swift b/Sources/Charcoal/Filters/Map/Polygon/Views/InfoView.swift index 9e443c48..cd90774f 100644 --- a/Sources/Charcoal/Filters/Map/Polygon/Views/InfoView.swift +++ b/Sources/Charcoal/Filters/Map/Polygon/Views/InfoView.swift @@ -4,14 +4,15 @@ import FinniversKit import Foundation +import Warp class InfoView: UIView { // MARK: - Subviews private lazy var boxView: UIView = { let view = UIView(withAutoLayout: true) - view.backgroundColor = .bgPrimary - view.layer.cornerRadius = .spacingM + view.backgroundColor = .background + view.layer.cornerRadius = Warp.Spacing.spacing200 view.dropShadow(color: .black, opacity: 0.2, offset: CGSize(width: 0, height: 1), radius: 5) return view @@ -46,10 +47,10 @@ class InfoView: UIView { boxView.fillInSuperview() NSLayoutConstraint.activate([ - label.topAnchor.constraint(equalTo: boxView.topAnchor, constant: .spacingS), - label.leadingAnchor.constraint(equalTo: boxView.leadingAnchor, constant: .spacingXL), - label.trailingAnchor.constraint(equalTo: boxView.trailingAnchor, constant: -.spacingXL), - label.bottomAnchor.constraint(equalTo: boxView.bottomAnchor, constant: -.spacingS), + label.topAnchor.constraint(equalTo: boxView.topAnchor, constant: Warp.Spacing.spacing100), + label.leadingAnchor.constraint(equalTo: boxView.leadingAnchor, constant: Warp.Spacing.spacing400), + label.trailingAnchor.constraint(equalTo: boxView.trailingAnchor, constant: -Warp.Spacing.spacing400), + label.bottomAnchor.constraint(equalTo: boxView.bottomAnchor, constant: -Warp.Spacing.spacing100), ]) } diff --git a/Sources/Charcoal/Filters/Map/Polygon/Views/MapPolygonFilterView.swift b/Sources/Charcoal/Filters/Map/Polygon/Views/MapPolygonFilterView.swift index a18d3315..ff656ed7 100644 --- a/Sources/Charcoal/Filters/Map/Polygon/Views/MapPolygonFilterView.swift +++ b/Sources/Charcoal/Filters/Map/Polygon/Views/MapPolygonFilterView.swift @@ -5,6 +5,7 @@ import FinniversKit import MapKit import UIKit +import Warp protocol MapPolygonFilterViewDelegate: MKMapViewDelegate { func mapPolygonFilterViewDidSelectLocationButton(_ mapPolygonFilterView: MapPolygonFilterView) @@ -95,7 +96,7 @@ final class MapPolygonFilterView: UIView { private lazy var userLocationButton: UIButton = { let button = CircleButton() - button.imageView?.tintColor = .nmpBrandDecoration + button.imageView?.tintColor = .backgroundPrimary button.setImage(UIImage(named: .locateUserOutlined), for: .normal) button.setImage(UIImage(named: .locateUserFilled), for: .highlighted) button.addTarget(self, action: #selector(didTapLocateUserButton), for: .touchUpInside) @@ -123,7 +124,7 @@ final class MapPolygonFilterView: UIView { .withRenderingMode(.alwaysTemplate), for: .normal) button.imageView?.tintColor = .ice button.adjustsImageWhenHighlighted = false - button.imageEdgeInsets = UIEdgeInsets(leading: -.spacingS) + button.imageEdgeInsets = UIEdgeInsets(leading: -Warp.Spacing.spacing100) return button }() @@ -177,24 +178,24 @@ final class MapPolygonFilterView: UIView { NSLayoutConstraint.activate([ mapContainerView.topAnchor.constraint(greaterThanOrEqualTo: topAnchor), - mapContainerView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM), - mapContainerView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM), + mapContainerView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200), + mapContainerView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200), mapContainerHeightConstraint, - userLocationButton.topAnchor.constraint(equalTo: mapView.safeAreaLayoutGuide.topAnchor, constant: .spacingS), - userLocationButton.trailingAnchor.constraint(equalTo: mapView.trailingAnchor, constant: -.spacingS), + userLocationButton.topAnchor.constraint(equalTo: mapView.safeAreaLayoutGuide.topAnchor, constant: Warp.Spacing.spacing100), + userLocationButton.trailingAnchor.constraint(equalTo: mapView.trailingAnchor, constant: -Warp.Spacing.spacing100), userLocationButton.widthAnchor.constraint(equalToConstant: CircleButton.width), userLocationButton.heightAnchor.constraint(equalTo: userLocationButton.widthAnchor), - redoAreaSelectionButton.topAnchor.constraint(equalTo: mapView.safeAreaLayoutGuide.topAnchor, constant: .spacingS), - redoAreaSelectionButton.leadingAnchor.constraint(equalTo: mapView.leadingAnchor, constant: .spacingS), + redoAreaSelectionButton.topAnchor.constraint(equalTo: mapView.safeAreaLayoutGuide.topAnchor, constant: Warp.Spacing.spacing100), + redoAreaSelectionButton.leadingAnchor.constraint(equalTo: mapView.leadingAnchor, constant: Warp.Spacing.spacing100), redoAreaSelectionButton.widthAnchor.constraint(equalToConstant: CircleButton.width), redoAreaSelectionButton.heightAnchor.constraint(equalTo: redoAreaSelectionButton.widthAnchor), - initialAreaSelectionButton.bottomAnchor.constraint(equalTo: bottomAnchor, constant: 3 * -.spacingS), + initialAreaSelectionButton.bottomAnchor.constraint(equalTo: bottomAnchor, constant: 3 * -Warp.Spacing.spacing100), initialAreaSelectionButton.centerXAnchor.constraint(equalTo: centerXAnchor), - infoView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -.spacingM), + infoView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -Warp.Spacing.spacing200), infoView.centerXAnchor.constraint(equalTo: centerXAnchor), ]) } @@ -211,8 +212,8 @@ final class MapPolygonFilterView: UIView { NSLayoutConstraint.activate([ searchBar.topAnchor.constraint(equalTo: topAnchor), searchBar.bottomAnchor.constraint(equalTo: mapContainerView.topAnchor), - searchBar.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingS), - searchBar.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingS), + searchBar.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing100), + searchBar.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing100), ]) } @@ -224,7 +225,7 @@ final class MapPolygonFilterView: UIView { let updateViewWorkItem = DispatchWorkItem { [weak self] in guard let self = self else { return } self.mapContainerView.isHidden = false - self.mapContainerHeightConstraint.constant = max(self.frame.maxY - .spacingS - self.mapContainerView.frame.minY, 0) + self.mapContainerHeightConstraint.constant = max(self.frame.maxY - Warp.Spacing.spacing100 - self.mapContainerView.frame.minY, 0) } mapContainerView.isHidden = true @@ -419,7 +420,7 @@ private class CircleButton: UIButton { private func setup() { translatesAutoresizingMaskIntoConstraints = false backgroundColor = Theme.mainBackground - tintColor = .nmpBrandDecoration + tintColor = .backgroundPrimary layer.cornerRadius = CircleButton.width / 2 dropShadow(color: .black, opacity: 0.5, offset: CGSize(width: 0, height: 1), radius: 3) diff --git a/Sources/Charcoal/Filters/Map/Radius/MapView/MapRadiusFilterView.swift b/Sources/Charcoal/Filters/Map/Radius/MapView/MapRadiusFilterView.swift index 95385c15..09103739 100644 --- a/Sources/Charcoal/Filters/Map/Radius/MapView/MapRadiusFilterView.swift +++ b/Sources/Charcoal/Filters/Map/Radius/MapView/MapRadiusFilterView.swift @@ -4,6 +4,7 @@ import FinniversKit import MapKit +import Warp protocol MapRadiusFilterViewDelegate: MKMapViewDelegate { func mapRadiusFilterViewDidSelectLocationButton(_ mapRadiusFilterView: MapRadiusFilterView) @@ -84,7 +85,7 @@ final class MapRadiusFilterView: UIView { private lazy var userLocationButton: UIButton = { let button = UIButton(withAutoLayout: true) button.backgroundColor = Theme.mainBackground - button.imageView?.tintColor = .nmpBrandDecoration + button.imageView?.tintColor = .backgroundPrimary button.layer.cornerRadius = MapRadiusFilterView.userLocationButtonWidth / 2 button.layer.shadowColor = UIColor.black.cgColor @@ -114,7 +115,7 @@ final class MapRadiusFilterView: UIView { }() private lazy var bottomConstraint: NSLayoutConstraint = { - distanceSlider.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -.spacingS) + distanceSlider.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -Warp.Spacing.spacing100) }() private lazy var mapContainerHeightConstraint: NSLayoutConstraint = { @@ -152,7 +153,7 @@ final class MapRadiusFilterView: UIView { let updateMapWorkItem = DispatchWorkItem { [weak self, updateRegionWorkItem] in guard let self = self else { return } self.mapContainerView.isHidden = false - self.mapContainerHeightConstraint.constant = max(self.distanceSlider.frame.minY - .spacingM - self.mapContainerView.frame.minY, 0) + self.mapContainerHeightConstraint.constant = max(self.distanceSlider.frame.minY - Warp.Spacing.spacing200 - self.mapContainerView.frame.minY, 0) // Requires a delay to get the correct region set DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(200), execute: updateRegionWorkItem) } @@ -218,16 +219,16 @@ final class MapRadiusFilterView: UIView { NSLayoutConstraint.activate([ mapContainerView.topAnchor.constraint(greaterThanOrEqualTo: topAnchor), - mapContainerView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM), - mapContainerView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM), + mapContainerView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200), + mapContainerView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200), mapContainerHeightConstraint, distanceSlider.leadingAnchor.constraint(equalTo: mapContainerView.leadingAnchor), distanceSlider.trailingAnchor.constraint(equalTo: mapContainerView.trailingAnchor), - distanceSlider.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -.spacingS), + distanceSlider.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -Warp.Spacing.spacing100), - userLocationButton.topAnchor.constraint(equalTo: mapView.safeAreaLayoutGuide.topAnchor, constant: .spacingS), - userLocationButton.trailingAnchor.constraint(equalTo: mapView.trailingAnchor, constant: -.spacingS), + userLocationButton.topAnchor.constraint(equalTo: mapView.safeAreaLayoutGuide.topAnchor, constant: Warp.Spacing.spacing100), + userLocationButton.trailingAnchor.constraint(equalTo: mapView.trailingAnchor, constant: -Warp.Spacing.spacing100), userLocationButton.widthAnchor.constraint(equalToConstant: 46), userLocationButton.heightAnchor.constraint(equalTo: userLocationButton.widthAnchor), ]) @@ -245,8 +246,8 @@ final class MapRadiusFilterView: UIView { NSLayoutConstraint.activate([ searchBar.topAnchor.constraint(equalTo: topAnchor), searchBar.bottomAnchor.constraint(equalTo: mapContainerView.topAnchor), - searchBar.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingS), - searchBar.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingS), + searchBar.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing100), + searchBar.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing100), ]) } } diff --git a/Sources/Charcoal/Filters/Map/Radius/SliderView/ValueSliderView.swift b/Sources/Charcoal/Filters/Map/Radius/SliderView/ValueSliderView.swift index 9a5e78f9..57c34ba5 100644 --- a/Sources/Charcoal/Filters/Map/Radius/SliderView/ValueSliderView.swift +++ b/Sources/Charcoal/Filters/Map/Radius/SliderView/ValueSliderView.swift @@ -4,6 +4,7 @@ import FinniversKit import UIKit +import Warp protocol ValueSliderViewDelegate: AnyObject { func valueViewControl(_ valueSliderView: ValueSliderView, didChangeValue: Int, didFinishSlideInteraction: Bool) @@ -136,8 +137,8 @@ extension ValueSliderView { } struct ValueSliderViewStyle { - static let trackColor: UIColor = .btnDisabled - static let activeRangeTrackColor: UIColor = .nmpBrandControlSelected + static let trackColor: UIColor = .backgroundDisabled + static let activeRangeTrackColor: UIColor = .backgroundPrimary static let trackHeight: CGFloat = 3.0 static let activeRangeTrackHeight: CGFloat = 6.0 } @@ -162,8 +163,8 @@ private extension ValueSliderView { valueSlider.leadingAnchor.constraint(equalTo: leadingAnchor), valueSlider.trailingAnchor.constraint(equalTo: trailingAnchor), - trackView.leadingAnchor.constraint(equalTo: valueSlider.leadingAnchor, constant: .spacingXXS), - trackView.trailingAnchor.constraint(equalTo: valueSlider.trailingAnchor, constant: -.spacingXXS), + trackView.leadingAnchor.constraint(equalTo: valueSlider.leadingAnchor, constant: Warp.Spacing.spacing25), + trackView.trailingAnchor.constraint(equalTo: valueSlider.trailingAnchor, constant: -Warp.Spacing.spacing25), trackView.centerYAnchor.constraint(equalTo: valueSlider.centerYAnchor), trackView.heightAnchor.constraint(equalToConstant: ValueSliderViewStyle.trackHeight), activeRangeTrackViewLeadingAnchor, @@ -171,7 +172,7 @@ private extension ValueSliderView { activeRangeTrackView.centerYAnchor.constraint(equalTo: valueSlider.centerYAnchor), activeRangeTrackView.heightAnchor.constraint(equalToConstant: ValueSliderViewStyle.activeRangeTrackHeight), - referenceValuesContainer.topAnchor.constraint(equalTo: valueSlider.bottomAnchor, constant: .spacingXS), + referenceValuesContainer.topAnchor.constraint(equalTo: valueSlider.bottomAnchor, constant: Warp.Spacing.spacing50), referenceValuesContainer.leadingAnchor.constraint(equalTo: valueSlider.leadingAnchor), referenceValuesContainer.trailingAnchor.constraint(equalTo: valueSlider.trailingAnchor), referenceValuesContainer.bottomAnchor.constraint(equalTo: bottomAnchor), diff --git a/Sources/Charcoal/Filters/Map/Radius/SliderView/ValueSliderWithLabelView.swift b/Sources/Charcoal/Filters/Map/Radius/SliderView/ValueSliderWithLabelView.swift index a01a7ca3..5004a1d5 100644 --- a/Sources/Charcoal/Filters/Map/Radius/SliderView/ValueSliderWithLabelView.swift +++ b/Sources/Charcoal/Filters/Map/Radius/SliderView/ValueSliderWithLabelView.swift @@ -3,6 +3,7 @@ // import UIKit +import Warp protocol SliderValueFormatter: AnyObject { func title(for value: Int) -> String @@ -18,7 +19,7 @@ class ValueSliderWithLabelView: UIView { let label = UILabel(frame: .zero) label.font = .title2 label.adjustsFontForContentSizeCategory = true - label.textColor = .textPrimary + label.textColor = .text label.translatesAutoresizingMaskIntoConstraints = false label.textAlignment = .center label.numberOfLines = 1 @@ -99,12 +100,12 @@ private extension ValueSliderWithLabelView { NSLayoutConstraint.activate([ valueLabel.topAnchor.constraint(equalTo: topAnchor), - valueLabel.leadingAnchor.constraint(greaterThanOrEqualTo: leadingAnchor, constant: .spacingS), - valueLabel.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor, constant: -.spacingS), + valueLabel.leadingAnchor.constraint(greaterThanOrEqualTo: leadingAnchor, constant: Warp.Spacing.spacing100), + valueLabel.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor, constant: -Warp.Spacing.spacing100), valueLabel.centerXAnchor.constraint(equalTo: centerXAnchor), valueLabel.heightAnchor.constraint(equalToConstant: labelHeight), - sliderView.topAnchor.constraint(equalTo: valueLabel.bottomAnchor, constant: .spacingS), + sliderView.topAnchor.constraint(equalTo: valueLabel.bottomAnchor, constant: Warp.Spacing.spacing100), sliderView.leadingAnchor.constraint(equalTo: leadingAnchor), sliderView.trailingAnchor.constraint(equalTo: trailingAnchor), sliderView.bottomAnchor.constraint(equalTo: bottomAnchor), diff --git a/Sources/Charcoal/Filters/Map/SearchLocationViewController.swift b/Sources/Charcoal/Filters/Map/SearchLocationViewController.swift index 225e2f92..0e02ba69 100644 --- a/Sources/Charcoal/Filters/Map/SearchLocationViewController.swift +++ b/Sources/Charcoal/Filters/Map/SearchLocationViewController.swift @@ -5,6 +5,7 @@ import CoreLocation import FinniversKit import UIKit +import Warp public protocol LocationInfo { var name: String { get } @@ -278,16 +279,16 @@ private extension SearchLocationViewController { } func setup() { - view.backgroundColor = UIColor.bgPrimary.withAlphaComponent(0.9) + view.backgroundColor = UIColor.background.withAlphaComponent(0.9) tableView.backgroundColor = UIColor.clear searchBar.removeFromSuperview() view.insertSubview(tableView, belowSubview: topShadowView) view.addSubview(searchBar) NSLayoutConstraint.activate([ - searchBar.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: .spacingS), + searchBar.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: Warp.Spacing.spacing100), searchBar.topAnchor.constraint(equalTo: view.topAnchor), - searchBar.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -.spacingS), + searchBar.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -Warp.Spacing.spacing100), topShadowView.bottomAnchor.constraint(equalTo: searchBar.bottomAnchor), @@ -306,7 +307,7 @@ private class SearchLocationSearchBar: UISearchBar { private static let setupSearchBarAppereanceOnce: () = { let textFieldAppearanceInSearch = UITextField.appearance(whenContainedInInstancesOf: [SearchLocationSearchBar.self]) textFieldAppearanceInSearch.defaultTextAttributes = [ - NSAttributedString.Key.foregroundColor: UIColor.textPrimary, + NSAttributedString.Key.foregroundColor: UIColor.text, NSAttributedString.Key.font: UIFont.bodyRegular, ] diff --git a/Sources/Charcoal/Filters/Range/Input/NumberInputView.swift b/Sources/Charcoal/Filters/Range/Input/NumberInputView.swift index a3fcc925..02a7a456 100644 --- a/Sources/Charcoal/Filters/Range/Input/NumberInputView.swift +++ b/Sources/Charcoal/Filters/Range/Input/NumberInputView.swift @@ -3,6 +3,7 @@ // import UIKit +import Warp public protocol NumberInputViewDelegate: AnyObject { func numberInputViewDidBeginEditing(_ view: NumberInputView) @@ -176,10 +177,10 @@ open class NumberInputView: UIView { textField.topAnchor.constraint(equalTo: topAnchor, constant: 20), textField.leadingAnchor.constraint(equalTo: leadingAnchor), - textField.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -.spacingS), + textField.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -Warp.Spacing.spacing100), unitLabel.topAnchor.constraint(equalTo: textField.topAnchor), - unitLabel.leadingAnchor.constraint(equalTo: textField.trailingAnchor, constant: .spacingS), + unitLabel.leadingAnchor.constraint(equalTo: textField.trailingAnchor, constant: Warp.Spacing.spacing100), unitLabel.bottomAnchor.constraint(equalTo: textField.bottomAnchor), unitLabel.trailingAnchor.constraint(equalTo: trailingAnchor), @@ -198,7 +199,7 @@ open class NumberInputView: UIView { private func attributedUnitText(withFont font: UIFont?, from unit: FilterUnit) -> NSAttributedString { let style = NSMutableParagraphStyle() style.alignment = .justified - style.headIndent = .spacingS + style.headIndent = Warp.Spacing.spacing100 style.lineBreakMode = .byCharWrapping let attributes = [ @@ -264,12 +265,12 @@ extension NumberInputView: UITextFieldDelegate { // MARK: - Styles private struct Style { - static let textColor: UIColor = .textPrimary - static let errorTextColor: UIColor = .textCritical + static let textColor: UIColor = .text + static let errorTextColor: UIColor = .textNegative static let hintNormalFont: UIFont = .body static let hintActiveFont: UIFont = .bodyStrong - static let decorationViewColor: UIColor = .textSecondary - static let decorationViewActiveColor: UIColor = .nmpBrandControlSelected + static let decorationViewColor: UIColor = .textSubtle + static let decorationViewActiveColor: UIColor = .backgroundPrimary static let decorationViewHeight: CGFloat = 1.0 static let decorationViewActiveHeight: CGFloat = 3.0 static let decorationViewActiveCornerRadius = decorationViewActiveHeight / 2 @@ -315,7 +316,7 @@ private extension UIToolbar { let items: [RangeToolbarItem] = [ .arrow(imageAsset: .arrowLeft, target: previousTextField), - .fixedSpace(width: .spacingM), + .fixedSpace(width: Warp.Spacing.spacing200), .arrow(imageAsset: .arrowRight, target: nextTextField), .flexibleSpace, .done(target: target), diff --git a/Sources/Charcoal/Filters/Range/Input/RangeNumberInputView.swift b/Sources/Charcoal/Filters/Range/Input/RangeNumberInputView.swift index 0f353a6c..53132a6b 100644 --- a/Sources/Charcoal/Filters/Range/Input/RangeNumberInputView.swift +++ b/Sources/Charcoal/Filters/Range/Input/RangeNumberInputView.swift @@ -3,6 +3,7 @@ // import UIKit +import Warp protocol RangeNumberInputViewDelegate: AnyObject { func rangeNumberInputView(_ view: RangeNumberInputView, didChangeLowValue value: Int?) @@ -46,7 +47,7 @@ final class RangeNumberInputView: UIView { private lazy var inputSeparatorView: UILabel = { let label = UILabel(withAutoLayout: true) label.text = "-" - label.textColor = .textPrimary + label.textColor = .text label.font = UIFont.body(withSize: fontSize.rawValue) label.adjustsFontForContentSizeCategory = true label.isAccessibilityElement = false @@ -149,15 +150,15 @@ final class RangeNumberInputView: UIView { addSubview(inputSeparatorView) NSLayoutConstraint.activate([ - lowValueInputView.topAnchor.constraint(equalTo: topAnchor, constant: .spacingXL), - lowValueInputView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -.spacingS), + lowValueInputView.topAnchor.constraint(equalTo: topAnchor, constant: Warp.Spacing.spacing400), + lowValueInputView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -Warp.Spacing.spacing100), lowValueInputView.leadingAnchor.constraint(greaterThanOrEqualTo: leadingAnchor), - lowValueInputView.trailingAnchor.constraint(equalTo: inputSeparatorView.leadingAnchor, constant: -.spacingS), + lowValueInputView.trailingAnchor.constraint(equalTo: inputSeparatorView.leadingAnchor, constant: -Warp.Spacing.spacing100), lowValueInputView.widthAnchor.constraint(lessThanOrEqualTo: widthAnchor, multiplier: 0.6), - highValueInputView.topAnchor.constraint(equalTo: topAnchor, constant: .spacingXL), - highValueInputView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -.spacingS), - highValueInputView.leadingAnchor.constraint(equalTo: inputSeparatorView.trailingAnchor, constant: .spacingS), + highValueInputView.topAnchor.constraint(equalTo: topAnchor, constant: Warp.Spacing.spacing400), + highValueInputView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -Warp.Spacing.spacing100), + highValueInputView.leadingAnchor.constraint(equalTo: inputSeparatorView.trailingAnchor, constant: Warp.Spacing.spacing100), highValueInputView.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor), highValueInputView.widthAnchor.constraint(lessThanOrEqualTo: widthAnchor, multiplier: 0.6), diff --git a/Sources/Charcoal/Filters/Range/Input/RangeToolbarItem.swift b/Sources/Charcoal/Filters/Range/Input/RangeToolbarItem.swift index 859f7674..707c551e 100644 --- a/Sources/Charcoal/Filters/Range/Input/RangeToolbarItem.swift +++ b/Sources/Charcoal/Filters/Range/Input/RangeToolbarItem.swift @@ -3,6 +3,7 @@ // import UIKit +import Warp enum RangeToolbarItem { case arrow(imageAsset: CharcoalImageAsset, target: UITextField?) @@ -15,7 +16,7 @@ enum RangeToolbarItem { case let .arrow(imageAsset, target): let image = UIImage(named: imageAsset) let button = UIBarButtonItem(image: image, style: .plain, target: nil, action: nil) - button.width = .spacingXL + button.width = Warp.Spacing.spacing400 if let target = target { button.target = target diff --git a/Sources/Charcoal/Filters/Range/RangeFilterView.swift b/Sources/Charcoal/Filters/Range/RangeFilterView.swift index e1d2f6c8..6713fb17 100644 --- a/Sources/Charcoal/Filters/Range/RangeFilterView.swift +++ b/Sources/Charcoal/Filters/Range/RangeFilterView.swift @@ -4,6 +4,7 @@ import FinniversKit import UIKit +import Warp protocol RangeFilterViewDelegate: AnyObject { func rangeFilterView(_ rangeFilterView: RangeFilterView, didSetLowValue lowValue: Int?) @@ -146,15 +147,15 @@ extension RangeFilterView { NSLayoutConstraint.activate([ numberInputView.topAnchor.constraint(equalTo: topAnchor), - numberInputView.leadingAnchor.constraint(greaterThanOrEqualTo: leadingAnchor, constant: .spacingS), - numberInputView.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor, constant: -.spacingS), + numberInputView.leadingAnchor.constraint(greaterThanOrEqualTo: leadingAnchor, constant: Warp.Spacing.spacing100), + numberInputView.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor, constant: -Warp.Spacing.spacing100), numberInputView.centerXAnchor.constraint(equalTo: centerXAnchor), sliderInputView.topAnchor.constraint(equalTo: numberInputView.bottomAnchor, constant: 50), - sliderInputView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM), - sliderInputView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM), + sliderInputView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200), + sliderInputView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200), - referenceValuesContainer.topAnchor.constraint(equalTo: sliderInputView.bottomAnchor, constant: .spacingXS), + referenceValuesContainer.topAnchor.constraint(equalTo: sliderInputView.bottomAnchor, constant: Warp.Spacing.spacing50), referenceValuesContainer.leadingAnchor.constraint(equalTo: sliderInputView.leadingAnchor), referenceValuesContainer.bottomAnchor.constraint(equalTo: bottomAnchor), referenceValuesContainer.trailingAnchor.constraint(equalTo: sliderInputView.trailingAnchor), diff --git a/Sources/Charcoal/Filters/Range/Slider/RangeSliderView.swift b/Sources/Charcoal/Filters/Range/Slider/RangeSliderView.swift index cfdbf0cb..4ae69366 100644 --- a/Sources/Charcoal/Filters/Range/Slider/RangeSliderView.swift +++ b/Sources/Charcoal/Filters/Range/Slider/RangeSliderView.swift @@ -4,6 +4,7 @@ import FinniversKit import UIKit +import Warp protocol RangeSliderViewDelegate: AnyObject { func rangeSliderView(_ rangeSliderView: RangeSliderView, didChangeLowStep: Step) @@ -173,8 +174,8 @@ extension RangeSliderView { highValueSlider.leadingAnchor.constraint(equalTo: leadingAnchor, constant: sliderOffset), highValueSlider.trailingAnchor.constraint(equalTo: trailingAnchor), - trackView.leadingAnchor.constraint(equalTo: lowValueSlider.leadingAnchor, constant: .spacingXXS), - trackView.trailingAnchor.constraint(equalTo: highValueSlider.trailingAnchor, constant: -.spacingXXS), + trackView.leadingAnchor.constraint(equalTo: lowValueSlider.leadingAnchor, constant: Warp.Spacing.spacing25), + trackView.trailingAnchor.constraint(equalTo: highValueSlider.trailingAnchor, constant: -Warp.Spacing.spacing25), trackView.centerYAnchor.constraint(equalTo: lowValueSlider.centerYAnchor), trackView.heightAnchor.constraint(equalToConstant: Style.trackHeight), activeRangeTrackViewLeadingAnchor, @@ -268,8 +269,8 @@ extension RangeSliderView: StepSliderDelegate { extension RangeSliderView { struct Style { - static let trackColor: UIColor = .btnDisabled - static let activeRangeTrackColor: UIColor = .nmpBrandControlSelected + static let trackColor: UIColor = .backgroundDisabled + static let activeRangeTrackColor: UIColor = .backgroundPrimary static let trackHeight: CGFloat = 3.0 static let activeRangeTrackHeight: CGFloat = 6.0 } diff --git a/Sources/Charcoal/Filters/Range/Slider/SliderReferenceValueView.swift b/Sources/Charcoal/Filters/Range/Slider/SliderReferenceValueView.swift index 8a17c46a..eaf9e2ca 100644 --- a/Sources/Charcoal/Filters/Range/Slider/SliderReferenceValueView.swift +++ b/Sources/Charcoal/Filters/Range/Slider/SliderReferenceValueView.swift @@ -3,6 +3,7 @@ // import UIKit +import Warp final class SliderReferenceValueView: UIView { weak var leadingConstraint: NSLayoutConstraint? @@ -25,7 +26,7 @@ final class SliderReferenceValueView: UIView { label.translatesAutoresizingMaskIntoConstraints = false label.font = UIFont.caption.withSize(12).scaledFont(forTextStyle: .footnote) label.adjustsFontForContentSizeCategory = true - label.textColor = .textPrimary + label.textColor = .text label.textAlignment = .center label.text = displayText label.isAccessibilityElement = false @@ -59,7 +60,7 @@ final class SliderReferenceValueView: UIView { indicatorView.widthAnchor.constraint(equalToConstant: 4), indicatorView.heightAnchor.constraint(equalToConstant: 4), - referenceLabel.topAnchor.constraint(equalTo: indicatorView.bottomAnchor, constant: .spacingS), + referenceLabel.topAnchor.constraint(equalTo: indicatorView.bottomAnchor, constant: Warp.Spacing.spacing100), referenceLabel.leadingAnchor.constraint(equalTo: leadingAnchor), referenceLabel.bottomAnchor.constraint(equalTo: bottomAnchor), referenceLabel.trailingAnchor.constraint(equalTo: trailingAnchor), diff --git a/Sources/Charcoal/Filters/Root/RootFilterViewController.swift b/Sources/Charcoal/Filters/Root/RootFilterViewController.swift index 019a7468..7a38dd1b 100644 --- a/Sources/Charcoal/Filters/Root/RootFilterViewController.swift +++ b/Sources/Charcoal/Filters/Root/RootFilterViewController.swift @@ -3,6 +3,7 @@ // import UIKit +import Warp protocol RootFilterViewControllerDelegate: AnyObject { func rootFilterViewControllerDidResetAllFilters(_ viewController: RootFilterViewController) @@ -53,7 +54,7 @@ final class RootFilterViewController: FilterViewController { let action = #selector(handleResetButtonTap) let button = UIBarButtonItem(title: "reset".localized(), style: .plain, target: self, action: action) let font = UIFont.bodyStrong - let textColor = UIColor.textPrimary + let textColor = UIColor.text button.setTitleTextAttributes([.font: font, .foregroundColor: textColor]) button.setTitleTextAttributes([.font: font, .foregroundColor: textColor.withAlphaComponent(0.3)], for: .disabled) return button @@ -414,7 +415,7 @@ extension RootFilterViewController: VerticalSelectorViewDelegate { add(verticalViewController) verticalViewController.verticals = verticals verticalViewController.view.alpha = 0.6 - verticalViewController.view.frame.origin.y = -.spacingXL + verticalViewController.view.frame.origin.y = -Warp.Spacing.spacing400 UIView.animate(withDuration: 0.1, animations: { [weak self] in self?.verticalViewController.view.alpha = 1 @@ -438,7 +439,7 @@ extension RootFilterViewController: VerticalSelectorViewDelegate { bottomButton.alpha = 0 UIView.animate(withDuration: 0.2, delay: 0, options: .curveEaseInOut, animations: ({ [weak self] in - self?.verticalViewController.view.frame.origin.y = -.spacingXXL + self?.verticalViewController.view.frame.origin.y = -Warp.Spacing.spacing800 self?.verticalViewController.view.alpha = 0 }), completion: ({ [weak self] _ in self?.verticalViewController.remove() @@ -521,8 +522,8 @@ private extension RootFilterViewController { NSLayoutConstraint.activate([ searchBarTopConstraint, - freeTextFilterViewController?.searchBar.leadingAnchor.constraint(equalTo: tableView.leadingAnchor, constant: .spacingS), - freeTextFilterViewController?.searchBar.widthAnchor.constraint(equalTo: tableView.widthAnchor, constant: -.spacingM), + freeTextFilterViewController?.searchBar.leadingAnchor.constraint(equalTo: tableView.leadingAnchor, constant: Warp.Spacing.spacing100), + freeTextFilterViewController?.searchBar.widthAnchor.constraint(equalTo: tableView.widthAnchor, constant: -Warp.Spacing.spacing200), ].compactMap({ $0 })) } diff --git a/Sources/Charcoal/Filters/Root/Views/CalloutOverlay.swift b/Sources/Charcoal/Filters/Root/Views/CalloutOverlay.swift index 369ccdba..fd467eeb 100644 --- a/Sources/Charcoal/Filters/Root/Views/CalloutOverlay.swift +++ b/Sources/Charcoal/Filters/Root/Views/CalloutOverlay.swift @@ -3,6 +3,7 @@ // import FinniversKit +import Warp protocol CalloutOverlayDelegate: AnyObject { func calloutOverlayDidTapInside(_ view: CalloutOverlay) @@ -97,9 +98,9 @@ final class CalloutOverlay: UIView { case .center: constraints.append(calloutView.centerXAnchor.constraint(equalTo: centerXAnchor)) case .left: - constraints.append(calloutView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM)) + constraints.append(calloutView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200)) case .right: - constraints.append(calloutView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM)) + constraints.append(calloutView.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200)) } if let directionalConstraints = directionalConstraints { diff --git a/Sources/Charcoal/Filters/Root/Views/FilterBottomButtonView.swift b/Sources/Charcoal/Filters/Root/Views/FilterBottomButtonView.swift index 926c504c..8f5f1e6d 100644 --- a/Sources/Charcoal/Filters/Root/Views/FilterBottomButtonView.swift +++ b/Sources/Charcoal/Filters/Root/Views/FilterBottomButtonView.swift @@ -3,6 +3,7 @@ // import FinniversKit +import Warp protocol FilterBottomButtonViewDelegate: AnyObject { func filterBottomButtonView(_ filterBottomButtonView: FilterBottomButtonView, didTapButton button: UIButton) @@ -21,7 +22,7 @@ class FilterBottomButtonView: ShadowView { override var intrinsicContentSize: CGSize { return CGSize(width: button.intrinsicContentSize.width, - height: button.intrinsicContentSize.height + .spacingXL + windowSafeAreaInsets.bottom) + height: button.intrinsicContentSize.height + Warp.Spacing.spacing400 + windowSafeAreaInsets.bottom) } var isEnabled = true { @@ -45,12 +46,12 @@ private extension FilterBottomButtonView { func setup() { addSubview(button) - let bottomConstant: CGFloat = .spacingM + windowSafeAreaInsets.bottom + let bottomConstant: CGFloat = Warp.Spacing.spacing200 + windowSafeAreaInsets.bottom NSLayoutConstraint.activate([ - button.topAnchor.constraint(equalTo: topAnchor, constant: .spacingM), - button.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM), - button.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -.spacingM), + button.topAnchor.constraint(equalTo: topAnchor, constant: Warp.Spacing.spacing200), + button.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200), + button.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing200), button.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -bottomConstant), ]) } diff --git a/Sources/Charcoal/Filters/Root/Views/RootFilterCell.swift b/Sources/Charcoal/Filters/Root/Views/RootFilterCell.swift index 085fb30c..5f0f4ae2 100644 --- a/Sources/Charcoal/Filters/Root/Views/RootFilterCell.swift +++ b/Sources/Charcoal/Filters/Root/Views/RootFilterCell.swift @@ -3,6 +3,7 @@ // import FinniversKit +import Warp protocol RootFilterCellDelegate: AnyObject { func rootFilterCell(_ cell: RootFilterCell, didRemoveTagAt index: Int) @@ -48,13 +49,13 @@ final class RootFilterCell: BasicTableViewCell { private lazy var hairLine: UIView = { let view = UIView(withAutoLayout: true) - view.backgroundColor = .tableViewSeparator + view.backgroundColor = .border return view }() private lazy var stackViewToContextMarkConstraint = stackView.leadingAnchor.constraint( equalTo: contextMark.trailingAnchor, - constant: .spacingS + constant: Warp.Spacing.spacing100 ) // MARK: - Init @@ -109,7 +110,7 @@ final class RootFilterCell: BasicTableViewCell { titleLabel.font = .bodyRegular titleLabel.adjustsFontForContentSizeCategory = true - titleLabel.textColor = .textPrimary + titleLabel.textColor = .text setContextMarkBackground() @@ -117,26 +118,26 @@ final class RootFilterCell: BasicTableViewCell { contentView.addSubview(selectionTagsContainerView) contentView.addSubview(hairLine) - stackViewLeadingAnchorConstraint.constant = .spacingM + .spacingS - stackViewTopAnchorConstraint.constant = .spacingM - stackViewBottomAnchorConstraint.constant = -.spacingM + stackViewLeadingAnchorConstraint.constant = Warp.Spacing.spacing200 + Warp.Spacing.spacing100 + stackViewTopAnchorConstraint.constant = Warp.Spacing.spacing200 + stackViewBottomAnchorConstraint.constant = -Warp.Spacing.spacing200 - var selectionTagsContainerTrailingConstant: CGFloat = .spacingXS - selectionTagsContainerTrailingConstant -= .spacingS + var selectionTagsContainerTrailingConstant: CGFloat = Warp.Spacing.spacing50 + selectionTagsContainerTrailingConstant -= Warp.Spacing.spacing100 NSLayoutConstraint.activate([ - contextMark.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: .spacingM + .spacingS), + contextMark.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: Warp.Spacing.spacing200 + Warp.Spacing.spacing100), contextMark.centerYAnchor.constraint(equalTo: contentView.centerYAnchor), contextMark.widthAnchor.constraint(equalToConstant: 10), contextMark.heightAnchor.constraint(equalToConstant: 10), selectionTagsContainerView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor), - selectionTagsContainerView.leadingAnchor.constraint(equalTo: titleLabel.trailingAnchor, constant: .spacingM), + selectionTagsContainerView.leadingAnchor.constraint(equalTo: titleLabel.trailingAnchor, constant: Warp.Spacing.spacing200), selectionTagsContainerView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: selectionTagsContainerTrailingConstant), hairLine.heightAnchor.constraint(equalToConstant: 1.0 / UIScreen.main.scale), hairLine.bottomAnchor.constraint(equalTo: bottomAnchor), - hairLine.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: .spacingM + .spacingS), + hairLine.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: Warp.Spacing.spacing200 + Warp.Spacing.spacing100), hairLine.trailingAnchor.constraint(equalTo: trailingAnchor), ]) } diff --git a/Sources/Charcoal/Filters/Root/Views/VerticalSelectorView.swift b/Sources/Charcoal/Filters/Root/Views/VerticalSelectorView.swift index 1925c84b..03bc28ed 100644 --- a/Sources/Charcoal/Filters/Root/Views/VerticalSelectorView.swift +++ b/Sources/Charcoal/Filters/Root/Views/VerticalSelectorView.swift @@ -3,6 +3,7 @@ // import FinniversKit +import Warp protocol VerticalSelectorViewDelegate: AnyObject { func verticalSelectorViewDidSelectButton(_ view: VerticalSelectorView) @@ -33,7 +34,7 @@ final class VerticalSelectorView: UIView { let label = UILabel(withAutoLayout: true) label.font = UIFont.captionStrong.withSize(12).scaledFont(forTextStyle: .footnote) label.adjustsFontForContentSizeCategory = true - label.textColor = .textSecondary + label.textColor = .textSubtle label.textAlignment = .center return label }() @@ -43,22 +44,22 @@ final class VerticalSelectorView: UIView { button.titleLabel?.font = UIFont.bodyStrong(withSize: 17, textStyle: .footnote) button.titleLabel?.adjustsFontForContentSizeCategory = true - button.tintColor = .textAction - button.setTitleColor(.textAction, for: .normal) + button.tintColor = .textLink + button.setTitleColor(.textLink, for: .normal) button.setTitleColor(.callToActionButtonHighlightedBodyColor, for: .highlighted) button.setTitleColor(.callToActionButtonHighlightedBodyColor, for: .selected) - button.setTitleColor(UIColor.textAction.withAlphaComponent(0.5), for: .disabled) + button.setTitleColor(UIColor.textLink.withAlphaComponent(0.5), for: .disabled) - let spacing = .spacingXS / 2 + let spacing = Warp.Spacing.spacing50 / 2 button.semanticContentAttribute = .forceRightToLeft button.imageEdgeInsets = UIEdgeInsets(top: spacing, leading: spacing, bottom: 0, trailing: -spacing) button.titleEdgeInsets = UIEdgeInsets(top: 0, leading: -spacing, bottom: 0, trailing: spacing) button.contentEdgeInsets = UIEdgeInsets( top: titleLabel.font.pointSize, - leading: .spacingM + spacing, + leading: Warp.Spacing.spacing200 + spacing, bottom: 0, - trailing: .spacingM + spacing + trailing: Warp.Spacing.spacing200 + spacing ) button.addTarget(self, action: #selector(handleButtonTap), for: .touchUpInside) diff --git a/Sources/Charcoal/Filters/Stepper/StepperFilterView.swift b/Sources/Charcoal/Filters/Stepper/StepperFilterView.swift index da752273..2ea96c7e 100644 --- a/Sources/Charcoal/Filters/Stepper/StepperFilterView.swift +++ b/Sources/Charcoal/Filters/Stepper/StepperFilterView.swift @@ -3,6 +3,7 @@ // import UIKit +import Warp extension StepperFilterView { enum ButtonType: Int { @@ -26,14 +27,14 @@ final class StepperFilterView: UIControl { label.text = "\(value)+ \(unit)" label.font = .title2 label.adjustsFontForContentSizeCategory = true - label.textColor = .textPrimary + label.textColor = .text label.numberOfLines = 0 label.translatesAutoresizingMaskIntoConstraints = false return label }() - private let activeColor = UIColor.nmpBrandControlSelected - private let deactiveColor = UIColor.nmpBrandControlSelected.withAlphaComponent(0.2) + private let activeColor = UIColor.backgroundPrimary + private let deactiveColor = UIColor.backgroundPrimary.withAlphaComponent(0.2) private lazy var minusButton: UIButton = { let button = UIButton(type: .system) @@ -150,14 +151,14 @@ private extension StepperFilterView { NSLayoutConstraint.activate([ textLabel.centerYAnchor.constraint(equalTo: minusButton.centerYAnchor), textLabel.centerXAnchor.constraint(equalTo: centerXAnchor), - textLabel.leadingAnchor.constraint(greaterThanOrEqualTo: minusButton.trailingAnchor, constant: .spacingXS), - textLabel.trailingAnchor.constraint(lessThanOrEqualTo: plusButton.leadingAnchor, constant: -.spacingXS), + textLabel.leadingAnchor.constraint(greaterThanOrEqualTo: minusButton.trailingAnchor, constant: Warp.Spacing.spacing50), + textLabel.trailingAnchor.constraint(lessThanOrEqualTo: plusButton.leadingAnchor, constant: -Warp.Spacing.spacing50), - minusButton.topAnchor.constraint(equalTo: topAnchor, constant: .spacingS), + minusButton.topAnchor.constraint(equalTo: topAnchor, constant: Warp.Spacing.spacing100), minusButton.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 24), minusButton.widthAnchor.constraint(equalToConstant: 58), minusButton.heightAnchor.constraint(equalToConstant: 58), - minusButton.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -.spacingS), + minusButton.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -Warp.Spacing.spacing100), plusButton.topAnchor.constraint(equalTo: minusButton.topAnchor), plusButton.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -24), diff --git a/Sources/Charcoal/Loading/LoadingViewController.swift b/Sources/Charcoal/Loading/LoadingViewController.swift index b0bc9af8..264848f5 100644 --- a/Sources/Charcoal/Loading/LoadingViewController.swift +++ b/Sources/Charcoal/Loading/LoadingViewController.swift @@ -3,6 +3,7 @@ // import FinniversKit +import Warp final class LoadingViewController: UIViewController { private let backgroundColor: UIColor @@ -17,7 +18,7 @@ final class LoadingViewController: UIViewController { // MARK: - Init - init(backgroundColor: UIColor = UIColor.bgPrimary.withAlphaComponent(0.8), presentationDelay: Double = 0.5) { + init(backgroundColor: UIColor = UIColor.background.withAlphaComponent(0.8), presentationDelay: Double = 0.5) { self.backgroundColor = backgroundColor self.presentationDelay = presentationDelay super.init(nibName: nil, bundle: nil) @@ -39,7 +40,7 @@ final class LoadingViewController: UIViewController { loadingIndicatorView.widthAnchor.constraint(equalToConstant: loadingIndicatorSize), loadingIndicatorView.heightAnchor.constraint(equalToConstant: loadingIndicatorSize), loadingIndicatorView.centerXAnchor.constraint(equalTo: view.centerXAnchor), - loadingIndicatorView.centerYAnchor.constraint(equalTo: view.centerYAnchor, constant: -.spacingS), + loadingIndicatorView.centerYAnchor.constraint(equalTo: view.centerYAnchor, constant: -Warp.Spacing.spacing100), ]) } diff --git a/Sources/Charcoal/Selection/Views/SelectionTagViewCell.swift b/Sources/Charcoal/Selection/Views/SelectionTagViewCell.swift index 9088af9e..f26525e7 100644 --- a/Sources/Charcoal/Selection/Views/SelectionTagViewCell.swift +++ b/Sources/Charcoal/Selection/Views/SelectionTagViewCell.swift @@ -3,6 +3,7 @@ // import UIKit +import Warp protocol SelectionTagViewCellDelegate: AnyObject { func selectionTagViewCellDidSelectRemove(_ cell: SelectionTagViewCell) @@ -17,7 +18,7 @@ final class SelectionTagViewCell: UICollectionViewCell { let label = UILabel(withAutoLayout: true) label.font = SelectionTagViewCell.titleFont label.adjustsFontForContentSizeCategory = true - label.textColor = .textTertiary + label.textColor = .textInverted label.textAlignment = .center return label }() @@ -31,7 +32,7 @@ final class SelectionTagViewCell: UICollectionViewCell { return button }() - private let defaultBackgroundColor: UIColor = .nmpBrandControlSelected + private let defaultBackgroundColor: UIColor = .backgroundPrimary // MARK: - Init @@ -63,7 +64,7 @@ final class SelectionTagViewCell: UICollectionViewCell { // MARK: - Setup func configure(withTitle title: SelectionTitle?, isValid: Bool) { - backgroundColor = isValid ? defaultBackgroundColor : .btnCritical + backgroundColor = isValid ? defaultBackgroundColor : .backgroundNegative titleLabel.text = title?.value titleLabel.accessibilityLabel = title?.accessibilityLabel @@ -119,8 +120,8 @@ extension SelectionTagViewCell { } private static let titleFont = UIFont.detailStrong - private static let titleLeading: CGFloat = .spacingS - private static let removeButtonEdgeInsets = UIEdgeInsets(leading: .spacingS, trailing: .spacingS) + private static let titleLeading: CGFloat = Warp.Spacing.spacing100 + private static let removeButtonEdgeInsets = UIEdgeInsets(leading: Warp.Spacing.spacing100, trailing: Warp.Spacing.spacing100) private static var removeButtonWidth: CGFloat { return 14 + removeButtonEdgeInsets.leading + removeButtonEdgeInsets.trailing diff --git a/Sources/Charcoal/Selection/Views/SelectionTagsContainerView.swift b/Sources/Charcoal/Selection/Views/SelectionTagsContainerView.swift index 411c7319..aeef7327 100644 --- a/Sources/Charcoal/Selection/Views/SelectionTagsContainerView.swift +++ b/Sources/Charcoal/Selection/Views/SelectionTagsContainerView.swift @@ -3,6 +3,7 @@ // import UIKit +import Warp protocol SelectionTagsContainerViewDelegate: AnyObject { func selectionTagsContainerView(_ view: SelectionTagsContainerView, didRemoveTagAt index: Int) @@ -19,7 +20,7 @@ final class SelectionTagsContainerView: UIView { private lazy var collectionViewLayout: UICollectionViewLayout = { let layout = UICollectionViewFlowLayout() layout.scrollDirection = .horizontal - layout.minimumLineSpacing = .spacingS + layout.minimumLineSpacing = Warp.Spacing.spacing100 return layout }() diff --git a/Sources/Charcoal/Theme.swift b/Sources/Charcoal/Theme.swift index 67b3283a..0b07b916 100644 --- a/Sources/Charcoal/Theme.swift +++ b/Sources/Charcoal/Theme.swift @@ -9,5 +9,5 @@ public class Theme { /// The background used for charcoal will be different in dark mode than the standard FinniversKit as charcoal /// components are presented on top of other elements, then in order to achieve more contrast and a sense of levels /// we need to override the value for the main background color for dark mode. - public static var mainBackground: UIColor = .bgBottomSheet + public static var mainBackground: UIColor = .background } diff --git a/Sources/Charcoal/Vertical/VerticalCell.swift b/Sources/Charcoal/Vertical/VerticalCell.swift index 2f88b7e7..7fd35c78 100644 --- a/Sources/Charcoal/Vertical/VerticalCell.swift +++ b/Sources/Charcoal/Vertical/VerticalCell.swift @@ -4,6 +4,7 @@ import FinniversKit import UIKit +import Warp final class VerticalCell: UITableViewCell { private lazy var radioButton: RadioButtonView = { @@ -77,7 +78,7 @@ final class VerticalCell: UITableViewCell { if let calloutText = vertical.calloutText, let textLabel = textLabel { addSubview(calloutView) NSLayoutConstraint.activate([ - calloutView.leadingAnchor.constraint(equalTo: textLabel.trailingAnchor, constant: .spacingM), + calloutView.leadingAnchor.constraint(equalTo: textLabel.trailingAnchor, constant: Warp.Spacing.spacing200), calloutView.centerYAnchor.constraint(equalTo: centerYAnchor), calloutView.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor), ]) @@ -96,7 +97,7 @@ final class VerticalCell: UITableViewCell { separatorInset = .leadingInset(56) textLabel?.font = .bodyRegular - textLabel?.textColor = .textPrimary + textLabel?.textColor = .text textLabel?.adjustsFontForContentSizeCategory = true addSubview(radioButton) @@ -104,10 +105,10 @@ final class VerticalCell: UITableViewCell { externalVerticalIcon.isHidden = true NSLayoutConstraint.activate([ - radioButton.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM), + radioButton.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200), radioButton.centerYAnchor.constraint(equalTo: centerYAnchor), - externalVerticalIcon.leadingAnchor.constraint(equalTo: leadingAnchor, constant: .spacingM + .spacingXS), + externalVerticalIcon.leadingAnchor.constraint(equalTo: leadingAnchor, constant: Warp.Spacing.spacing200 + Warp.Spacing.spacing50), externalVerticalIcon.centerYAnchor.constraint(equalTo: centerYAnchor), ]) }