From 90ea3e6f79c837fdaa22e000c8185e9f5638a99b Mon Sep 17 00:00:00 2001 From: RachelRadford21 Date: Mon, 24 Jun 2024 15:14:19 -0400 Subject: [PATCH 1/2] 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 19ca44e9d693f94fb0b7396e6d62c189cbc3959d Mon Sep 17 00:00:00 2001 From: RachelRadford21 Date: Mon, 25 Nov 2024 09:59:10 -0500 Subject: [PATCH 2/2] add ability to chnage padding --- .../Playbook/Components/Nav/PBNavItem.swift | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Sources/Playbook/Components/Nav/PBNavItem.swift b/Sources/Playbook/Components/Nav/PBNavItem.swift index 17cc8e0ed..12715dfb0 100644 --- a/Sources/Playbook/Components/Nav/PBNavItem.swift +++ b/Sources/Playbook/Components/Nav/PBNavItem.swift @@ -19,19 +19,28 @@ public struct PBNavItem: View { var icon: NavigationIcon? var accessory: FontAwesome? let isFullWidth: Bool + var horizontalOrientationPadding: CGFloat? + var vertOrientationPadding: CGFloat? + var vertPadding: CGFloat? var content: Content? - + public init( _ label: String? = nil, icon: NavigationIcon? = nil, accessory: FontAwesome? = nil, isFullWidth: Bool = false, + horizontalOrientationPadding: CGFloat? = nil, + vertOrientationPadding: CGFloat? = nil, + vertPadding: CGFloat? = nil, @ViewBuilder content: @escaping () -> Content = { EmptyView() } ) { self.label = label self.icon = icon self.accessory = accessory self.isFullWidth = isFullWidth + self.horizontalOrientationPadding = horizontalOrientationPadding + self.vertOrientationPadding = vertOrientationPadding + self.vertPadding = vertPadding self.content = content() } @@ -63,7 +72,7 @@ public struct PBNavItem: View { .scaledToFill() .frame(maxWidth: isFullWidth ? .infinity : nil, alignment: .center) .foregroundColor(captionForegroundColor) - .padding(.horizontal, horizontalPadding) + .padding(.horizontal, orientationPadding) .padding(.vertical, verticalPadding) .background(backgroundColor) .cornerRadius(cornerRadius) @@ -198,26 +207,26 @@ extension PBNavItem { } } - var horizontalPadding: CGFloat { + var orientationPadding: CGFloat { switch variant { case .normal: switch orientation { - case .horizontal: return Spacing.medium - case .vertical: return Spacing.small + case .horizontal: return horizontalOrientationPadding ?? Spacing.medium + case .vertical: return vertOrientationPadding ?? Spacing.small } case .subtle, .bold: switch orientation { - case .horizontal: return 14 - case .vertical: return 14 + case .horizontal: return horizontalOrientationPadding ?? 14 + case .vertical: return vertOrientationPadding ?? 14 } } } var verticalPadding: CGFloat { switch variant { - case .normal: return Spacing.small - case .subtle, .bold: return Spacing.xSmall + case .normal: return vertPadding ?? Spacing.small + case .subtle, .bold: return vertPadding ?? Spacing.xSmall } }