vds_ios/VDS/Components/Tilelet/TileletSubTitleModel.swift
Matt Bruce 21ac83af4f removed codable
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2023-01-25 11:50:11 -06:00

56 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 TextStyle: String, EnumSubset {
case bodyLarge
case boldBodyLarge
case bodyMedium
case boldBodyMedium
case bodySmall
case boldBodySmall
public var defaultValue: TitleLockup.OtherTextStyle { .bodySmall }
}
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
public var text: String = ""
public var textStyle: TextStyle = .bodySmall
public var textAttributes: [any LabelAttributeModel]?
public var textColor: Use = .primary
//--------------------------------------------------
// MARK: - Initializers
//--------------------------------------------------
public init(text: String,
textColor: Use = .primary,
textAttributes: [any LabelAttributeModel]? = nil,
textStyle: TextStyle = .bodySmall) {
self.text = text
self.textAttributes = textAttributes
self.textColor = textColor
self.textStyle = textStyle
}
//--------------------------------------------------
// MARK: - Public Functions
//--------------------------------------------------
public func toTitleLockupSubTitleModel() -> TitleLockup.SubTitleModel {
TitleLockup.SubTitleModel(text: text,
textColor: textColor,
textAttributes: nil)
}
}
}