From 28c15efba50694618046640ae9128af063715565 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 12 Feb 2024 17:32:34 -0600 Subject: [PATCH] refactored atoms with style changes Signed-off-by: Matt Bruce --- .../Atoms/FormFields/TextFields/EntryField.swift | 14 +++++++------- MVMCoreUI/Atomic/Atoms/Views/Label/FormLabel.swift | 6 +----- .../LockUps/LockupsPlanSMLXL.swift | 7 ++----- .../LeftRightViews/ActionDetailWithImage.swift | 4 ++-- .../ToggleMolecules/LabelToggle.swift | 2 +- .../HeadlineBodyButton.swift | 4 ++-- 6 files changed, 15 insertions(+), 22 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/EntryField.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/EntryField.swift index c583638c..bc3e9617 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/EntryField.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/EntryField.swift @@ -19,6 +19,7 @@ import UIKit //-------------------------------------------------- public private(set) var titleLabel: FormLabel = { let label = FormLabel() + label.setFontStyle(.RegularMicro) label.setContentCompressionResistancePriority(.required, for: .vertical) return label }() @@ -28,6 +29,7 @@ import UIKit /// Provides contextual information on the TextField. public private(set) var feedbackLabel: FormLabel = { let label = FormLabel() + label.setFontStyle(.RegularMicro) label.setContentCompressionResistancePriority(.required, for: .vertical) return label }() @@ -276,15 +278,13 @@ import UIKit backgroundColor = .clear isAccessibilityElement = false - titleLabel.font = Styler.Font.RegularMicro.getFont() - titleLabel.textColor = .mvmBlack - feedbackLabel.font = Styler.Font.RegularMicro.getFont() - feedbackLabel.textColor = .mvmBlack - errorLabel.font = Styler.Font.RegularMicro.getFont() - errorLabel.textColor = .mvmBlack + titleLabel.setFontStyle(.RegularMicro) + feedbackLabel.setFontStyle(.RegularMicro) + errorLabel.setFontStyle(.RegularMicro) + titleLabel.text = nil + feedbackLabel.text = nil errorLabel.text = nil entryFieldContainer.disableAllBorders = false - feedbackLabel.text = nil entryFieldContainer.reset() entryFieldModel?.updateUI = nil } diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/FormLabel.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/FormLabel.swift index 08b7267e..a7755928 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/FormLabel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/FormLabel.swift @@ -9,11 +9,7 @@ import Foundation /// Subclass of label that helps with different states -public class FormLabel: Label { - //properties used in setting label - private var delegateObject: MVMCoreUIDelegateObject? - private var additionalData: [AnyHashable: Any]? - +public class FormLabel: Label { //models that drive the label UI private var formModel: FormLabelModel! diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/LockupsPlanSMLXL.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/LockupsPlanSMLXL.swift index c0d4c44f..5e990303 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/LockupsPlanSMLXL.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/LockUps/LockupsPlanSMLXL.swift @@ -12,7 +12,7 @@ import Foundation //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- - public let planLabel = Label() + public let planLabel = Label(fontStyle: .BoldFeatureXLarge) public let headline = Label(fontStyle: .BoldTitleLarge) public let subHeadline = Label(fontStyle: .RegularTitleLarge) public let body = Label(fontStyle: .RegularBodySmall) @@ -33,8 +33,6 @@ import Foundation //------------------------------------------------------- open override func setupView() { super.setupView() - planLabel.font = MFStyler.getMVA3FontSize(96, bold: true) - planLabel.standardFontSize = 96 addSubview(stack) planLabel.setContentCompressionResistancePriority(.required, for: .horizontal) planLabel.setContentHuggingPriority(.defaultHigh, for: .vertical) @@ -94,8 +92,7 @@ import Foundation open override func reset() { super.reset() stack.reset() - planLabel.font = MFStyler.getMVA3FontSize(96, bold: true) - planLabel.standardFontSize = 96 + planLabel.setFontStyle(.BoldFeatureXLarge) headline.setFontStyle(.BoldTitleLarge) subHeadline.setFontStyle(.RegularTitleLarge) body.setFontStyle(.RegularBodySmall) diff --git a/MVMCoreUI/Atomic/Molecules/LeftRightViews/ActionDetailWithImage.swift b/MVMCoreUI/Atomic/Molecules/LeftRightViews/ActionDetailWithImage.swift index 74543d21..d3a346fc 100644 --- a/MVMCoreUI/Atomic/Molecules/LeftRightViews/ActionDetailWithImage.swift +++ b/MVMCoreUI/Atomic/Molecules/LeftRightViews/ActionDetailWithImage.swift @@ -76,8 +76,8 @@ import UIKit private func setDefaultState() { - headlineBodyButton.headlineBody.headlineLabel.font = MFStyler.fontBoldTitleMedium() - headlineBodyButton.headlineBody.messageLabel.font = MFStyler.fontRegularMicro() + headlineBodyButton.headlineBody.headlineLabel.setFontStyle(.BoldTitleMedium) + headlineBodyButton.headlineBody.messageLabel.setFontStyle(.RegularMicro) imageLoader.imageView.contentMode = .scaleAspectFit imageLoader.addSizeConstraintsForAspectRatio = true buttonHeaderPadding = PaddingTwo diff --git a/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggle.swift b/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggle.swift index 5611984f..98fbb779 100644 --- a/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggle.swift +++ b/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggle.swift @@ -14,7 +14,7 @@ import UIKit // MARK: - Properties //-------------------------------------------------- - public let label = Label(fontStyle: .BoldBodySmall) + public let label = Label().with { $0.font = Styler.Font.BoldFeatureXLarge.getFont() } public let toggle = Toggle() //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyButton.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyButton.swift index d7fced36..893b73d8 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyButton.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyButton.swift @@ -62,8 +62,8 @@ private func defaultState() { - headlineBody.headlineLabel.font = Styler.Font.BoldTitleMedium.getFont() - headlineBody.messageLabel.font = Styler.Font.RegularMicro.getFont() + headlineBody.headlineLabel.setFontStyle(.BoldTitleMedium) + headlineBody.messageLabel.setFontStyle(.RegularMicro) button.use = .secondary button.isHidden = false buttonHeadlinePadding = PaddingTwo