Skip to content

Commit 01b89b7

Browse files
authored
[Woo POS] [Design System] Apply straightforward color updates (#15068)
2 parents 138f010 + 8d038e7 commit 01b89b7

27 files changed

+57
-139
lines changed

WooCommerce/Classes/POS/Colors/Color+POSColorPalette.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ extension Color {
4545
static var posOnAlert: Color { Color(.posOnAlert) }
4646

4747
// MARK: - Text Colors
48-
static var posTextPrimary: Color { Color(.posTextPrimary) }
49-
static var posTextSecondary: Color { Color(.posTextSecondary) }
50-
static var posTextTertiary: Color { Color(.posTextTertiary) }
48+
static var posPrimaryText: Color { Color(.posPrimaryText) }
49+
static var posSecondaryText: Color { Color(.posSecondaryText) }
50+
static var posTertiaryText: Color { Color(.posTertiaryText) }
5151

5252
// MARK: - Other
5353
static var posShadow: Color { Color(.posShadow) }

WooCommerce/Classes/POS/Colors/POSColorPalette.xcassets/posTextPrimary.colorset/Contents.json renamed to WooCommerce/Classes/POS/Colors/POSColorPalette.xcassets/posPrimaryText.colorset/Contents.json

File renamed without changes.

WooCommerce/Classes/POS/Colors/POSColorPalette.xcassets/posTextSecondary.colorset/Contents.json renamed to WooCommerce/Classes/POS/Colors/POSColorPalette.xcassets/posSecondaryText.colorset/Contents.json

File renamed without changes.

WooCommerce/Classes/POS/Colors/POSColorPalette.xcassets/posTextTertiary.colorset/Contents.json renamed to WooCommerce/Classes/POS/Colors/POSColorPalette.xcassets/posTertiaryText.colorset/Contents.json

File renamed without changes.

WooCommerce/Classes/POS/Presentation/CardReaderConnection/CardReaderConnectionStatusView.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct CardReaderConnectionStatusView: View {
2828
}
2929
} label: {
3030
HStack(spacing: Constants.buttonImageAndTextSpacing) {
31-
circleIcon(with: Color(.wooCommerceEmerald(.shade40)))
31+
circleIcon(with: Color.posSuccess)
3232
Text(Localization.readerConnected)
3333
.foregroundColor(connectedFontColor)
3434
}
@@ -97,7 +97,7 @@ private extension CardReaderConnectionStatusView {
9797
var disconnectedFontColor: Color {
9898
switch backgroundAppearance {
9999
case .primary:
100-
Color(.wooCommercePurple(.shade60))
100+
.posPrimaryText
101101
case .secondary:
102102
POSFloatingControlView.secondaryFontColor
103103
}
@@ -163,8 +163,14 @@ private extension CardReaderConnectionStatusView {
163163

164164
@available(iOS 17.0, *)
165165
#Preview {
166+
let posModel = PointOfSaleAggregateModel(
167+
itemsController: PointOfSalePreviewItemsController(),
168+
cardPresentPaymentService: CardPresentPaymentPreviewService(),
169+
orderController: PointOfSalePreviewOrderController()
170+
)
166171
VStack {
167172
CardReaderConnectionStatusView()
173+
.environment(posModel)
168174
}
169175
}
170176

WooCommerce/Classes/POS/Presentation/CardReaderConnection/UI States/Connection Alerts/PointOfSaleCardPresentPaymentFoundMultipleReadersView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct PointOfSaleCardPresentPaymentFoundMultipleReadersView: View {
2727
List(readerIDs, id: \.self) { readerID in
2828
readerRow(readerID: readerID)
2929
.listRowSeparator(.hidden)
30-
.listRowBackground(Color.posPrimaryBackground)
30+
.listRowBackground(Color.posSurface)
3131
}
3232
.listStyle(.plain)
3333

WooCommerce/Classes/POS/Presentation/CardReaderConnection/UI States/Reader Messages/PointOfSaleCardPresentPaymentProcessingMessageView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ struct PointOfSaleCardPresentPaymentProcessingMessageView: View {
1212

1313
VStack(alignment: .center, spacing: Layout.textSpacing) {
1414
Text(viewModel.title)
15-
.foregroundStyle(.white)
15+
.foregroundStyle(Color.posOnPrimaryContainer)
1616
.font(.posBodyRegular)
1717
.matchedGeometryEffect(id: animation.titleTransitionId, in: animation.namespace, properties: .position)
1818

1919
Text(viewModel.message)
2020
.font(.posTitleEmphasized)
21-
.foregroundStyle(Color.posDarkGray.opacity(0.16))
21+
.foregroundStyle(Color.posOnPrimaryContainer)
2222
.accessibilityAddTraits(.isHeader)
2323
.matchedGeometryEffect(id: animation.messageTransitionId, in: animation.namespace, properties: .position)
2424
}

WooCommerce/Classes/POS/Presentation/CardReaderConnection/UI States/Reader Messages/PointOfSalePaymentSuccessView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct PointOfSalePaymentSuccessView: View {
7575
.frame(width: Constants.imageSize.width, height: Constants.imageSize.height)
7676
.shadow(color: Color(.wooCommerceEmerald(.shade80)).opacity(Constants.shadowOpacity),
7777
radius: Constants.shadowRadius, x: Constants.shadowSize.width, y: Constants.shadowSize.height)
78-
.foregroundColor(.posSuccessColor)
78+
.foregroundColor(.posSuccess)
7979
Image(PointOfSaleAssets.successCheck.imageName)
8080
.renderingMode(.template)
8181
.foregroundColor(checkmarkColor)
@@ -85,7 +85,7 @@ struct PointOfSalePaymentSuccessView: View {
8585
}
8686

8787
private var checkmarkColor: Color {
88-
Color.primary
88+
.posOnSuccess
8989
}
9090
}
9191

WooCommerce/Classes/POS/Presentation/CartView.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,7 @@ private struct ScrollOffSetPreferenceKey: PreferenceKey {
152152
@available(iOS 17.0, *)
153153
private extension CartView {
154154
var backgroundColor: Color {
155-
switch colorScheme {
156-
case .dark:
157-
return Color.posSecondaryBackground
158-
default:
159-
return posModel.cart.isEmpty ? Color.posTertiaryBackground : Color.posSecondaryBackground
160-
}
155+
.posSurfaceBright
161156
}
162157

163158
var shouldPreventCartEditing: Bool {

WooCommerce/Classes/POS/Presentation/Item Selector/ChildItemList.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct ChildItemList: View {
3131
errorView(error: error)
3232
}
3333
}
34-
.background(Color.posPrimaryBackground)
34+
.background(Color.posSurface)
3535
.toolbar(.hidden, for: .navigationBar)
3636
.task {
3737
guard state.items.isEmpty else {

0 commit comments

Comments
 (0)