diff --git a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift index 3a1722e0..e21f9895 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift @@ -39,6 +39,8 @@ import VDS // MARK: - Atomic //-------------------------------------------------- public func viewModelDidUpdate() { + surface = viewModel.surface + updateCheckbox() //primary label diff --git a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabelModel.swift b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabelModel.swift index 31cdf46d..1592bd02 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabelModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabelModel.swift @@ -8,6 +8,7 @@ import Foundation import MVMCore +import VDS public enum CheckboxPosition: String, Codable { case center @@ -24,6 +25,8 @@ public enum CheckboxPosition: String, Codable { public var checkbox: CheckboxModel public var label: LabelModel public var subtitle: LabelModel? + public var inverted: Bool = false + public var surface: Surface { inverted ? .dark : .light } public var children: [MoleculeModelProtocol] { guard let subtitle else { return [checkbox, label] } @@ -34,9 +37,10 @@ public enum CheckboxPosition: String, Codable { // MARK: - Initializer //-------------------------------------------------- - public init(checkbox: CheckboxModel, label: LabelModel) { + public init(checkbox: CheckboxModel, label: LabelModel, subtitle: LabelModel?) { self.checkbox = checkbox self.label = label + self.subtitle = subtitle } }