From 90ea3e6f79c837fdaa22e000c8185e9f5638a99b Mon Sep 17 00:00:00 2001 From: RachelRadford21 Date: Mon, 24 Jun 2024 15:14:19 -0400 Subject: [PATCH 1/8] fix colors for pill kit --- .../Color.xcassets/Status/Neutral.colorset/Contents.json | 6 +++--- .../Color.xcassets/Status/Warning.colorset/Contents.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/Playbook/Design Elements/Colors/Color.xcassets/Status/Neutral.colorset/Contents.json b/Sources/Playbook/Design Elements/Colors/Color.xcassets/Status/Neutral.colorset/Contents.json index 7fee7e0f2..bb6df9bb5 100644 --- a/Sources/Playbook/Design Elements/Colors/Color.xcassets/Status/Neutral.colorset/Contents.json +++ b/Sources/Playbook/Design Elements/Colors/Color.xcassets/Status/Neutral.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "214", - "green" : "205", - "red" : "193" + "blue" : "135", + "green" : "120", + "red" : "104" } }, "idiom" : "universal" diff --git a/Sources/Playbook/Design Elements/Colors/Color.xcassets/Status/Warning.colorset/Contents.json b/Sources/Playbook/Design Elements/Colors/Color.xcassets/Status/Warning.colorset/Contents.json index d2de33ecc..d3537b960 100644 --- a/Sources/Playbook/Design Elements/Colors/Color.xcassets/Status/Warning.colorset/Contents.json +++ b/Sources/Playbook/Design Elements/Colors/Color.xcassets/Status/Warning.colorset/Contents.json @@ -6,8 +6,8 @@ "components" : { "alpha" : "1.000", "blue" : "0x00", - "green" : "0xBB", - "red" : "0xF9" + "green" : "0x95", + "red" : "0xC6" } }, "idiom" : "universal" From 80950438c5c6f6de397b3ee85be6af0f6586ffaf Mon Sep 17 00:00:00 2001 From: RachelRadford21 Date: Mon, 29 Jul 2024 16:16:39 -0400 Subject: [PATCH 2/8] simple progress --- .../Progress Simple/PBProgressSimple.swift | 66 +++++++++++++++++++ .../ProgressSimpleCatalog.swift | 55 ++++++++++++++++ .../Text/TextLight.colorset/Contents.json | 3 + .../Resources/Helper Files/Components.swift | 2 + 4 files changed, 126 insertions(+) create mode 100644 Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift create mode 100644 Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift diff --git a/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift b/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift new file mode 100644 index 000000000..6ca54a061 --- /dev/null +++ b/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift @@ -0,0 +1,66 @@ +// +// Playbook Swift Design System +// +// Copyright © 2024 Power Home Remodeling Group +// This software is distributed under the ISC License +// +// PBProgressSimple.swift +// + +import SwiftUI + +public struct PBProgressSimple: View { + @Binding var progress: Double + @Binding var value: Int + let maxValue: Int + let progressColor: Color + let progressBackgroundColor: Color + let progressHeight: CGFloat + let variant: Variant + + public init( + progress: Binding = .constant(0.0), + value: Binding = .constant(2), + maxValue: Int = 10, + progressColor: Color = .pbPrimary, + progressBackgroundColor: Color = .border, + progressHeight: CGFloat = 4, + variant: Variant = .default + + ) { + self._progress = progress + self._value = value + self.maxValue = maxValue + self.progressColor = progressColor + self.progressBackgroundColor = progressBackgroundColor + self.progressHeight = progressHeight + self.variant = variant + + } + + public var body: some View { + variantView + } +} + +public extension PBProgressSimple { + enum Variant { + case `default`, settingValue + } + + var variantView: some View { + HStack { + switch variant { + case .default: ProgressView(value: progress, total: 1) + case .settingValue: ProgressView(value: CGFloat(value), total: CGFloat(maxValue)) + + } + } + .tint(progressColor) + + } +} +#Preview { + registerFonts() + return PBProgressSimple() +} diff --git a/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift b/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift new file mode 100644 index 000000000..10ba5fccc --- /dev/null +++ b/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift @@ -0,0 +1,55 @@ +// +// Playbook Swift Design System +// +// Copyright © 2024 Power Home Remodeling Group +// This software is distributed under the ISC License +// +// ProgressSimpleCatalog.swift +// + +import SwiftUI + +public struct ProgressSimpleCatalog: View { + @State private var progress: Double = 0.45 + @State private var progress1: Double = 0.68 + @State private var value: Int = 2 + public var body: some View { + PBDocStack(title: "Progress Simple", spacing: Spacing.medium) { + PBDoc(title: "Default") { + defaultView + } + PBDoc(title: "Setting Value") { + settingValueView + } + } + } +} + +public extension ProgressSimpleCatalog { + var defaultView: some View { + VStack(alignment: .leading) { + PBProgressSimple( + progress: $progress, + progressColor: .pbPrimary + ) + } + } + var settingValueView: some View { + VStack(alignment: .leading) { + PBProgressSimple( + progress: $progress1, + progressColor: .pbPrimary + ) + PBProgressSimple( + value: $value, + maxValue: 10, + progressColor: .pbPrimary, + variant: .settingValue + ) + } + } +} +#Preview { + registerFonts() + return ProgressSimpleCatalog() +} diff --git a/Sources/Playbook/Design Elements/Colors/Color.xcassets/Text/TextLight.colorset/Contents.json b/Sources/Playbook/Design Elements/Colors/Color.xcassets/Text/TextLight.colorset/Contents.json index 8f3cf3c0a..e08e4127f 100644 --- a/Sources/Playbook/Design Elements/Colors/Color.xcassets/Text/TextLight.colorset/Contents.json +++ b/Sources/Playbook/Design Elements/Colors/Color.xcassets/Text/TextLight.colorset/Contents.json @@ -34,5 +34,8 @@ "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "localizable" : true } } diff --git a/Sources/Playbook/Resources/Helper Files/Components.swift b/Sources/Playbook/Resources/Helper Files/Components.swift index 093c67164..f9c5a8382 100644 --- a/Sources/Playbook/Resources/Helper Files/Components.swift +++ b/Sources/Playbook/Resources/Helper Files/Components.swift @@ -48,6 +48,7 @@ public enum Components: String, CaseIterable { case pill case popover case progressPill = "Progress Pill" + case progressSimple = "Progress Simple" case radio case sectionSeparator = "Section Separator" case select @@ -107,6 +108,7 @@ public enum Components: String, CaseIterable { case .pill: PillCatalog() case .popover: PopoverCatalog() case .progressPill: ProgressPillCatalog() + case .progressSimple: ProgressSimpleCatalog() case .radio: RadioCatalog() case .sectionSeparator: SectionSeparatorCatalog() case .select: SelectCatalog() From a91514c69662a7f0c23874618a821e44761ce801 Mon Sep 17 00:00:00 2001 From: RachelRadford21 Date: Mon, 29 Jul 2024 16:34:33 -0400 Subject: [PATCH 3/8] commit --- .../Components/Progress Simple/PBProgressSimple.swift | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift b/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift index 6ca54a061..9a51a603c 100644 --- a/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift +++ b/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift @@ -14,8 +14,6 @@ public struct PBProgressSimple: View { @Binding var value: Int let maxValue: Int let progressColor: Color - let progressBackgroundColor: Color - let progressHeight: CGFloat let variant: Variant public init( @@ -23,8 +21,6 @@ public struct PBProgressSimple: View { value: Binding = .constant(2), maxValue: Int = 10, progressColor: Color = .pbPrimary, - progressBackgroundColor: Color = .border, - progressHeight: CGFloat = 4, variant: Variant = .default ) { @@ -32,8 +28,6 @@ public struct PBProgressSimple: View { self._value = value self.maxValue = maxValue self.progressColor = progressColor - self.progressBackgroundColor = progressBackgroundColor - self.progressHeight = progressHeight self.variant = variant } @@ -53,7 +47,6 @@ public extension PBProgressSimple { switch variant { case .default: ProgressView(value: progress, total: 1) case .settingValue: ProgressView(value: CGFloat(value), total: CGFloat(maxValue)) - } } .tint(progressColor) From 860a5f89c8785e91b08cd18381456d3f775e7f4b Mon Sep 17 00:00:00 2001 From: RachelRadford21 Date: Mon, 29 Jul 2024 16:38:32 -0400 Subject: [PATCH 4/8] chnage catalog var name --- .../Playbook/Components/Progress Simple/PBProgressSimple.swift | 1 - .../Components/Progress Simple/ProgressSimpleCatalog.swift | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift b/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift index 9a51a603c..9c28880ea 100644 --- a/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift +++ b/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift @@ -29,7 +29,6 @@ public struct PBProgressSimple: View { self.maxValue = maxValue self.progressColor = progressColor self.variant = variant - } public var body: some View { diff --git a/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift b/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift index 10ba5fccc..67ba1008f 100644 --- a/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift +++ b/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift @@ -18,7 +18,7 @@ public struct ProgressSimpleCatalog: View { PBDoc(title: "Default") { defaultView } - PBDoc(title: "Setting Value") { + PBDoc(title: "Setting Values") { settingValueView } } From a8f4738df94c7c8c902484de4389c49a442198b4 Mon Sep 17 00:00:00 2001 From: RachelRadford21 Date: Fri, 2 Aug 2024 10:54:23 -0400 Subject: [PATCH 5/8] progress colors --- .../ProgressSimpleCatalog.swift | 41 ++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift b/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift index 67ba1008f..47c7aa556 100644 --- a/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift +++ b/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift @@ -12,6 +12,11 @@ import SwiftUI public struct ProgressSimpleCatalog: View { @State private var progress: Double = 0.45 @State private var progress1: Double = 0.68 + @State private var progress2: Double = 0.64 + @State private var progress3: Double = 0.9 + @State private var progress4: Double = 0.1 + @State private var progress5: Double = 0.4 + @State private var progress6: Double = 0.68 @State private var value: Int = 2 public var body: some View { PBDocStack(title: "Progress Simple", spacing: Spacing.medium) { @@ -21,6 +26,9 @@ public struct ProgressSimpleCatalog: View { PBDoc(title: "Setting Values") { settingValueView } + PBDoc(title: "Variants") { + progressColorView + } } } } @@ -29,25 +37,46 @@ public extension ProgressSimpleCatalog { var defaultView: some View { VStack(alignment: .leading) { PBProgressSimple( - progress: $progress, - progressColor: .pbPrimary + progress: $progress ) } } var settingValueView: some View { - VStack(alignment: .leading) { + VStack(alignment: .leading, spacing: Spacing.medium) { PBProgressSimple( - progress: $progress1, - progressColor: .pbPrimary + progress: $progress1 ) PBProgressSimple( value: $value, maxValue: 10, - progressColor: .pbPrimary, variant: .settingValue ) } } + var progressColorView: some View { + VStack(alignment: .leading, spacing: Spacing.medium) { + PBProgressSimple( + progress: $progress2, + progressColor: .pbPrimary + ) + PBProgressSimple( + progress: $progress3, + progressColor: .status(.success) + ) + PBProgressSimple( + progress: $progress4, + progressColor: .status(.error) + ) + PBProgressSimple( + progress: $progress5, + progressColor: .status(.warning) + ) + PBProgressSimple( + progress: $progress6, + progressColor: .status(.neutral) + ) + } + } } #Preview { registerFonts() From 52529a3c3a2395b0d011cc610168760f1e2ab989 Mon Sep 17 00:00:00 2001 From: RachelRadford21 Date: Fri, 2 Aug 2024 11:58:26 -0400 Subject: [PATCH 6/8] commit --- .../Components/Progress Simple/ProgressSimpleCatalog.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift b/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift index 47c7aa556..7646385df 100644 --- a/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift +++ b/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift @@ -34,6 +34,7 @@ public struct ProgressSimpleCatalog: View { } public extension ProgressSimpleCatalog { + var defaultView: some View { VStack(alignment: .leading) { PBProgressSimple( @@ -41,6 +42,7 @@ public extension ProgressSimpleCatalog { ) } } + var settingValueView: some View { VStack(alignment: .leading, spacing: Spacing.medium) { PBProgressSimple( @@ -53,6 +55,7 @@ public extension ProgressSimpleCatalog { ) } } + var progressColorView: some View { VStack(alignment: .leading, spacing: Spacing.medium) { PBProgressSimple( From f695f6025b44758ecefc6bf2c1381f728956fce8 Mon Sep 17 00:00:00 2001 From: RachelRadford21 Date: Fri, 2 Aug 2024 14:41:50 -0400 Subject: [PATCH 7/8] progress width and alignment --- .../Progress Simple/PBProgressSimple.swift | 6 +- .../ProgressSimpleCatalog.swift | 65 +++++++++++++++---- 2 files changed, 59 insertions(+), 12 deletions(-) diff --git a/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift b/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift index 9c28880ea..b912c258b 100644 --- a/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift +++ b/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift @@ -14,6 +14,7 @@ public struct PBProgressSimple: View { @Binding var value: Int let maxValue: Int let progressColor: Color + let progressWidth: CGFloat let variant: Variant public init( @@ -21,6 +22,7 @@ public struct PBProgressSimple: View { value: Binding = .constant(2), maxValue: Int = 10, progressColor: Color = .pbPrimary, + progressWidth: CGFloat = .infinity, variant: Variant = .default ) { @@ -28,6 +30,7 @@ public struct PBProgressSimple: View { self._value = value self.maxValue = maxValue self.progressColor = progressColor + self.progressWidth = progressWidth self.variant = variant } @@ -47,9 +50,10 @@ public extension PBProgressSimple { case .default: ProgressView(value: progress, total: 1) case .settingValue: ProgressView(value: CGFloat(value), total: CGFloat(maxValue)) } + } .tint(progressColor) - + .frame(width: progressWidth) } } #Preview { diff --git a/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift b/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift index 7646385df..bd832489c 100644 --- a/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift +++ b/Sources/Playbook/Components/Progress Simple/ProgressSimpleCatalog.swift @@ -12,11 +12,15 @@ import SwiftUI public struct ProgressSimpleCatalog: View { @State private var progress: Double = 0.45 @State private var progress1: Double = 0.68 - @State private var progress2: Double = 0.64 - @State private var progress3: Double = 0.9 - @State private var progress4: Double = 0.1 - @State private var progress5: Double = 0.4 - @State private var progress6: Double = 0.68 + @State private var progress2: Double = 0.40 + @State private var progress3: Double = 0.64 + @State private var progress4: Double = 0.9 + @State private var progress5: Double = 0.1 + @State private var progress6: Double = 0.4 + @State private var progress7: Double = 0.68 + @State private var progress8: Double = 0.45 + @State private var progress9: Double = 0.45 + @State private var progress10: Double = 0.45 @State private var value: Int = 2 public var body: some View { PBDocStack(title: "Progress Simple", spacing: Spacing.medium) { @@ -26,9 +30,15 @@ public struct ProgressSimpleCatalog: View { PBDoc(title: "Setting Values") { settingValueView } + PBDoc(title: "Progress Bar Width") { + progressWidthView + } PBDoc(title: "Variants") { progressColorView } + PBDoc(title: "Align") { + alignmentView + } } } } @@ -55,31 +65,64 @@ public extension ProgressSimpleCatalog { ) } } - - var progressColorView: some View { + var progressWidthView: some View { VStack(alignment: .leading, spacing: Spacing.medium) { PBProgressSimple( progress: $progress2, - progressColor: .pbPrimary + progressColor: .pbPrimary, + progressWidth: 100 ) + } + } + var progressColorView: some View { + VStack(alignment: .leading, spacing: Spacing.medium) { PBProgressSimple( progress: $progress3, - progressColor: .status(.success) + progressColor: .pbPrimary ) PBProgressSimple( progress: $progress4, - progressColor: .status(.error) + progressColor: .status(.success) ) PBProgressSimple( progress: $progress5, - progressColor: .status(.warning) + progressColor: .status(.error) ) PBProgressSimple( progress: $progress6, + progressColor: .status(.warning) + ) + PBProgressSimple( + progress: $progress7, progressColor: .status(.neutral) ) } } + var alignmentView: some View { + VStack(alignment: .leading, spacing: Spacing.medium) { + HStack { + PBProgressSimple( + progress: $progress8, + progressWidth: 100 + ) + } + .frame(maxWidth: .infinity, alignment: .leading) + HStack { + PBProgressSimple( + progress: $progress9, + progressWidth: 100 + ) + } + .frame(maxWidth: .infinity, alignment: .center) + HStack { + PBProgressSimple( + progress: $progress10, + progressWidth: 100 + ) + } + .frame(maxWidth: .infinity, alignment: .trailing) + } + } } #Preview { registerFonts() From bf03335096116888a453a103dda3adc5523afd94 Mon Sep 17 00:00:00 2001 From: "isis.silva" Date: Tue, 6 Aug 2024 03:05:03 -0400 Subject: [PATCH 8/8] no message --- .../Components/Progress Simple/PBProgressSimple.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift b/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift index d22678ec9..1cf116d96 100644 --- a/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift +++ b/Sources/Playbook/Components/Progress Simple/PBProgressSimple.swift @@ -42,14 +42,13 @@ public extension PBProgressSimple { enum Variant { case `default`, settingValue } - + var variantView: some View { - HStack { + Group { switch variant { case .default: ProgressView(value: progress, total: 1) case .settingValue: ProgressView(value: CGFloat(value), total: CGFloat(maxValue)) } - } .tint(progressColor) .frame(width: progressWidth)