From 3a06f7b43e44df772f50f9ddbfcb6881ea512e5f Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Mon, 14 Oct 2024 11:03:24 -0400 Subject: [PATCH 1/5] Digital ACT191 defect CXTDT-626309 - Update to default header h2 padding --- .../Headers/H2/HeadersH2ButtonsModel.swift | 6 ------ .../Headers/H2/HeadersH2CaretLinkModel.swift | 6 ------ .../Headers/H2/HeadersH2LinkModel.swift | 8 +------- .../Headers/H2/HeadersH2NoButtonsBodyTextModel.swift | 6 ------ .../Headers/H2/HeadersH2PricingTwoRowsModel.swift | 6 ------ .../Headers/H2/HeadersH2TinyButtonModel.swift | 6 ------ 6 files changed, 1 insertion(+), 37 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift index 6d9bef90..accd139e 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift @@ -47,12 +47,6 @@ public class HeadersH2ButtonsModel: HeaderModel, MoleculeModelProtocol, ParentMo //-------------------------------------------------- public override func setDefaults() { - if topPadding == nil { - topPadding = Padding.Component.VerticalMarginSpacing - } - if bottomPadding == nil { - bottomPadding = Padding.Component.VerticalMarginSpacing - } if titleLockup.title.fontStyle == nil { titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2CaretLinkModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2CaretLinkModel.swift index 1cb89f84..6675abcf 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2CaretLinkModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2CaretLinkModel.swift @@ -42,12 +42,6 @@ public class HeadersH2CaretLinkModel: HeaderModel, MoleculeModelProtocol, Parent // MARK: - Methods //-------------------------------------------------- public override func setDefaults() { - if topPadding == nil { - topPadding = Padding.Component.VerticalMarginSpacing - } - if bottomPadding == nil { - bottomPadding = Padding.Component.VerticalMarginSpacing - } if titleLockup.title.fontStyle == nil { titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift index 8ff7df5e..1a95bf73 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift @@ -46,13 +46,7 @@ public class HeadersH2LinkModel: HeaderModel, ParentMoleculeModelProtocol { //-------------------------------------------------- public override func setDefaults() { - if topPadding == nil { - topPadding = Padding.Component.VerticalMarginSpacing - } - if bottomPadding == nil { - bottomPadding = Padding.Component.VerticalMarginSpacing - } - if titleLockup.title.fontStyle == nil { + if titleLockup.title.fontStyle == nil { titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge } if titleLockup.subTitle?.fontStyle == nil { diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift index e18aafe6..95414411 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift @@ -36,12 +36,6 @@ public class HeadersH2NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol } public override func setDefaults() { - if topPadding == nil { - topPadding = Padding.Component.VerticalMarginSpacing - } - if bottomPadding == nil { - bottomPadding = Padding.Component.VerticalMarginSpacing - } if titleLockup.title.fontStyle == nil { titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift index 1205c55c..502a4f08 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2PricingTwoRowsModel.swift @@ -57,12 +57,6 @@ public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol, P // MARK: - Methods //-------------------------------------------------- public override func setDefaults() { - if topPadding == nil { - topPadding = Padding.Component.VerticalMarginSpacing - } - if bottomPadding == nil { - bottomPadding = Padding.Component.VerticalMarginSpacing - } if headline.accessibilityTraits == nil { headline.accessibilityTraits = .header } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift index a13c6b9e..a8271b8f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift @@ -47,12 +47,6 @@ public class HeadersH2TinyButtonModel: HeaderModel, MoleculeModelProtocol, Paren //-------------------------------------------------- public override func setDefaults() { - if topPadding == nil { - topPadding = Padding.Component.VerticalMarginSpacing - } - if bottomPadding == nil { - bottomPadding = Padding.Component.VerticalMarginSpacing - } if titleLockup.title.fontStyle == nil { titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge } From 4487f9b03bcd599add30459e5acae600a7f0935a Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 14 Oct 2024 15:53:31 -0500 Subject: [PATCH 2/5] refactored badge text/fill color Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Views/Badge.swift | 4 +- MVMCoreUI/Atomic/Atoms/Views/BadgeModel.swift | 26 +++++-- .../Atomic/Atoms/Views/TileletModel.swift | 4 +- .../Atomic/Extensions/VDS-Enums+Codable.swift | 76 ++++++++++++++----- 4 files changed, 77 insertions(+), 33 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Badge.swift b/MVMCoreUI/Atomic/Atoms/Views/Badge.swift index 9957101f..218cc6fc 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Badge.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Badge.swift @@ -31,10 +31,10 @@ open class Badge: VDS.Badge, VDSMoleculeViewProtocol { self.accessibilityIdentifier = accessibilityIdentifier } text = viewModel.text - textColor = viewModel.textColor + textColor = viewModel.textColorStyle maxWidth = viewModel.maxWidth numberOfLines = viewModel.numberOfLines - fillColor = viewModel.fillColor + fillColor = viewModel.fillColorStyle surface = viewModel.surface } diff --git a/MVMCoreUI/Atomic/Atoms/Views/BadgeModel.swift b/MVMCoreUI/Atomic/Atoms/Views/BadgeModel.swift index 52e43e9a..59309c49 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/BadgeModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/BadgeModel.swift @@ -22,15 +22,16 @@ open class BadgeModel: MoleculeModelProtocol { // MARK: - VDS Properties //-------------------------------------------------- public var text: String = "" - public var textColor: Badge.TextColor? = nil + public var textColorStyle: Badge.TextColor? = nil public var accessibilityText: String? public var maxWidth: CGFloat? public var numberOfLines: Int = 1 - public var fillColor = Badge.FillColor.red + public var fillColorStyle = Badge.FillColor.red + public var fillColor: Color? public var surface: Surface = .light private enum CodingKeys: String, CodingKey { - case id, accessibilityIdentifier, text, textColor, accessibilityText, fillColor, surface, numberOfLines, maxWidth + case id, accessibilityIdentifier, text, textColor, textColorStyle, accessibilityText, fillColor, fillColorStyle, surface, numberOfLines, maxWidth } required public convenience init(from decoder: Decoder) throws { @@ -39,11 +40,20 @@ open class BadgeModel: MoleculeModelProtocol { id = try container.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString accessibilityIdentifier = try container.decodeIfPresent(String.self, forKey: .accessibilityIdentifier) text = try container.decode(String.self, forKey: .text) - if let foundTextColor = try container.decodeIfPresent(Color.self, forKey: .textColor) { - textColor = .custom(foundTextColor.uiColor) - } accessibilityText = try container.decodeIfPresent(String.self, forKey: .accessibilityText) - fillColor = try container.decodeIfPresent(Badge.FillColor.self, forKey: .fillColor) ?? .red + + //look for a textColor + if let textColor = try container.decodeIfPresent(Color.self, forKey: .textColor) { + textColorStyle = .custom(textColor.uiColor) + } + + //look for a style + fillColorStyle = try container.decodeIfPresent(Badge.FillColor.self, forKey: .fillColor) ?? .red + + //look for a color and set the style + if let fillColor = try container.decodeIfPresent(Color.self, forKey: .fillColor) { + fillColorStyle = .custom(fillColor.uiColor) + } surface = try container.decodeIfPresent(Surface.self, forKey: .surface) ?? .light numberOfLines = try container.decodeIfPresent(Int.self, forKey: .numberOfLines) ?? 1 maxWidth = try container.decodeIfPresent(CGFloat.self, forKey: .maxWidth) @@ -59,7 +69,7 @@ open class BadgeModel: MoleculeModelProtocol { try container.encode(surface, forKey: .surface) try container.encode(numberOfLines, forKey: .numberOfLines) try container.encodeIfPresent(maxWidth, forKey: .maxWidth) - switch textColor { + switch textColorStyle { case .custom(let color): try container.encode(Color(uiColor: color), forKey: .textColor) default: diff --git a/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift b/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift index 6802e5a7..33575f7c 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/TileletModel.swift @@ -94,8 +94,8 @@ open class TileletModel: TileContainerBaseModel, Molec public func badgeModel() -> Tilelet.BadgeModel? { guard let badge else { return nil } return .init(text: badge.text, - textColor: badge.textColor, - fillColor: badge.fillColor, + textColor: badge.textColorStyle, + fillColor: badge.fillColorStyle, surface: badge.surface, numberOfLines: badge.numberOfLines, maxWidth: badge.maxWidth diff --git a/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift b/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift index ab286f35..b7477ed4 100644 --- a/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift +++ b/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift @@ -305,30 +305,64 @@ extension VDS.Badge.FillColor: Codable { } public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - let type = try container.decode(CustomColorType.self, forKey: .type) - - switch type { - case .red: - self = .red - case .yellow: - self = .yellow - case .green: - self = .green - case .orange: - self = .orange - case .blue: - self = .blue - case .black: - self = .black - case .white: - self = .white - case .custom: - let color = try container.decode(Color.self, forKey: .color) + //try legacy ones that map to real fillColor cases + if let legacy = try? LegacyFillColor(from: decoder) { + self = legacy.fillColor + + } //try to convert to a color + else if let color = try? Color(from: decoder) { self = .custom(color.uiColor) + + } //try to use new format + else { + let container = try decoder.container(keyedBy: CodingKeys.self) + let type = try container.decode(CustomColorType.self, forKey: .type) + + switch type { + case .red: + self = .red + case .yellow: + self = .yellow + case .green: + self = .green + case .orange: + self = .orange + case .blue: + self = .blue + case .black: + self = .black + case .white: + self = .white + case .custom: + let color = try container.decode(Color.self, forKey: .color) + self = .custom(color.uiColor) + } } } - + + private enum LegacyFillColor: String, Decodable { + case red, yellow, green, orange, blue, black, white + + var fillColor: Badge.FillColor { + switch self { + case .red: + return .red + case .yellow: + return .yellow + case .green: + return .green + case .orange: + return .orange + case .blue: + return .blue + case .black: + return .black + case .white: + return .white + } + } + } + public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) switch self { From 76b58ec88aa192f7e78d7aa449060045668f42d4 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 14 Oct 2024 15:57:25 -0500 Subject: [PATCH 3/5] using type now and not the old way. Signed-off-by: Matt Bruce --- .../Atomic/Extensions/VDS-Enums+Codable.swift | 74 +++++-------------- 1 file changed, 20 insertions(+), 54 deletions(-) diff --git a/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift b/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift index b7477ed4..93669dc4 100644 --- a/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift +++ b/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift @@ -305,61 +305,27 @@ extension VDS.Badge.FillColor: Codable { } public init(from decoder: Decoder) throws { - //try legacy ones that map to real fillColor cases - if let legacy = try? LegacyFillColor(from: decoder) { - self = legacy.fillColor - - } //try to convert to a color - else if let color = try? Color(from: decoder) { - self = .custom(color.uiColor) - - } //try to use new format - else { - let container = try decoder.container(keyedBy: CodingKeys.self) - let type = try container.decode(CustomColorType.self, forKey: .type) - - switch type { - case .red: - self = .red - case .yellow: - self = .yellow - case .green: - self = .green - case .orange: - self = .orange - case .blue: - self = .blue - case .black: - self = .black - case .white: - self = .white - case .custom: - let color = try container.decode(Color.self, forKey: .color) - self = .custom(color.uiColor) - } - } - } - - private enum LegacyFillColor: String, Decodable { - case red, yellow, green, orange, blue, black, white + let container = try decoder.container(keyedBy: CodingKeys.self) + let type = try container.decode(CustomColorType.self, forKey: .type) - var fillColor: Badge.FillColor { - switch self { - case .red: - return .red - case .yellow: - return .yellow - case .green: - return .green - case .orange: - return .orange - case .blue: - return .blue - case .black: - return .black - case .white: - return .white - } + switch type { + case .red: + self = .red + case .yellow: + self = .yellow + case .green: + self = .green + case .orange: + self = .orange + case .blue: + self = .blue + case .black: + self = .black + case .white: + self = .white + case .custom: + let color = try container.decode(Color.self, forKey: .color) + self = .custom(color.uiColor) } } From 7eb1a4ff4b3de58be62253df6b1da2c6682bcbcf Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 15 Oct 2024 16:57:37 -0500 Subject: [PATCH 4/5] redid the values Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Views/BadgeModel.swift | 13 +++-- .../Atomic/Extensions/VDS-Enums+Codable.swift | 47 ++++++++----------- 2 files changed, 27 insertions(+), 33 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/BadgeModel.swift b/MVMCoreUI/Atomic/Atoms/Views/BadgeModel.swift index 59309c49..de5d0dd4 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/BadgeModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/BadgeModel.swift @@ -27,11 +27,13 @@ open class BadgeModel: MoleculeModelProtocol { public var maxWidth: CGFloat? public var numberOfLines: Int = 1 public var fillColorStyle = Badge.FillColor.red - public var fillColor: Color? public var surface: Surface = .light private enum CodingKeys: String, CodingKey { - case id, accessibilityIdentifier, text, textColor, textColorStyle, accessibilityText, fillColor, fillColorStyle, surface, numberOfLines, maxWidth + case id, accessibilityIdentifier, accessibilityText + case surface, numberOfLines, maxWidth + case text, textColor + case fillColor, fillColorStyle } required public convenience init(from decoder: Decoder) throws { @@ -48,7 +50,7 @@ open class BadgeModel: MoleculeModelProtocol { } //look for a style - fillColorStyle = try container.decodeIfPresent(Badge.FillColor.self, forKey: .fillColor) ?? .red + fillColorStyle = try container.decodeIfPresent(Badge.FillColor.self, forKey: .fillColorStyle) ?? .red //look for a color and set the style if let fillColor = try container.decodeIfPresent(Color.self, forKey: .fillColor) { @@ -65,10 +67,10 @@ open class BadgeModel: MoleculeModelProtocol { try container.encode(text, forKey: .text) try container.encode(accessibilityText, forKey: .accessibilityText) try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier) - try container.encode(fillColor, forKey: .fillColor) try container.encode(surface, forKey: .surface) try container.encode(numberOfLines, forKey: .numberOfLines) try container.encodeIfPresent(maxWidth, forKey: .maxWidth) + try container.encode(fillColorStyle, forKey: .fillColorStyle) switch textColorStyle { case .custom(let color): try container.encode(Color(uiColor: color), forKey: .textColor) @@ -80,7 +82,8 @@ open class BadgeModel: MoleculeModelProtocol { public func isEqual(to model: any ModelComparisonProtocol) -> Bool { guard let model = model as? BadgeModel else { return false } return self.backgroundColor == model.backgroundColor - && self.fillColor == model.fillColor + && self.fillColorStyle == model.fillColorStyle + && self.textColorStyle == model.textColorStyle && self.numberOfLines == model.numberOfLines && self.text == model.text && self.surface == model.surface diff --git a/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift b/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift index 93669dc4..1109cece 100644 --- a/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift +++ b/MVMCoreUI/Atomic/Extensions/VDS-Enums+Codable.swift @@ -294,49 +294,40 @@ extension VDS.TitleLockup.TextColor: Codable { } extension VDS.Badge.FillColor: Codable { - enum CodingKeys: String, CodingKey { - case type - case color - } - - enum CustomColorType: String, Codable { - case red, yellow, green, orange, blue, black, white - case custom - } - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - let type = try container.decode(CustomColorType.self, forKey: .type) - + let container = try decoder.singleValueContainer() + let type = try container.decode(String.self) switch type { - case .red: + case "red": self = .red - case .yellow: + case "yellow": self = .yellow - case .green: + case "green": self = .green - case .orange: + case "orange": self = .orange - case .blue: + case "blue": self = .blue - case .black: + case "black": self = .black - case .white: + case "white": self = .white - case .custom: - let color = try container.decode(Color.self, forKey: .color) - self = .custom(color.uiColor) + default: + if let color = try? Color(from: decoder) { + self = .custom(color.uiColor) + } else { + self = .custom(UIColor(hexString: type)) + } } } public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) + var container = encoder.singleValueContainer() switch self { - case .custom(let color): - try container.encode(CustomColorType.custom.rawValue, forKey: .type) - try container.encode(Color(uiColor: color), forKey: .color) + case .custom(let value): + try container.encode(Color(uiColor: value)) default: - try container.encode("\(self)", forKey: .type) + try container.encode(String(reflecting: self)) } } } From 7bed914dca20a97c5975052bdb9c16153ed76388 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Wed, 16 Oct 2024 10:53:16 -0400 Subject: [PATCH 5/5] Digital ACT191 defect CXTDT-626309 - Updating fonts and spacing Digital ACT191 defect CXTDT-628092 - Fixing accessibility trait header default. --- .../Headers/H1/HeadersH1ButtonModel.swift | 3 +++ .../Headers/H1/HeadersH1NoButtonsBodyTextModel.swift | 3 +++ .../Headers/H2/HeadersH2ButtonsModel.swift | 3 +++ .../Headers/H2/HeadersH2CaretLinkModel.swift | 3 +++ .../DesignedComponents/Headers/H2/HeadersH2LinkModel.swift | 3 +++ .../Headers/H2/HeadersH2NoButtonsBodyTextModel.swift | 3 +++ .../Headers/H2/HeadersH2TinyButtonModel.swift | 3 +++ .../ListOneColumnTextWithWhitespaceDividerShort.swift | 6 +++--- .../ListOneColumnTextWithWhitespaceDividerShortModel.swift | 3 +++ .../ListOneColumnTextWithWhitespaceDividerTall.swift | 6 +++--- .../ListOneColumnTextWithWhitespaceDividerTallModel.swift | 3 +++ MVMCoreUI/Atomic/Molecules/Items/ListItemModel.swift | 4 ++-- 12 files changed, 35 insertions(+), 8 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1ButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1ButtonModel.swift index 901cf057..e228ea34 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1ButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1ButtonModel.swift @@ -52,6 +52,9 @@ public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol, ParentMol if titleLockup.subTitle?.fontStyle == nil { titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium } + if titleLockup.title.accessibilityTraits == nil { + titleLockup.title.accessibilityTraits = [.header] + } } //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift index 05457cdf..f3191358 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H1/HeadersH1NoButtonsBodyTextModel.swift @@ -31,6 +31,9 @@ public class HeadersH1NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol if titleLockup.subTitle?.fontStyle == nil { titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium } + if titleLockup.title.accessibilityTraits == nil { + titleLockup.title.accessibilityTraits = [.header] + } } //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift index accd139e..b40ced44 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2ButtonsModel.swift @@ -53,6 +53,9 @@ public class HeadersH2ButtonsModel: HeaderModel, MoleculeModelProtocol, ParentMo if titleLockup.subTitle?.fontStyle == nil { titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium } + if titleLockup.title.accessibilityTraits == nil { + titleLockup.title.accessibilityTraits = [.header] + } super.setDefaults() } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2CaretLinkModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2CaretLinkModel.swift index 6675abcf..f5277136 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2CaretLinkModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2CaretLinkModel.swift @@ -48,6 +48,9 @@ public class HeadersH2CaretLinkModel: HeaderModel, MoleculeModelProtocol, Parent if titleLockup.subTitle?.fontStyle == nil { titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium } + if titleLockup.title.accessibilityTraits == nil { + titleLockup.title.accessibilityTraits = [.header] + } super.setDefaults() } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift index 1a95bf73..f0084f99 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2LinkModel.swift @@ -52,6 +52,9 @@ public class HeadersH2LinkModel: HeaderModel, ParentMoleculeModelProtocol { if titleLockup.subTitle?.fontStyle == nil { titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium } + if titleLockup.title.accessibilityTraits == nil { + titleLockup.title.accessibilityTraits = [.header] + } super.setDefaults() } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift index 95414411..e5889562 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2NoButtonsBodyTextModel.swift @@ -42,6 +42,9 @@ public class HeadersH2NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol if titleLockup.subTitle?.fontStyle == nil { titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium } + if titleLockup.title.accessibilityTraits == nil { + titleLockup.title.accessibilityTraits = [.header] + } super.setDefaults() } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift index a8271b8f..5f7b4017 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/H2/HeadersH2TinyButtonModel.swift @@ -53,6 +53,9 @@ public class HeadersH2TinyButtonModel: HeaderModel, MoleculeModelProtocol, Paren if titleLockup.subTitle?.fontStyle == nil { titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium } + if titleLockup.title.accessibilityTraits == nil { + titleLockup.title.accessibilityTraits = [.header] + } super.setDefaults() button.style = .secondary button.size = .small diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift index 72dc78c0..815e7ff0 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShort.swift @@ -15,7 +15,7 @@ import Foundation //----------------------------------------------------- public var stack: Stack - public let headline = Label(fontStyle: .BoldTitleMedium) + public let headline = Label(fontStyle: .BoldTitleLarge) public let body = Label(fontStyle: .RegularBodySmall) //-------------------------------------------------- @@ -24,7 +24,7 @@ import Foundation public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), - (view: body, model: StackItemModel(spacing: 0, horizontalAlignment: .leading))], + (view: body, model: StackItemModel(spacing: 8, horizontalAlignment: .leading))], axis: .vertical) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -63,7 +63,7 @@ import Foundation open override func reset() { super.reset() - headline.setFontStyle(.BoldTitleMedium) + headline.setFontStyle(.BoldTitleLarge) body.setFontStyle(.RegularBodySmall) } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift index 141641e5..1ee3e04f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerShortModel.swift @@ -47,6 +47,9 @@ public class ListOneColumnTextWithWhitespaceDividerShortModel: ListItemModel, Mo override public func setDefaults() { style = .shortDivider + if headline.accessibilityTraits == nil { + headline.accessibilityTraits = [.header] + } super.setDefaults() } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift index 169c33c9..5c13690b 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTall.swift @@ -15,7 +15,7 @@ import Foundation //----------------------------------------------------- public var stack: Stack - public let headline = Label(fontStyle: .BoldTitleMedium) + public let headline = Label(fontStyle: .BoldTitleLarge) public let body = Label(fontStyle: .RegularBodySmall) //-------------------------------------------------- @@ -24,7 +24,7 @@ import Foundation public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { stack = Stack.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)), - (view: body, model: StackItemModel(spacing: 0, horizontalAlignment: .leading))], + (view: body, model: StackItemModel(spacing: 8, horizontalAlignment: .leading))], axis: .vertical) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -62,7 +62,7 @@ import Foundation open override func reset() { super.reset() - headline.setFontStyle(.BoldTitleMedium) + headline.setFontStyle(.BoldTitleLarge) body.setFontStyle(.RegularBodySmall) accessibilityLabel = nil } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift index 74fd2965..44225509 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/OneColumn/ListOneColumnTextWithWhitespaceDividerTallModel.swift @@ -47,6 +47,9 @@ public class ListOneColumnTextWithWhitespaceDividerTallModel: ListItemModel, Mol override public func setDefaults() { style = .tallDivider + if headline.accessibilityTraits == nil { + headline.accessibilityTraits = [.header] + } super.setDefaults() } diff --git a/MVMCoreUI/Atomic/Molecules/Items/ListItemModel.swift b/MVMCoreUI/Atomic/Molecules/Items/ListItemModel.swift index 3ac37b49..50692689 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/ListItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/ListItemModel.swift @@ -72,9 +72,9 @@ import MVMCore case .standard: set(topPadding: Padding.Component.VerticalMarginSpacing, bottomPadding: Padding.Component.VerticalMarginSpacing) case .shortDivider: - set(topPadding: Padding.Component.LargeVerticalMarginSpacing, bottomPadding: Padding.Four) + set(topPadding: Padding.Component.LargeVerticalMarginSpacing, bottomPadding: Padding.Five) case .tallDivider: - set(topPadding: Padding.Twelve, bottomPadding: Padding.Four) + set(topPadding: Padding.Twelve, bottomPadding: Padding.Five) case .sectionFooter: set(topPadding: Padding.Component.VerticalMarginSpacing, bottomPadding: 0) case ListItemStyle.none: