refactored TextStyle enums to camelCase
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
cdaa86a59e
commit
35d1f4071d
@ -29,7 +29,7 @@ public class Badge: View, Accessable {
|
||||
$0.adjustsFontSizeToFitWidth = false
|
||||
$0.lineBreakMode = .byTruncatingTail
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BoldBodySmall
|
||||
$0.textStyle = .boldBodySmall
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -86,7 +86,7 @@ public class Badge: View, Accessable {
|
||||
label.reset()
|
||||
label.lineBreakMode = .byTruncatingTail
|
||||
label.textPosition = .left
|
||||
label.textStyle = .BoldBodySmall
|
||||
label.textStyle = .boldBodySmall
|
||||
|
||||
fillColor = .red
|
||||
text = ""
|
||||
|
||||
@ -43,7 +43,7 @@ open class Button: ButtonBase, Useable {
|
||||
}
|
||||
|
||||
open override var textStyle: TextStyle {
|
||||
size == .large ? TextStyle.BoldBodyLarge : TextStyle.BoldBodySmall
|
||||
size == .large ? TextStyle.boldBodyLarge : TextStyle.boldBodySmall
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -27,7 +27,7 @@ open class TextLink: ButtonBase {
|
||||
open override var availableSizes: [ButtonSize] { [.large, .small] }
|
||||
|
||||
open override var textStyle: TextStyle {
|
||||
size == .large ? TextStyle.BodyLarge : TextStyle.BodySmall
|
||||
size == .large ? TextStyle.bodyLarge : TextStyle.bodySmall
|
||||
}
|
||||
|
||||
open override var textColor: UIColor {
|
||||
|
||||
@ -25,7 +25,7 @@ open class TextLinkCaret: ButtonBase {
|
||||
// MARK: - Private Properties
|
||||
//--------------------------------------------------
|
||||
open override var textStyle: TextStyle {
|
||||
TextStyle.BoldBodyLarge
|
||||
TextStyle.boldBodyLarge
|
||||
}
|
||||
|
||||
private var caretView = CaretView().with {
|
||||
|
||||
@ -76,19 +76,19 @@ open class CheckboxBase: Control, Accessable, DataTrackable, Errorable {
|
||||
private var label = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BoldBodyLarge
|
||||
$0.textStyle = .boldBodyLarge
|
||||
}
|
||||
|
||||
private var childLabel = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BodyLarge
|
||||
$0.textStyle = .bodyLarge
|
||||
}
|
||||
|
||||
private var errorLabel = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BodyMedium
|
||||
$0.textStyle = .bodyMedium
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -272,9 +272,9 @@ open class CheckboxBase: Control, Accessable, DataTrackable, Errorable {
|
||||
childLabel.reset()
|
||||
errorLabel.reset()
|
||||
|
||||
label.textStyle = .BoldBodyLarge
|
||||
childLabel.textStyle = .BodyLarge
|
||||
errorLabel.textStyle = .BodyMedium
|
||||
label.textStyle = .boldBodyLarge
|
||||
childLabel.textStyle = .bodyLarge
|
||||
errorLabel.textStyle = .bodyMedium
|
||||
|
||||
labelText = nil
|
||||
labelTextAttributes = nil
|
||||
|
||||
@ -70,19 +70,19 @@ open class RadioBoxBase: Control, Accessable, DataTrackable{
|
||||
private var textLabel = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BoldBodyLarge
|
||||
$0.textStyle = .boldBodyLarge
|
||||
}
|
||||
|
||||
private var subTextLabel = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BodyLarge
|
||||
$0.textStyle = .bodyLarge
|
||||
}
|
||||
|
||||
private var subTextRightLabel = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textPosition = .right
|
||||
$0.textStyle = .BodyLarge
|
||||
$0.textStyle = .bodyLarge
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -226,9 +226,9 @@ open class RadioBoxBase: Control, Accessable, DataTrackable{
|
||||
subTextLabel.reset()
|
||||
subTextRightLabel.reset()
|
||||
|
||||
textLabel.textStyle = .BoldBodyLarge
|
||||
subTextLabel.textStyle = .BodyLarge
|
||||
subTextRightLabel.textStyle = .BodyLarge
|
||||
textLabel.textStyle = .boldBodyLarge
|
||||
subTextLabel.textStyle = .bodyLarge
|
||||
subTextRightLabel.textStyle = .bodyLarge
|
||||
|
||||
text = "Default Text"
|
||||
textAttributes = nil
|
||||
|
||||
@ -83,19 +83,19 @@ open class RadioButtonBase: Control, Accessable, DataTrackable, Errorable {
|
||||
private var label = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BoldBodyLarge
|
||||
$0.textStyle = .boldBodyLarge
|
||||
}
|
||||
|
||||
private var childLabel = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BodyLarge
|
||||
$0.textStyle = .bodyLarge
|
||||
}
|
||||
|
||||
private var errorLabel = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BodyMedium
|
||||
$0.textStyle = .bodyMedium
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -269,9 +269,9 @@ open class RadioButtonBase: Control, Accessable, DataTrackable, Errorable {
|
||||
childLabel.reset()
|
||||
errorLabel.reset()
|
||||
|
||||
label.textStyle = .BoldBodyLarge
|
||||
childLabel.textStyle = .BodyLarge
|
||||
errorLabel.textStyle = .BodyMedium
|
||||
label.textStyle = .boldBodyLarge
|
||||
childLabel.textStyle = .bodyLarge
|
||||
errorLabel.textStyle = .bodyMedium
|
||||
|
||||
labelText = nil
|
||||
labelTextAttributes = nil
|
||||
|
||||
@ -117,7 +117,7 @@ public class RadioSwatchGroupBase<HandlerType: RadioSwatchBase>: SelectorGroupSe
|
||||
|
||||
open override func updateView() {
|
||||
label.textPosition = .left
|
||||
label.textStyle = .BodySmall
|
||||
label.textStyle = .bodySmall
|
||||
label.text = selectedHandler?.text ?? " "
|
||||
label.surface = surface
|
||||
label.disabled = disabled
|
||||
|
||||
@ -50,19 +50,19 @@ open class EntryField: Control, Accessable {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.attributes = []
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BodySmall
|
||||
$0.textStyle = .bodySmall
|
||||
}
|
||||
|
||||
internal var errorLabel = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BodySmall
|
||||
$0.textStyle = .bodySmall
|
||||
}
|
||||
|
||||
internal var helperLabel = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BodySmall
|
||||
$0.textStyle = .bodySmall
|
||||
}
|
||||
|
||||
internal var containerView: UIView = {
|
||||
@ -249,7 +249,7 @@ open class EntryField: Control, Accessable {
|
||||
let title = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BoldBodySmall
|
||||
$0.textStyle = .boldBodySmall
|
||||
$0.text = tooltipTitle
|
||||
$0.surface = surface
|
||||
$0.disabled = disabled
|
||||
@ -258,7 +258,7 @@ open class EntryField: Control, Accessable {
|
||||
let content = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BoldBodySmall
|
||||
$0.textStyle = .boldBodySmall
|
||||
$0.text = tooltipContent
|
||||
$0.surface = surface
|
||||
$0.disabled = disabled
|
||||
@ -283,11 +283,11 @@ open class EntryField: Control, Accessable {
|
||||
helperLabel.reset()
|
||||
|
||||
titleLabel.textPosition = .left
|
||||
titleLabel.textStyle = .BodySmall
|
||||
titleLabel.textStyle = .bodySmall
|
||||
errorLabel.textPosition = .left
|
||||
errorLabel.textStyle = .BodySmall
|
||||
errorLabel.textStyle = .bodySmall
|
||||
helperLabel.textPosition = .left
|
||||
helperLabel.textStyle = .BodySmall
|
||||
helperLabel.textStyle = .bodySmall
|
||||
|
||||
labelText = nil
|
||||
helperText = nil
|
||||
|
||||
@ -95,12 +95,12 @@ public class InputField: EntryField, UITextFieldDelegate {
|
||||
private var successLabel = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textPosition = .left
|
||||
$0.textStyle = .BodySmall
|
||||
$0.textStyle = .bodySmall
|
||||
}
|
||||
|
||||
private var textField = UITextField().with {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.font = TextStyle.BodyLarge.font
|
||||
$0.font = TextStyle.bodyLarge.font
|
||||
}
|
||||
|
||||
public var textFieldTextColorConfiguration: AnyColorable = ViewColorConfiguration().with {
|
||||
@ -147,7 +147,7 @@ public class InputField: EntryField, UITextFieldDelegate {
|
||||
|
||||
successLabel.reset()
|
||||
successLabel.textPosition = .left
|
||||
successLabel.textStyle = .BodySmall
|
||||
successLabel.textStyle = .bodySmall
|
||||
|
||||
type = .text
|
||||
showSuccess = false
|
||||
|
||||
@ -48,7 +48,7 @@ public class TextArea: EntryField {
|
||||
|
||||
private var textView = UITextView().with {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.font = TextStyle.BodyLarge.font
|
||||
$0.font = TextStyle.bodyLarge.font
|
||||
$0.sizeToFit()
|
||||
$0.isScrollEnabled = false
|
||||
}
|
||||
|
||||
@ -53,57 +53,57 @@ open class Tilet: TileContainer {
|
||||
|
||||
private var titleLockup = TitleLockup().with {
|
||||
let configs = [
|
||||
TextStyle.DeviceSpacingConfig([.TitleSmall, .BoldTitleSmall],
|
||||
TextStyle.DeviceSpacingConfig([.titleSmall, .boldTitleSmall],
|
||||
neighboring: [
|
||||
.BodySmall, .BoldBodySmall,
|
||||
.BodyMedium, .BoldBodyMedium
|
||||
.bodySmall, .boldBodySmall,
|
||||
.bodyMedium, .boldBodyMedium
|
||||
],
|
||||
spacing: 8.0,
|
||||
deviceType: .iPhone),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.TitleMedium, .BoldTitleMedium,
|
||||
.TitleLarge, .BoldTitleLarge],
|
||||
TextStyle.DeviceSpacingConfig([.titleMedium, .boldTitleMedium,
|
||||
.titleLarge, .boldTitleLarge],
|
||||
neighboring: [
|
||||
.BodySmall, .BoldBodySmall,
|
||||
.BodyMedium, .BoldBodyMedium,
|
||||
.BodyLarge, .BoldBodyLarge],
|
||||
.bodySmall, .boldBodySmall,
|
||||
.bodyMedium, .boldBodyMedium,
|
||||
.bodyLarge, .boldBodyLarge],
|
||||
spacing: 8.0,
|
||||
deviceType: .iPhone),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.TitleXLarge, .BoldTitleXLarge],
|
||||
TextStyle.DeviceSpacingConfig([.titleXLarge, .boldTitleXLarge],
|
||||
neighboring: [
|
||||
.BodySmall, .BoldBodySmall,
|
||||
.BodyMedium, .BoldBodyMedium,
|
||||
.BodyLarge, .BoldBodyLarge,
|
||||
.TitleMedium, .BoldTitleMedium
|
||||
.bodySmall, .boldBodySmall,
|
||||
.bodyMedium, .boldBodyMedium,
|
||||
.bodyLarge, .boldBodyLarge,
|
||||
.titleMedium, .boldTitleMedium
|
||||
],
|
||||
spacing: 12.0,
|
||||
deviceType: .iPhone),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.TitleSmall, .BoldTitleSmall,
|
||||
.TitleMedium, .BoldTitleMedium],
|
||||
TextStyle.DeviceSpacingConfig([.titleSmall, .boldTitleSmall,
|
||||
.titleMedium, .boldTitleMedium],
|
||||
neighboring: [
|
||||
.BodySmall, .BoldBodySmall,
|
||||
.BodyMedium, .BoldBodyMedium,
|
||||
.BodyLarge, .BoldBodyLarge
|
||||
.bodySmall, .boldBodySmall,
|
||||
.bodyMedium, .boldBodyMedium,
|
||||
.bodyLarge, .boldBodyLarge
|
||||
],
|
||||
spacing: 8.0,
|
||||
deviceType: .iPad),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.TitleLarge, .BoldTitleLarge],
|
||||
TextStyle.DeviceSpacingConfig([.titleLarge, .boldTitleLarge],
|
||||
neighboring: [
|
||||
.BodySmall, .BoldBodySmall,
|
||||
.BodyMedium, .BoldBodyMedium,
|
||||
.BodyLarge, .BoldBodyLarge,
|
||||
.TitleSmall, .BoldTitleSmall
|
||||
.bodySmall, .boldBodySmall,
|
||||
.bodyMedium, .boldBodyMedium,
|
||||
.bodyLarge, .boldBodyLarge,
|
||||
.titleSmall, .boldTitleSmall
|
||||
],
|
||||
spacing: 12.0,
|
||||
deviceType: .iPad),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.TitleXLarge, .BoldTitleXLarge],
|
||||
TextStyle.DeviceSpacingConfig([.titleXLarge, .boldTitleXLarge],
|
||||
neighboring: [
|
||||
.BodyLarge, .BoldBodyLarge,
|
||||
.TitleMedium, .BoldTitleMedium
|
||||
.bodyLarge, .boldBodyLarge,
|
||||
.titleMedium, .boldTitleMedium
|
||||
],
|
||||
spacing: 16.0,
|
||||
deviceType: .iPad)
|
||||
@ -213,15 +213,7 @@ open class Tilet: TileContainer {
|
||||
width = 100
|
||||
aspectRatio = .none
|
||||
color = .black
|
||||
let view = UIView().with {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
}
|
||||
view.addSubview(stackView)
|
||||
stackView.pinTop()
|
||||
stackView.pinLeading()
|
||||
stackView.pinTrailing()
|
||||
stackView.bottomAnchor.constraint(lessThanOrEqualTo: view.bottomAnchor).isActive = true
|
||||
addContentView(view)
|
||||
addContentView(stackView)
|
||||
|
||||
//badge
|
||||
badgeContainerView.addSubview(badge)
|
||||
|
||||
@ -13,21 +13,21 @@ extension Tilet {
|
||||
// MARK: - Enums
|
||||
//--------------------------------------------------
|
||||
public enum TextStyle: String, Codable, EnumSubset {
|
||||
case BodyLarge
|
||||
case BoldBodyLarge
|
||||
case BodyMedium
|
||||
case BoldBodyMedium
|
||||
case BodySmall
|
||||
case BoldBodySmall
|
||||
case bodyLarge
|
||||
case boldBodyLarge
|
||||
case bodyMedium
|
||||
case boldBodyMedium
|
||||
case bodySmall
|
||||
case boldBodySmall
|
||||
|
||||
public var defaultValue: TitleLockup.OtherTextStyle { .BodySmall }
|
||||
public var defaultValue: TitleLockup.OtherTextStyle { .bodySmall }
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Public Properties
|
||||
//--------------------------------------------------
|
||||
public var text: String = ""
|
||||
public var textStyle: TextStyle = .BodySmall
|
||||
public var textStyle: TextStyle = .bodySmall
|
||||
public var textColor: Use = .primary
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -36,7 +36,7 @@ extension Tilet {
|
||||
public init(text: String,
|
||||
textColor: Use = .primary,
|
||||
textAttributes: [any LabelAttributeModel]? = nil,
|
||||
textStyle: TextStyle = .BodySmall) {
|
||||
textStyle: TextStyle = .bodySmall) {
|
||||
self.text = text
|
||||
self.textColor = textColor
|
||||
self.textStyle = textStyle
|
||||
|
||||
@ -13,29 +13,29 @@ extension Tilet {
|
||||
// MARK: - Enums
|
||||
//--------------------------------------------------
|
||||
public enum TextStyle: String, EnumSubset, Codable {
|
||||
case TitleXLarge
|
||||
case BoldTitleXLarge
|
||||
case TitleLarge
|
||||
case BoldTitleLarge
|
||||
case TitleMedium
|
||||
case BoldTitleMedium
|
||||
case TitleSmall
|
||||
case BoldTitleSmall
|
||||
case titleXLarge
|
||||
case boldTitleXLarge
|
||||
case titleLarge
|
||||
case boldTitleLarge
|
||||
case titleMedium
|
||||
case boldTitleMedium
|
||||
case titleSmall
|
||||
case boldTitleSmall
|
||||
|
||||
public var defaultValue: TitleLockup.TitleTextStyle { .BoldTitleSmall }
|
||||
public var defaultValue: TitleLockup.TitleTextStyle { .boldTitleSmall }
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Public Properties
|
||||
//--------------------------------------------------
|
||||
public var text: String = ""
|
||||
public var textStyle: TextStyle = .BoldTitleSmall
|
||||
public var textStyle: TextStyle = .boldTitleSmall
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
//--------------------------------------------------
|
||||
public init(text: String,
|
||||
textStyle: TextStyle = .BoldTitleSmall) {
|
||||
textStyle: TextStyle = .boldTitleSmall) {
|
||||
self.text = text
|
||||
self.textStyle = textStyle
|
||||
}
|
||||
|
||||
@ -52,58 +52,58 @@ open class TitleLockup: View {
|
||||
// Sizes are from InVision design specs.
|
||||
open var topTextStyleSpacingConfig: TextStyle.SpacingConfig = {
|
||||
let configs = [
|
||||
TextStyle.DeviceSpacingConfig([.BoldTitleLarge, .TitleLarge],
|
||||
neighboring: [.BodySmall, .BodyMedium, .BodyLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldTitleLarge, .titleLarge],
|
||||
neighboring: [.bodySmall, .bodyMedium, .bodyLarge],
|
||||
spacing: 12.0,
|
||||
deviceType: .iPad),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldTitleXLarge, .TitleXLarge],
|
||||
neighboring: [.TitleMedium, .BodyLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldTitleXLarge, .titleXLarge],
|
||||
neighboring: [.titleMedium, .bodyLarge],
|
||||
spacing: 12.0,
|
||||
deviceType: .iPad),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldTitle2XLarge, .Title2XLarge, .BoldFeatureXSmall, .FeatureXSmall],
|
||||
neighboring: [.TitleMedium, .TitleLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldTitle2XLarge, .title2XLarge, .boldFeatureXSmall, .featureXSmall],
|
||||
neighboring: [.titleMedium, .titleLarge],
|
||||
spacing: 16.0,
|
||||
deviceType: .iPad),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldTitle2XLarge, .Title2XLarge, .BoldFeatureXSmall, .FeatureXSmall],
|
||||
neighboring: [.BodyLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldTitle2XLarge, .title2XLarge, .boldFeatureXSmall, .featureXSmall],
|
||||
neighboring: [.bodyLarge],
|
||||
spacing: 12.0,
|
||||
deviceType: .iPad),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldFeatureSmall, .FeatureSmall, .BoldFeatureMedium, .FeatureMedium],
|
||||
neighboring: [.TitleMedium, .TitleLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldFeatureSmall, .featureSmall, .boldFeatureMedium, .featureMedium],
|
||||
neighboring: [.titleMedium, .titleLarge],
|
||||
spacing: 16.0,
|
||||
deviceType: .iPad),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldFeatureSmall, .FeatureSmall, .BoldFeatureMedium, .FeatureMedium],
|
||||
neighboring: [.BodyLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldFeatureSmall, .featureSmall, .boldFeatureMedium, .featureMedium],
|
||||
neighboring: [.bodyLarge],
|
||||
spacing: 12.0,
|
||||
deviceType: .iPad),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldTitleXLarge, .TitleXLarge],
|
||||
neighboring: [.BodyLarge, .BodyMedium, .BodySmall, .TitleMedium],
|
||||
TextStyle.DeviceSpacingConfig([.boldTitleXLarge, .titleXLarge],
|
||||
neighboring: [.bodyLarge, .bodyMedium, .bodySmall, .titleMedium],
|
||||
spacing: 12.0,
|
||||
deviceType: .iPhone),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldTitle2XLarge, .Title2XLarge, .BoldFeatureXSmall, .FeatureXSmall],
|
||||
neighboring: [.BodyLarge, .BodyMedium, .TitleMedium],
|
||||
TextStyle.DeviceSpacingConfig([.boldTitle2XLarge, .title2XLarge, .boldFeatureXSmall, .featureXSmall],
|
||||
neighboring: [.bodyLarge, .bodyMedium, .titleMedium],
|
||||
spacing: 12.0,
|
||||
deviceType: .iPhone),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldFeatureSmall, .FeatureSmall],
|
||||
neighboring: [.TitleLarge, .BodyLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldFeatureSmall, .featureSmall],
|
||||
neighboring: [.titleLarge, .bodyLarge],
|
||||
spacing: 12.0,
|
||||
deviceType: .iPhone),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldFeatureMedium, .FeatureMedium],
|
||||
neighboring: [.TitleLarge, .TitleXLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldFeatureMedium, .featureMedium],
|
||||
neighboring: [.titleLarge, .titleXLarge],
|
||||
spacing: 16.0,
|
||||
deviceType: .iPhone),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldFeatureMedium, .FeatureMedium],
|
||||
neighboring: [.BodyLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldFeatureMedium, .featureMedium],
|
||||
neighboring: [.bodyLarge],
|
||||
spacing: 12.0,
|
||||
deviceType: .iPhone)
|
||||
]
|
||||
@ -112,58 +112,58 @@ open class TitleLockup: View {
|
||||
|
||||
open var bottomTextStyleSpacingConfig: TextStyle.SpacingConfig = {
|
||||
let configs = [
|
||||
TextStyle.DeviceSpacingConfig([.BoldTitleLarge, .TitleLarge],
|
||||
neighboring: [.BodySmall, .BodyMedium, .BodyLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldTitleLarge, .titleLarge],
|
||||
neighboring: [.bodySmall, .bodyMedium, .bodyLarge],
|
||||
spacing: 12.0,
|
||||
deviceType: .iPad),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldTitleXLarge, .TitleXLarge],
|
||||
neighboring: [.TitleMedium, .BodyLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldTitleXLarge, .titleXLarge],
|
||||
neighboring: [.titleMedium, .bodyLarge],
|
||||
spacing: 16.0,
|
||||
deviceType: .iPad),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldTitle2XLarge, .Title2XLarge, .BoldFeatureXSmall, .FeatureXSmall],
|
||||
neighboring: [.TitleMedium, .TitleLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldTitle2XLarge, .title2XLarge, .boldFeatureXSmall, .featureXSmall],
|
||||
neighboring: [.titleMedium, .titleLarge],
|
||||
spacing: 24.0,
|
||||
deviceType: .iPad),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldTitle2XLarge, .Title2XLarge, .BoldFeatureXSmall, .FeatureXSmall],
|
||||
neighboring: [.BodyLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldTitle2XLarge, .title2XLarge, .boldFeatureXSmall, .featureXSmall],
|
||||
neighboring: [.bodyLarge],
|
||||
spacing: 24.0,
|
||||
deviceType: .iPad),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldFeatureSmall, .FeatureSmall, .BoldFeatureMedium, .FeatureMedium],
|
||||
neighboring: [.TitleMedium, .TitleLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldFeatureSmall, .featureSmall, .boldFeatureMedium, .featureMedium],
|
||||
neighboring: [.titleMedium, .titleLarge],
|
||||
spacing: 24.0,
|
||||
deviceType: .iPad),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldFeatureSmall, .FeatureSmall, .BoldFeatureMedium, .FeatureMedium],
|
||||
neighboring: [.BodyLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldFeatureSmall, .featureSmall, .boldFeatureMedium, .featureMedium],
|
||||
neighboring: [.bodyLarge],
|
||||
spacing: 24.0,
|
||||
deviceType: .iPad),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldTitleXLarge, .TitleXLarge],
|
||||
neighboring: [.BodyLarge, .BodyMedium, .BodySmall, .TitleMedium],
|
||||
TextStyle.DeviceSpacingConfig([.boldTitleXLarge, .titleXLarge],
|
||||
neighboring: [.bodyLarge, .bodyMedium, .bodySmall, .titleMedium],
|
||||
spacing: 12.0,
|
||||
deviceType: .iPhone),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldTitle2XLarge, .Title2XLarge, .BoldFeatureXSmall, .FeatureXSmall],
|
||||
neighboring: [.BodyLarge, .BodyMedium, .TitleMedium],
|
||||
TextStyle.DeviceSpacingConfig([.boldTitle2XLarge, .title2XLarge, .boldFeatureXSmall, .featureXSmall],
|
||||
neighboring: [.bodyLarge, .bodyMedium, .titleMedium],
|
||||
spacing: 16,
|
||||
deviceType: .iPhone),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldFeatureSmall, .FeatureSmall],
|
||||
neighboring: [.TitleLarge, .BodyLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldFeatureSmall, .featureSmall],
|
||||
neighboring: [.titleLarge, .bodyLarge],
|
||||
spacing: 16.0,
|
||||
deviceType: .iPhone),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldFeatureMedium, .FeatureMedium],
|
||||
neighboring: [.TitleLarge, .TitleXLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldFeatureMedium, .featureMedium],
|
||||
neighboring: [.titleLarge, .titleXLarge],
|
||||
spacing: 24.0,
|
||||
deviceType: .iPhone),
|
||||
|
||||
TextStyle.DeviceSpacingConfig([.BoldFeatureMedium, .FeatureMedium],
|
||||
neighboring: [.BodyLarge],
|
||||
TextStyle.DeviceSpacingConfig([.boldFeatureMedium, .featureMedium],
|
||||
neighboring: [.bodyLarge],
|
||||
spacing: 24.0,
|
||||
deviceType: .iPhone)
|
||||
]
|
||||
@ -176,7 +176,7 @@ open class TitleLockup: View {
|
||||
open var textPosition: TextPosition = .left { didSet { didChange() }}
|
||||
|
||||
//style
|
||||
open var otherTextStyle: OtherTextStyle = UIDevice.isIPad ? .BodyLarge : .BodyMedium { didSet { didChange() }}
|
||||
open var otherTextStyle: OtherTextStyle = UIDevice.isIPad ? .bodyLarge : .bodyMedium { didSet { didChange() }}
|
||||
|
||||
//first row
|
||||
open var eyebrowLabel = Label().with {
|
||||
@ -227,7 +227,7 @@ open class TitleLockup: View {
|
||||
eyebrowModel = nil
|
||||
titleModel = nil
|
||||
subTitleModel = nil
|
||||
otherTextStyle = .BodyLarge
|
||||
otherTextStyle = .bodyLarge
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -13,36 +13,36 @@ extension TitleLockup {
|
||||
//--------------------------------------------------
|
||||
public enum TitleTextStyle: String, Codable, EnumSubset {
|
||||
|
||||
case FeatureMedium
|
||||
case BoldFeatureMedium
|
||||
case FeatureSmall
|
||||
case BoldFeatureSmall
|
||||
case FeatureXSmall
|
||||
case BoldFeatureXSmall
|
||||
case featureMedium
|
||||
case boldFeatureMedium
|
||||
case featureSmall
|
||||
case boldFeatureSmall
|
||||
case featureXSmall
|
||||
case boldFeatureXSmall
|
||||
|
||||
case Title2XLarge
|
||||
case BoldTitle2XLarge
|
||||
case TitleXLarge
|
||||
case BoldTitleXLarge
|
||||
case TitleLarge
|
||||
case BoldTitleLarge
|
||||
case TitleMedium
|
||||
case BoldTitleMedium
|
||||
case TitleSmall
|
||||
case BoldTitleSmall
|
||||
case title2XLarge
|
||||
case boldTitle2XLarge
|
||||
case titleXLarge
|
||||
case boldTitleXLarge
|
||||
case titleLarge
|
||||
case boldTitleLarge
|
||||
case titleMedium
|
||||
case boldTitleMedium
|
||||
case titleSmall
|
||||
case boldTitleSmall
|
||||
|
||||
public var defaultValue: TextStyle {.BoldFeatureXSmall }
|
||||
public var defaultValue: TextStyle {.boldFeatureXSmall }
|
||||
}
|
||||
|
||||
public enum OtherTextStyle: String, Codable, EnumSubset {
|
||||
case BodyLarge
|
||||
case BoldBodyLarge
|
||||
case BodyMedium
|
||||
case BoldBodyMedium
|
||||
case BodySmall
|
||||
case BoldBodySmall
|
||||
case bodyLarge
|
||||
case boldBodyLarge
|
||||
case bodyMedium
|
||||
case boldBodyMedium
|
||||
case bodySmall
|
||||
case boldBodySmall
|
||||
|
||||
public var defaultValue: TextStyle {.BodyLarge }
|
||||
public var defaultValue: TextStyle {.bodyLarge }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ extension TitleLockup {
|
||||
|
||||
public init(text: String,
|
||||
textAttributes: [any LabelAttributeModel]? = nil,
|
||||
textStyle: TitleTextStyle = .BoldFeatureXSmall,
|
||||
textStyle: TitleTextStyle = .boldFeatureXSmall,
|
||||
numberOfLines: Int = 0) {
|
||||
self.text = text
|
||||
self.textAttributes = textAttributes
|
||||
|
||||
@ -105,15 +105,15 @@ open class ToggleBase: Control, Accessable, DataTrackable {
|
||||
private var textStyle: TextStyle {
|
||||
if textSize == .small {
|
||||
if textWeight == .bold {
|
||||
return .BoldBodySmall
|
||||
return .boldBodySmall
|
||||
} else {
|
||||
return .BodySmall
|
||||
return .bodySmall
|
||||
}
|
||||
} else {
|
||||
if textWeight == .bold {
|
||||
return .BoldBodyLarge
|
||||
return .boldBodyLarge
|
||||
} else {
|
||||
return .BodyLarge
|
||||
return .bodyLarge
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,40 +25,40 @@ public enum TextPosition: String, Codable, CaseIterable {
|
||||
|
||||
public enum TextStyle: String, Codable, CaseIterable {
|
||||
|
||||
case FeatureXLarge
|
||||
case BoldFeatureXLarge
|
||||
case FeatureLarge
|
||||
case BoldFeatureLarge
|
||||
case FeatureMedium
|
||||
case BoldFeatureMedium
|
||||
case FeatureSmall
|
||||
case BoldFeatureSmall
|
||||
case FeatureXSmall
|
||||
case BoldFeatureXSmall
|
||||
case featureXLarge
|
||||
case boldFeatureXLarge
|
||||
case featureLarge
|
||||
case boldFeatureLarge
|
||||
case featureMedium
|
||||
case boldFeatureMedium
|
||||
case featureSmall
|
||||
case boldFeatureSmall
|
||||
case featureXSmall
|
||||
case boldFeatureXSmall
|
||||
|
||||
case Title2XLarge
|
||||
case BoldTitle2XLarge
|
||||
case TitleXLarge
|
||||
case BoldTitleXLarge
|
||||
case TitleLarge
|
||||
case BoldTitleLarge
|
||||
case TitleMedium
|
||||
case BoldTitleMedium
|
||||
case TitleSmall
|
||||
case BoldTitleSmall
|
||||
case title2XLarge
|
||||
case boldTitle2XLarge
|
||||
case titleXLarge
|
||||
case boldTitleXLarge
|
||||
case titleLarge
|
||||
case boldTitleLarge
|
||||
case titleMedium
|
||||
case boldTitleMedium
|
||||
case titleSmall
|
||||
case boldTitleSmall
|
||||
|
||||
case BodyLarge
|
||||
case BoldBodyLarge
|
||||
case BodyMedium
|
||||
case BoldBodyMedium
|
||||
case BodySmall
|
||||
case BoldBodySmall
|
||||
case bodyLarge
|
||||
case boldBodyLarge
|
||||
case bodyMedium
|
||||
case boldBodyMedium
|
||||
case bodySmall
|
||||
case boldBodySmall
|
||||
|
||||
case Micro
|
||||
case BoldMicro
|
||||
case micro
|
||||
case boldMicro
|
||||
|
||||
public static var defaultStyle: TextStyle {
|
||||
return .BodyLarge
|
||||
return .bodyLarge
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ extension TextStyle {
|
||||
case feature = "Feature"
|
||||
case title = "Title"
|
||||
case body = "Body"
|
||||
case micro = "Micro"
|
||||
case micro = "micro"
|
||||
|
||||
public var sizes: [FontSize] {
|
||||
switch self {
|
||||
@ -109,33 +109,33 @@ extension TextStyle {
|
||||
extension TextStyle {
|
||||
public var pointSize: CGFloat {
|
||||
switch self {
|
||||
case .FeatureXLarge, .BoldFeatureXLarge:
|
||||
case .featureXLarge, .boldFeatureXLarge:
|
||||
return UIDevice.isIPad ? VDSTypography.fontSizeFeature144 : VDSTypography.fontSizeFeature96
|
||||
case .FeatureLarge, .BoldFeatureLarge:
|
||||
case .featureLarge, .boldFeatureLarge:
|
||||
return UIDevice.isIPad ? VDSTypography.fontSizeFeature128 : VDSTypography.fontSizeFeature80
|
||||
case .FeatureMedium, .BoldFeatureMedium:
|
||||
case .featureMedium, .boldFeatureMedium:
|
||||
return UIDevice.isIPad ? VDSTypography.fontSizeFeature96 : VDSTypography.fontSizeFeature64
|
||||
case .FeatureSmall, .BoldFeatureSmall:
|
||||
case .featureSmall, .boldFeatureSmall:
|
||||
return UIDevice.isIPad ? VDSTypography.fontSizeFeature80 : VDSTypography.fontSizeFeature48
|
||||
case .FeatureXSmall, .BoldFeatureXSmall:
|
||||
case .featureXSmall, .boldFeatureXSmall:
|
||||
return UIDevice.isIPad ? VDSTypography.fontSizeFeature64 : VDSTypography.fontSizeFeature40
|
||||
case .Title2XLarge, .BoldTitle2XLarge:
|
||||
case .title2XLarge, .boldTitle2XLarge:
|
||||
return UIDevice.isIPad ? VDSTypography.fontSizeTitle64 : VDSTypography.fontSizeTitle40
|
||||
case .TitleXLarge, .BoldTitleXLarge:
|
||||
case .titleXLarge, .boldTitleXLarge:
|
||||
return UIDevice.isIPad ? VDSTypography.fontSizeTitle48 : VDSTypography.fontSizeTitle32
|
||||
case .TitleLarge, .BoldTitleLarge:
|
||||
case .titleLarge, .boldTitleLarge:
|
||||
return UIDevice.isIPad ? VDSTypography.fontSizeTitle32 : VDSTypography.fontSizeTitle24
|
||||
case .TitleMedium, .BoldTitleMedium:
|
||||
case .titleMedium, .boldTitleMedium:
|
||||
return UIDevice.isIPad ? VDSTypography.fontSizeTitle24 : VDSTypography.fontSizeTitle20
|
||||
case .TitleSmall, .BoldTitleSmall:
|
||||
case .titleSmall, .boldTitleSmall:
|
||||
return UIDevice.isIPad ? VDSTypography.fontSizeTitle20 : VDSTypography.fontSizeTitle16
|
||||
case .BodyLarge, .BoldBodyLarge:
|
||||
case .bodyLarge, .boldBodyLarge:
|
||||
return VDSTypography.fontSizeBody16
|
||||
case .BodyMedium, .BoldBodyMedium:
|
||||
case .bodyMedium, .boldBodyMedium:
|
||||
return VDSTypography.fontSizeBody14
|
||||
case .BodySmall, .BoldBodySmall:
|
||||
case .bodySmall, .boldBodySmall:
|
||||
return VDSTypography.fontSizeBody12
|
||||
case .Micro, .BoldMicro:
|
||||
case .micro, .boldMicro:
|
||||
return VDSTypography.fontSizeMicro11
|
||||
}
|
||||
}
|
||||
@ -145,33 +145,33 @@ extension TextStyle {
|
||||
extension TextStyle {
|
||||
public var lineHeight: CGFloat {
|
||||
switch self {
|
||||
case .FeatureXLarge, .BoldFeatureXLarge:
|
||||
case .featureXLarge, .boldFeatureXLarge:
|
||||
return UIDevice.isIPad ? VDSTypography.lineHeightFeature136 : VDSTypography.lineHeightFeature88
|
||||
case .FeatureLarge, .BoldFeatureLarge:
|
||||
case .featureLarge, .boldFeatureLarge:
|
||||
return UIDevice.isIPad ? VDSTypography.lineHeightFeature120 : VDSTypography.lineHeightFeature76
|
||||
case .FeatureMedium, .BoldFeatureMedium:
|
||||
case .featureMedium, .boldFeatureMedium:
|
||||
return UIDevice.isIPad ? VDSTypography.lineHeightFeature88 : VDSTypography.lineHeightFeature64
|
||||
case .FeatureSmall, .BoldFeatureSmall:
|
||||
case .featureSmall, .boldFeatureSmall:
|
||||
return UIDevice.isIPad ? VDSTypography.lineHeightFeature76 : VDSTypography.lineHeightFeature48
|
||||
case .FeatureXSmall, .BoldFeatureXSmall:
|
||||
case .featureXSmall, .boldFeatureXSmall:
|
||||
return UIDevice.isIPad ? VDSTypography.lineHeightFeature64 : VDSTypography.lineHeightFeature40
|
||||
case .Title2XLarge, .BoldTitle2XLarge:
|
||||
case .title2XLarge, .boldTitle2XLarge:
|
||||
return UIDevice.isIPad ? VDSTypography.lineHeightTitle64 : VDSTypography.lineHeightTitle40
|
||||
case .TitleXLarge, .BoldTitleXLarge:
|
||||
case .titleXLarge, .boldTitleXLarge:
|
||||
return UIDevice.isIPad ? VDSTypography.lineHeightTitle48 : VDSTypography.lineHeightTitle36
|
||||
case .TitleLarge, .BoldTitleLarge:
|
||||
case .titleLarge, .boldTitleLarge:
|
||||
return UIDevice.isIPad ? VDSTypography.lineHeightTitle36 : VDSTypography.lineHeightTitle28
|
||||
case .TitleMedium, .BoldTitleMedium:
|
||||
case .titleMedium, .boldTitleMedium:
|
||||
return UIDevice.isIPad ? VDSTypography.lineHeightTitle28 : VDSTypography.lineHeightTitle24
|
||||
case .TitleSmall, .BoldTitleSmall:
|
||||
case .titleSmall, .boldTitleSmall:
|
||||
return UIDevice.isIPad ? VDSTypography.lineHeightTitle24 : VDSTypography.lineHeightTitle20
|
||||
case .BodyLarge, .BoldBodyLarge:
|
||||
case .bodyLarge, .boldBodyLarge:
|
||||
return VDSTypography.lineHeightBody20
|
||||
case .BodyMedium, .BoldBodyMedium:
|
||||
case .bodyMedium, .boldBodyMedium:
|
||||
return VDSTypography.lineHeightBody18
|
||||
case .BodySmall, .BoldBodySmall:
|
||||
case .bodySmall, .boldBodySmall:
|
||||
return VDSTypography.lineHeightBody16
|
||||
case .Micro, .BoldMicro:
|
||||
case .micro, .boldMicro:
|
||||
return VDSTypography.lineHeightMicro16
|
||||
}
|
||||
}
|
||||
@ -181,18 +181,18 @@ extension TextStyle {
|
||||
extension TextStyle {
|
||||
public var letterSpacing: CGFloat {
|
||||
switch self {
|
||||
case .FeatureXLarge,
|
||||
.FeatureLarge,
|
||||
.FeatureMedium,
|
||||
.FeatureSmall,
|
||||
.FeatureXSmall,
|
||||
.Title2XLarge,
|
||||
.TitleXLarge,
|
||||
.TitleLarge:
|
||||
case .featureXLarge,
|
||||
.featureLarge,
|
||||
.featureMedium,
|
||||
.featureSmall,
|
||||
.featureXSmall,
|
||||
.title2XLarge,
|
||||
.titleXLarge,
|
||||
.titleLarge:
|
||||
return 0.25
|
||||
|
||||
case .BoldBodyLarge, .BodyLarge,
|
||||
.BoldBodyMedium, .BodyMedium:
|
||||
case .boldBodyLarge, .bodyLarge,
|
||||
.boldBodyMedium, .bodyMedium:
|
||||
return 0.5
|
||||
|
||||
default:
|
||||
@ -212,42 +212,42 @@ extension TextStyle {
|
||||
extension TextStyle {
|
||||
public var fontFace: Fonts {
|
||||
switch self {
|
||||
case .BoldFeatureXLarge,
|
||||
.BoldFeatureLarge,
|
||||
.BoldFeatureMedium,
|
||||
.BoldFeatureSmall,
|
||||
.BoldFeatureXSmall,
|
||||
.BoldTitle2XLarge,
|
||||
.BoldTitleXLarge,
|
||||
.BoldTitleLarge,
|
||||
.BoldTitleMedium,
|
||||
.BoldTitleSmall,
|
||||
.BoldBodyLarge,
|
||||
.BoldBodyMedium:
|
||||
case .boldFeatureXLarge,
|
||||
.boldFeatureLarge,
|
||||
.boldFeatureMedium,
|
||||
.boldFeatureSmall,
|
||||
.boldFeatureXSmall,
|
||||
.boldTitle2XLarge,
|
||||
.boldTitleXLarge,
|
||||
.boldTitleLarge,
|
||||
.boldTitleMedium,
|
||||
.boldTitleSmall,
|
||||
.boldBodyLarge,
|
||||
.boldBodyMedium:
|
||||
return .dsBold
|
||||
|
||||
case .FeatureXLarge,
|
||||
.FeatureLarge,
|
||||
.FeatureMedium,
|
||||
.FeatureSmall,
|
||||
.FeatureXSmall,
|
||||
.Title2XLarge,
|
||||
.TitleXLarge:
|
||||
case .featureXLarge,
|
||||
.featureLarge,
|
||||
.featureMedium,
|
||||
.featureSmall,
|
||||
.featureXSmall,
|
||||
.title2XLarge,
|
||||
.titleXLarge:
|
||||
return .dsLight
|
||||
|
||||
case .TitleLarge,
|
||||
.TitleMedium,
|
||||
.TitleSmall,
|
||||
.BodyLarge,
|
||||
.BodyMedium:
|
||||
case .titleLarge,
|
||||
.titleMedium,
|
||||
.titleSmall,
|
||||
.bodyLarge,
|
||||
.bodyMedium:
|
||||
return .dsRegular
|
||||
|
||||
case .BoldBodySmall,
|
||||
.BoldMicro:
|
||||
case .boldBodySmall,
|
||||
.boldMicro:
|
||||
return .txBold
|
||||
|
||||
case .BodySmall,
|
||||
.Micro:
|
||||
case .bodySmall,
|
||||
.micro:
|
||||
return .txRegular
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user