vds_ios/VDS/Components/Tilelet/TileletSubTitleModel.swift
Matt Bruce 98968bacbd refactored out top/bottom spacing config and created new one
updated models to use a StandardStyle
updated Tilelet/TitleLockup to use new features

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2023-06-29 12:06:28 -05:00

54 lines
1.9 KiB
Swift

//
// TiletSubTitleModel.swift
// VDS
//
// Created by Matt Bruce on 1/6/23.
//
import Foundation
extension Tilelet {
public struct SubTitleModel {
//--------------------------------------------------
// MARK: - Enums
//--------------------------------------------------
public enum StandardStyle: String, EnumSubset {
case bodyLarge
case bodyMedium
case bodySmall
public var defaultValue: TitleLockup.OtherStandardStyle { .bodySmall }
}
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
public var text: String = ""
public var standardStyle: StandardStyle = .bodySmall
public var textAttributes: [any LabelAttributeModel]?
public var textColor: Use = .primary
//--------------------------------------------------
// MARK: - Initializers
//--------------------------------------------------
public init(text: String,
textColor: Use = .primary,
textAttributes: [any LabelAttributeModel]? = nil,
standardStyle: StandardStyle = .bodySmall) {
self.text = text
self.textAttributes = textAttributes
self.textColor = textColor
self.standardStyle = standardStyle
}
//--------------------------------------------------
// MARK: - Public Functions
//--------------------------------------------------
public func toTitleLockupSubTitleModel() -> TitleLockup.SubTitleModel {
TitleLockup.SubTitleModel(text: text,
standardStyle: standardStyle.value,
textColor: textColor,
textAttributes: textAttributes)
}
}
}