Skip to content

Commit 4fadf3f

Browse files
authored
[Woo POS][Design System] Create loading button style & update spinner colors (#15108)
2 parents c11a3f3 + 91cc627 commit 4fadf3f

File tree

36 files changed

+279
-87
lines changed

36 files changed

+279
-87
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ extension Color {
88
static var posOnPrimaryContainer: Color { Color(.posOnPrimaryContainer) }
99

1010
// MARK: - Secondary Container Colors
11+
static var posSecondary: Color { Color(.posSecondary) }
12+
static var posOnSecondary: Color { Color(.posOnSecondary) }
1113
static var posSecondaryContainer: Color { Color(.posSecondaryContainer) }
1214
static var posOnSecondaryContainer: Color { Color(.posOnSecondaryContainer) }
1315

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0x17",
9+
"green" : "0x15",
10+
"red" : "0x10"
11+
}
12+
},
13+
"idiom" : "universal"
14+
},
15+
{
16+
"appearances" : [
17+
{
18+
"appearance" : "luminosity",
19+
"value" : "dark"
20+
}
21+
],
22+
"color" : {
23+
"color-space" : "srgb",
24+
"components" : {
25+
"alpha" : "1.000",
26+
"blue" : "0x17",
27+
"green" : "0x15",
28+
"red" : "0x10"
29+
}
30+
},
31+
"idiom" : "universal"
32+
}
33+
],
34+
"info" : {
35+
"author" : "xcode",
36+
"version" : 1
37+
}
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0xFF",
9+
"green" : "0xC1",
10+
"red" : "0xD1"
11+
}
12+
},
13+
"idiom" : "universal"
14+
},
15+
{
16+
"appearances" : [
17+
{
18+
"appearance" : "luminosity",
19+
"value" : "dark"
20+
}
21+
],
22+
"color" : {
23+
"color-space" : "srgb",
24+
"components" : {
25+
"alpha" : "1.000",
26+
"blue" : "0xFF",
27+
"green" : "0xC1",
28+
"red" : "0xD1"
29+
}
30+
},
31+
"idiom" : "universal"
32+
}
33+
],
34+
"info" : {
35+
"author" : "xcode",
36+
"version" : 1
37+
}
38+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct PointOfSaleCardPresentPaymentBluetoothRequiredAlertView: View {
3333

3434
Button(viewModel.openSettingsButtonViewModel.title,
3535
action: viewModel.openSettingsButtonViewModel.actionHandler)
36-
.buttonStyle(POSButtonStyle(variant: .filled, size: .normal))
36+
.buttonStyle(POSFilledButtonStyle(size: .normal))
3737
.matchedGeometryEffect(id: animation.buttonsTransitionId, in: animation.namespace, properties: .position)
3838
}
3939
.posModalCloseButton(action: viewModel.dismissButtonViewModel.actionHandler,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct PointOfSaleCardPresentPaymentConnectingFailedChargeReaderView: View {
2828

2929
Button(viewModel.retryButtonViewModel.title,
3030
action: viewModel.retryButtonViewModel.actionHandler)
31-
.buttonStyle(POSButtonStyle(variant: .filled, size: .normal))
31+
.buttonStyle(POSFilledButtonStyle(size: .normal))
3232
.matchedGeometryEffect(id: animation.buttonsTransitionId, in: animation.namespace, properties: .position)
3333
}
3434
.posModalCloseButton(action: viewModel.cancelButtonViewModel.actionHandler,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct PointOfSaleCardPresentPaymentConnectingFailedUpdateAddressView: View {
2020
if let primaryButtonViewModel = viewModel.primaryButtonViewModel {
2121
Button(primaryButtonViewModel.title,
2222
action: primaryButtonViewModel.actionHandler)
23-
.buttonStyle(POSButtonStyle(variant: .filled, size: .normal))
23+
.buttonStyle(POSFilledButtonStyle(size: .normal))
2424
.matchedGeometryEffect(id: animation.buttonsTransitionId, in: animation.namespace, properties: .position)
2525
}
2626
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct PointOfSaleCardPresentPaymentConnectingFailedUpdatePostalCodeView: View {
2828

2929
Button(viewModel.retryButtonViewModel.title,
3030
action: viewModel.retryButtonViewModel.actionHandler)
31-
.buttonStyle(POSButtonStyle(variant: .filled, size: .normal))
31+
.buttonStyle(POSFilledButtonStyle(size: .normal))
3232
.matchedGeometryEffect(id: animation.buttonsTransitionId, in: animation.namespace, properties: .position)
3333
}
3434
.posModalCloseButton(action: viewModel.cancelButtonViewModel.actionHandler,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct PointOfSaleCardPresentPaymentConnectingFailedView: View {
3535

3636
Button(viewModel.retryButtonViewModel.title,
3737
action: viewModel.retryButtonViewModel.actionHandler)
38-
.buttonStyle(POSButtonStyle(variant: .filled, size: .normal))
38+
.buttonStyle(POSFilledButtonStyle(size: .normal))
3939
.matchedGeometryEffect(id: animation.buttonsTransitionId, in: animation.namespace, properties: .position)
4040
}
4141
.posModalCloseButton(action: viewModel.cancelButtonViewModel.actionHandler,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct PointOfSaleCardPresentPaymentFoundMultipleReadersView: View {
3636
}) {
3737
Text(Localization.cancel)
3838
}
39-
.buttonStyle(POSButtonStyle(variant: .outlined, size: .normal))
39+
.buttonStyle(POSOutlinedButtonStyle(size: .normal))
4040
.padding(Layout.buttonPadding)
4141
}
4242
.padding(Layout.padding)
@@ -53,7 +53,7 @@ private extension PointOfSaleCardPresentPaymentFoundMultipleReadersView {
5353
Button(Localization.connect) {
5454
connect(readerID)
5555
}
56-
.buttonStyle(POSButtonStyle(variant: .outlined, size: .extraSmall))
56+
.buttonStyle(POSOutlinedButtonStyle(size: .extraSmall))
5757
}
5858
.padding(.vertical, Layout.rowVerticalPadding)
5959
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ struct PointOfSaleCardPresentPaymentFoundReaderView: View {
2929
VStack(spacing: PointOfSaleReaderConnectionModalLayout.buttonSpacing) {
3030
Button(viewModel.connectButton.title,
3131
action: viewModel.connectButton.actionHandler)
32-
.buttonStyle(POSButtonStyle(variant: .filled, size: .normal))
32+
.buttonStyle(POSFilledButtonStyle(size: .normal))
3333

3434
Button(viewModel.continueSearchButton.title,
3535
action: viewModel.continueSearchButton.actionHandler)
36-
.buttonStyle(POSButtonStyle(variant: .outlined, size: .normal))
36+
.buttonStyle(POSOutlinedButtonStyle(size: .normal))
3737
}
3838
.matchedGeometryEffect(id: animation.buttonsTransitionId, in: animation.namespace, properties: .position)
3939
}

0 commit comments

Comments
 (0)