vds_ios/VDS/Components/TitleLockup/TitleLockupEyebrowModel.swift
Matt Bruce ba8e557cd0 updated didset
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2023-08-30 18:04:46 -05:00

51 lines
1.8 KiB
Swift

//
// TitleLockupEyebrowModel.swift
// VDS
//
// Created by Matt Bruce on 1/6/23.
//
import Foundation
extension TitleLockup {
/// Model that represents the options available for the eyebrow label.
public struct EyebrowModel: Equatable, Identifiable {
public static func == (lhs: EyebrowModel, rhs: EyebrowModel) -> Bool {
lhs.id == rhs.id
}
public var id: String = UUID().uuidString
/// Text that will be used for the eyebrow label.
public var text: String
/// Used in combination with standardStyle to set the textStyle that will be used for the eyebrow label.
public var isBold: Bool
/// Array of LabelAttributeModel objects used in rendering the text in the eyebrow label.
public var textAttributes: [any LabelAttributeModel]?
/// Standard style that will be used for the eyebrow label.
public var standardStyle: OtherStandardStyle
/// Number of lines that will be used for the eyebrow label.
public var numberOfLines: Int
public init(text: String,
isBold: Bool = true,
standardStyle: OtherStandardStyle = .bodyLarge,
textAttributes: [any LabelAttributeModel]? = nil,
numberOfLines: Int = 0) {
self.text = text
self.isBold = isBold
self.standardStyle = standardStyle
self.textAttributes = textAttributes
self.numberOfLines = numberOfLines
}
/// Text style that will be used for the eyebrow label.
public var textStyle: TextStyle { isBold ? standardStyle.value.bold : standardStyle.value.regular }
}
}