40 lines
1.1 KiB
Swift
40 lines
1.1 KiB
Swift
//
|
|
// TiletTitleModel.swift
|
|
// VDS
|
|
//
|
|
// Created by Matt Bruce on 1/6/23.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct TiletTitleModel {
|
|
public enum TitleTypographicalStyle: String, EnumSubset {
|
|
case TitleXLarge
|
|
case BoldTitleXLarge
|
|
case TitleLarge
|
|
case BoldTitleLarge
|
|
case TitleMedium
|
|
case BoldTitleMedium
|
|
case TitleSmall
|
|
case BoldTitleSmall
|
|
|
|
public var defaultValue: TitleLockupTitleTypographicalStyle { .BoldTitleSmall }
|
|
}
|
|
|
|
public var text: String = ""
|
|
public var textAttributes: [any LabelAttributeModel]?
|
|
public var typographicalStyle: TitleTypographicalStyle
|
|
|
|
public init(text: String,
|
|
textAttributes: [any LabelAttributeModel]? = nil,
|
|
typographicalStyle: TitleTypographicalStyle = .BoldTitleSmall) {
|
|
self.text = text
|
|
self.textAttributes = textAttributes
|
|
self.typographicalStyle = typographicalStyle
|
|
}
|
|
|
|
public func toTitleLockupTitleModel() -> TitleLockupTitleModel {
|
|
TitleLockupTitleModel(text: text, textAttributes: textAttributes, typographicalStyle: typographicalStyle.value)
|
|
}
|
|
}
|