added surface

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-07-02 10:56:40 -05:00
parent 847daee32f
commit 568ab2e5e5
2 changed files with 7 additions and 1 deletions

View File

@ -39,6 +39,8 @@ import VDS
// MARK: - Atomic
//--------------------------------------------------
public func viewModelDidUpdate() {
surface = viewModel.surface
updateCheckbox()
//primary label

View File

@ -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
}
}