made structs codable and remove textAttributes (for now on Tilet)
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
3beacb2a5e
commit
ec9f853b3d
@ -10,7 +10,7 @@ import UIKit
|
||||
import VDSColorTokens
|
||||
import Combine
|
||||
|
||||
public enum IconSize: String, CaseIterable {
|
||||
public enum IconSize: String, CaseIterable, Codable {
|
||||
case xsmall
|
||||
case small
|
||||
case medium
|
||||
|
||||
@ -9,7 +9,7 @@ import Foundation
|
||||
import UIKit
|
||||
import VDSColorTokens
|
||||
|
||||
public struct IconName: RawRepresentable {
|
||||
public struct IconName: RawRepresentable, Codable {
|
||||
public typealias RawValue = String
|
||||
public var rawValue: String
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct TiletBadgeModel {
|
||||
public struct TiletBadgeModel: Codable {
|
||||
public var text: String = ""
|
||||
public var fillColor: BadgeFillColor
|
||||
public var surface: Surface
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
public struct TiletDescriptiveIcon {
|
||||
public var name: IconName
|
||||
public var size: IconSize
|
||||
public var surface: Surface
|
||||
public struct TiletDescriptiveIcon: Codable {
|
||||
public var name: IconName = .multipleDocuments
|
||||
public var size: IconSize = .medium
|
||||
public var surface: Surface = .light
|
||||
|
||||
public init(name: IconName = .multipleDocuments, size: IconSize, surface: Surface) {
|
||||
self.name = name
|
||||
@ -20,9 +20,9 @@ public struct TiletDescriptiveIcon {
|
||||
}
|
||||
}
|
||||
|
||||
public struct TiletDirectionalIcon {
|
||||
public var size: IconSize
|
||||
public var surface: Surface
|
||||
public struct TiletDirectionalIcon: Codable {
|
||||
public var size: IconSize = .medium
|
||||
public var surface: Surface = .light
|
||||
|
||||
public init(size: IconSize, surface: Surface) {
|
||||
self.size = size
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct TiletSubTitleModel {
|
||||
public struct TiletSubTitleModel: Codable {
|
||||
public enum SubTitleTypographicalStyle: String, Codable, EnumSubset {
|
||||
case BodyLarge
|
||||
case BoldBodyLarge
|
||||
@ -20,7 +20,6 @@ public struct TiletSubTitleModel {
|
||||
}
|
||||
|
||||
public var text: String = ""
|
||||
public var textAttributes: [any LabelAttributeModel]?
|
||||
public var typographicalStyle: SubTitleTypographicalStyle
|
||||
public var textColor: Use
|
||||
|
||||
@ -30,13 +29,12 @@ public struct TiletSubTitleModel {
|
||||
typographicalStyle: SubTitleTypographicalStyle = .BodySmall) {
|
||||
self.text = text
|
||||
self.textColor = textColor
|
||||
self.textAttributes = textAttributes
|
||||
self.typographicalStyle = typographicalStyle
|
||||
}
|
||||
|
||||
public func toTitleLockupSubTitleModel() -> TitleLockupSubTitleModel {
|
||||
TitleLockupSubTitleModel(text: text,
|
||||
textColor: textColor,
|
||||
textAttributes: textAttributes)
|
||||
textAttributes: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct TiletTitleModel {
|
||||
public enum TitleTypographicalStyle: String, EnumSubset {
|
||||
public struct TiletTitleModel: Codable {
|
||||
public enum TitleTypographicalStyle: String, EnumSubset, Codable {
|
||||
case TitleXLarge
|
||||
case BoldTitleXLarge
|
||||
case TitleLarge
|
||||
@ -22,18 +22,17 @@ public struct TiletTitleModel {
|
||||
}
|
||||
|
||||
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)
|
||||
TitleLockupTitleModel(text: text,
|
||||
textAttributes: nil,
|
||||
typographicalStyle: typographicalStyle.value)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user