Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Backpack-Common/BackpackCommonImports.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
* limitations under the License.
*/

@_exported import Foundation
@_exported import UIKit
import Foundation
import UIKit
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

import Foundation
import UIKit

final class CarouselContentViewController: UIViewController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

import Foundation
import UIKit

final class CarouselPageViewController: UIPageViewController {

Expand Down
2 changes: 2 additions & 0 deletions Backpack-Common/Configuration/Fonts/BPKFontDefinition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

import Foundation

@objc public protocol BPKFontDefinitionProtocol: NSObjectProtocol {
var fontFamily: NSString { get }
var regularFontFace: NSString { get }
Expand Down
6 changes: 3 additions & 3 deletions Backpack-SwiftUI/BackpackSwiftUIImports.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
* limitations under the License.
*/

@_exported import Foundation
@_exported import SwiftUI
@_exported import UIKit
import Foundation
import SwiftUI
import UIKit
4 changes: 4 additions & 0 deletions Backpack-SwiftUI/Button/Classes/BPKButtonColorSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
*/

// swiftlint:disable indentation_width
import UIKit
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UIKit import appears unnecessary for a SwiftUI component. SwiftUI color types don't require UIKit. Consider removing this import unless there's a specific UIKit dependency in the implementation.

Suggested change
import UIKit

Copilot uses AI. Check for mistakes.
import Backpack_Common
#if SWIFT_PACKAGE
import BackpackTokens
#endif

protocol BPKButtonColorSet {
var regular: BPKButtonColors { get }
Expand Down
4 changes: 4 additions & 0 deletions Backpack-SwiftUI/Button/Classes/BPKButtonColors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
* limitations under the License.
*/

#if SWIFT_PACKAGE
import BackpackTokens
#endif

struct BPKButtonColors {
let background: BPKColor
let foreground: BPKColor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

import Foundation

/// Create a multi-selection configuration with given accessibility strings.
/// - Parameters:
/// - rangeAccessibilityLabels: The eunmaration with a hint and a state selection accessibility labels
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

import Foundation

public enum RangeAccessibilityLabelsConfigurations {
case dynamic(accessibilityLabelCallback: ((Date) -> (label: String, hint: String)))
case predefined(start: AccessibilityLabels, end: AccessibilityLabels)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

import Foundation

/// Create a single-selection configuration with given accessibility strings.
/// - Parameters:
/// - selectionHint: The hint provided to assistive technologies informing a user how to select a date.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

import Foundation

protocol CalendarGridCalculator {
func calculateCalendarGrid(monthDate: Date) -> [[Date?]]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
* limitations under the License.
*/

import Foundation
import SwiftUI
#if SWIFT_PACKAGE
import BackpackTokens
#endif

struct RangeCalendarMonthContainer<DayAccessoryView: View>: View {
@Binding var selectionState: CalendarRangeSelectionState?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

import Foundation

public protocol RangeCalendarSelectionHandler {
func newRangeSelectionStateFor(
selection date: Date,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

import Foundation

struct RangeDayAccessibilityProvider {
let accessibilityConfigurations: RangeAccessibilityConfigurations
let dateFormatter: DateFormatter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

import Foundation

public protocol SingleCalendarSelectionHandler {
func newSingleSelectionStateFor(
selection date: Date,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

import Foundation

struct SingleDayAccessibilityProvider {
let accessibilityConfigurations: SingleAccessibilityConfigurations
let dateFormatter: DateFormatter
Expand Down
1 change: 1 addition & 0 deletions Backpack-SwiftUI/Icons/Classes/BPKIcon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* limitations under the License.
*/

import Foundation
import Backpack_Common

public struct BPKIcon {
Expand Down
2 changes: 2 additions & 0 deletions Backpack-SwiftUI/Skeleton/Classes/BPKSkeletonSize.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

import CoreGraphics

extension BPKSkeleton {
public enum Size {
case small, `default`, large, custom(size: CGSize)
Expand Down
5 changes: 5 additions & 0 deletions Backpack-SwiftUI/Skeleton/Classes/BPKSkeletonStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
* limitations under the License.
*/

import CoreGraphics
#if SWIFT_PACKAGE
import BackpackTokens
#endif

extension BPKSkeleton {
public enum Style {
case `default`, rounded
Expand Down
8 changes: 5 additions & 3 deletions Backpack/BackpackUIKitImports.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

@_exported import UIKit
@_exported import BackpackTokens
@_exported import Backpack_Common
import UIKit
#if SWIFT_PACKAGE
import BackpackTokens
#endif
import Backpack_Common
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import FloatingPanel
import UIKit

final class BPKFloatingPanelController: FloatingPanelController {
var bottomSheet: BPKBottomSheet?
Expand Down
3 changes: 3 additions & 0 deletions Backpack/BottomSheet/Classes/BottomSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import UIKit
import FloatingPanel
#if SWIFT_PACKAGE
import BackpackTokens
#endif

@objc(BPKBottomSheetDelegate)
public protocol BPKBottomSheetDelegate: AnyObject {
Expand Down
3 changes: 3 additions & 0 deletions Backpack/BottomSheet/Classes/BottomSheetInsets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import UIKit
import FloatingPanel
#if SWIFT_PACKAGE
import BackpackTokens
#endif

public struct BottomSheetInsets {
public let full: CGFloat?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import FloatingPanel
import UIKit

class IntrinsicBottomSheetLayout: FloatingPanelLayout {
let position: FloatingPanelPosition = .bottom
Expand Down
1 change: 1 addition & 0 deletions Backpack/BottomSheet/Classes/ModalBottomSheetLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import FloatingPanel
import UIKit

/// Layout implementation where the BPKBottomSheet will be presented modaly. The parent ViewController
/// will not be interactable, there will be an overlay in the Parent ViewController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import FloatingPanel
import UIKit

/// Layout implementation where the BPKBottomSheet will remain persistent in the parent
/// ViewController. There is no overlay and the parent ViewController remains interactable
Expand Down
2 changes: 1 addition & 1 deletion Backpack/Carousel/Classes/BPKCarousel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
*/

Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import statement should use conditional compilation for SPM consistency. Consider adding #if SWIFT_PACKAGE wrapper around BackpackTokens import if BPKCarousel uses any token types, similar to other files in this PR.

Suggested change
#if SWIFT_PACKAGE
import BackpackTokens
#endif

Copilot uses AI. Check for mistakes.
import Foundation
import UIKit
import Backpack_Common

public protocol BPKCarouselDelegate: AnyObject {
Expand Down
3 changes: 3 additions & 0 deletions Backpack/Overlay/Classes/GradientOverlay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*/

import QuartzCore
#if SWIFT_PACKAGE
import BackpackTokens
#endif

final class GradientOverlay: CAGradientLayer {
enum OverlayType {
Expand Down
3 changes: 3 additions & 0 deletions Backpack/Overlay/Classes/VignetteOverlay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import UIKit
import QuartzCore
#if SWIFT_PACKAGE
import BackpackTokens
#endif

final class VignetteOverlay: CAShapeLayer {
override init() {
Expand Down
3 changes: 3 additions & 0 deletions Backpack/PageIndicator/Classes/BPKPageIndicator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import Foundation
import UIKit
#if SWIFT_PACKAGE
import BackpackTokens
#endif

public final class BPKPageIndicator: UIView {
public enum Variant {
Expand Down
3 changes: 3 additions & 0 deletions Backpack/Skeleton/Classes/BPKCommonSkeleton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import Foundation
import UIKit
#if SWIFT_PACKAGE
import BackpackTokens
#endif

class BPKCommonSkeleton: UIView {

Expand Down
3 changes: 3 additions & 0 deletions Backpack/Skeleton/Classes/BPKShimmerOverlayView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*/

import UIKit
#if SWIFT_PACKAGE
import BackpackTokens
#endif

class BPKShimmerOverlayView: UIView {

Expand Down
3 changes: 3 additions & 0 deletions Backpack/Skeleton/Classes/BPKSkeleton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
import Foundation
import UIKit
import SwiftUI
#if SWIFT_PACKAGE
import BackpackTokens
#endif

enum BPKSkeletonConstants {
static let backgroundColor = BPKColor.surfaceHighlightColor
Expand Down
3 changes: 3 additions & 0 deletions Backpack/Skeleton/Classes/BPKSkeletonSize.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import Foundation
import UIKit
#if SWIFT_PACKAGE
import BackpackTokens
#endif

public enum BPKSkeletonSize: Equatable {
case small, `default`, large, custom(size: CGSize)
Expand Down
3 changes: 3 additions & 0 deletions Backpack/Skeleton/Classes/BPKTextSkeleton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import Foundation
import UIKit
#if SWIFT_PACKAGE
import BackpackTokens
#endif

public class BPKTextSkeleton: UIView {
var textRows = [UIView]()
Expand Down
5 changes: 4 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ let targets: [Target] = [
// MARK: - BackpackSwiftUI (depends on BackpackCommon)
.target(
name: "Backpack_SwiftUI",
dependencies: ["Backpack_Common"],
dependencies: [
"Backpack_Common",
"BackpackTokens"
],
path: "Backpack-SwiftUI",
exclude: [
"Tests",
Expand Down
Loading