update naming conventions
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
439c66fb97
commit
55885c80ba
@ -98,24 +98,24 @@ open class Badge: View {
|
||||
return config.eraseToAnyColorable()
|
||||
}()
|
||||
|
||||
private var textColorConfig = ViewColorConfiguration()
|
||||
private var textColorConfiguration = ViewColorConfiguration()
|
||||
|
||||
public func updateTextColorConfig() {
|
||||
textColorConfig.reset()
|
||||
textColorConfiguration.reset()
|
||||
|
||||
switch fillColor {
|
||||
|
||||
case .red, .black:
|
||||
textColorConfig.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOndark, forDisabled: false)
|
||||
textColorConfig.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOndark, forDisabled: true)
|
||||
textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOndark, forDisabled: false)
|
||||
textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOndark, forDisabled: true)
|
||||
|
||||
case .yellow, .white:
|
||||
textColorConfig.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOnlight, forDisabled: false)
|
||||
textColorConfig.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOnlight, forDisabled: true)
|
||||
textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOnlight, forDisabled: false)
|
||||
textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOnlight, forDisabled: true)
|
||||
|
||||
case .orange, .green, .blue:
|
||||
textColorConfig.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight, forDisabled: false)
|
||||
textColorConfig.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight, forDisabled: true)
|
||||
textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight, forDisabled: false)
|
||||
textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight, forDisabled: true)
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ open class Badge: View {
|
||||
|
||||
backgroundColor = backgroundColorConfiguration.getColor(self)
|
||||
|
||||
label.textColorConfiguration = textColorConfig.eraseToAnyColorable()
|
||||
label.textColorConfiguration = textColorConfiguration.eraseToAnyColorable()
|
||||
label.numberOfLines = numberOfLines
|
||||
label.text = text
|
||||
label.surface = surface
|
||||
|
||||
@ -75,14 +75,15 @@ open class TextLink: ButtonBase {
|
||||
super.setup()
|
||||
isAccessibilityElement = true
|
||||
accessibilityTraits = .link
|
||||
|
||||
//titleEdgeInsets = .init(top: 0, left: 0, bottom: 2, right: 0)
|
||||
if let titleLabel {
|
||||
addSubview(line)
|
||||
line.pinLeading(titleLabel.leadingAnchor)
|
||||
line.pinTrailing(titleLabel.trailingAnchor)
|
||||
line.pinTop(titleLabel.bottomAnchor, 1)
|
||||
line.pinTop(titleLabel.bottomAnchor)
|
||||
lineHeightConstraint = line.heightAnchor.constraint(equalToConstant: 1.0)
|
||||
lineHeightConstraint?.isActive = true
|
||||
titleLabel.debugBorder(show: true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -181,7 +181,7 @@ open class Notification: View {
|
||||
return config.eraseToAnyColorable()
|
||||
}()
|
||||
|
||||
private var textColorConfig = ViewColorConfiguration().with {
|
||||
private var textColorConfiguration = ViewColorConfiguration().with {
|
||||
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false)
|
||||
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: true)
|
||||
}
|
||||
@ -224,8 +224,8 @@ open class Notification: View {
|
||||
mainStackView.addArrangedSubview(closeButton)
|
||||
|
||||
//labels
|
||||
titleLabel.textColorConfiguration = textColorConfig.eraseToAnyColorable()
|
||||
subTitleLabel.textColorConfiguration = textColorConfig.eraseToAnyColorable()
|
||||
titleLabel.textColorConfiguration = textColorConfiguration.eraseToAnyColorable()
|
||||
subTitleLabel.textColorConfiguration = textColorConfiguration.eraseToAnyColorable()
|
||||
}
|
||||
|
||||
open override func reset() {
|
||||
|
||||
@ -73,12 +73,12 @@ open class EntryField: Control, Changeable {
|
||||
// Sizes are from InVision design specs.
|
||||
internal var containerSize: CGSize { CGSize(width: 45, height: 44) }
|
||||
|
||||
internal let primaryColorConfig = ViewColorConfiguration().with {
|
||||
internal let primaryColorConfiguration = ViewColorConfiguration().with {
|
||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true)
|
||||
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false)
|
||||
}
|
||||
|
||||
internal let secondaryColorConfig = ViewColorConfiguration().with {
|
||||
internal let secondaryColorConfiguration = ViewColorConfiguration().with {
|
||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true)
|
||||
$0.setSurfaceColors(VDSColor.elementsSecondaryOnlight, VDSColor.elementsSecondaryOndark, forDisabled: false)
|
||||
}
|
||||
@ -218,9 +218,9 @@ open class EntryField: Control, Changeable {
|
||||
.pinLeading()
|
||||
.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor).isActive = true
|
||||
|
||||
titleLabel.textColorConfiguration = primaryColorConfig.eraseToAnyColorable()
|
||||
errorLabel.textColorConfiguration = primaryColorConfig.eraseToAnyColorable()
|
||||
helperLabel.textColorConfiguration = secondaryColorConfig.eraseToAnyColorable()
|
||||
titleLabel.textColorConfiguration = primaryColorConfiguration.eraseToAnyColorable()
|
||||
errorLabel.textColorConfiguration = primaryColorConfiguration.eraseToAnyColorable()
|
||||
helperLabel.textColorConfiguration = secondaryColorConfiguration.eraseToAnyColorable()
|
||||
}
|
||||
|
||||
open func getContainer() -> UIView {
|
||||
|
||||
@ -133,7 +133,7 @@ open class InputField: EntryField, UITextFieldDelegate {
|
||||
stackView.addArrangedSubview(successLabel)
|
||||
stackView.setCustomSpacing(8, after: successLabel)
|
||||
|
||||
successLabel.textColorConfiguration = primaryColorConfig.eraseToAnyColorable()
|
||||
successLabel.textColorConfiguration = primaryColorConfiguration.eraseToAnyColorable()
|
||||
|
||||
backgroundColorConfiguration.setSurfaceColors(VDSColor.feedbackSuccessBackgroundOnlight, VDSColor.feedbackSuccessBackgroundOndark, forState: .success)
|
||||
borderColorConfiguration.setSurfaceColors(VDSColor.feedbackSuccessOnlight, VDSColor.feedbackSuccessOndark, forState: .success)
|
||||
|
||||
@ -209,19 +209,19 @@ open class TileContainer: Control {
|
||||
//--------------------------------------------------
|
||||
private let cornerRadius = VDSFormControls.borderradius * 2
|
||||
|
||||
private var backgroundColorConfig = BackgroundColorConfiguration()
|
||||
private var backgroundColorConfiguration = BackgroundColorConfiguration()
|
||||
|
||||
private var borderColorConfig = SurfaceColorConfiguration().with {
|
||||
private var borderColorConfiguration = SurfaceColorConfiguration().with {
|
||||
$0.lightColor = VDSColor.elementsLowcontrastOnlight
|
||||
$0.darkColor = VDSColor.elementsLowcontrastOndark
|
||||
}
|
||||
|
||||
private var imageFallbackColorConfig = SurfaceColorConfiguration().with {
|
||||
private var imageFallbackColorConfiguration = SurfaceColorConfiguration().with {
|
||||
$0.lightColor = VDSColor.backgroundPrimaryLight
|
||||
$0.darkColor = VDSColor.backgroundPrimaryDark
|
||||
}
|
||||
|
||||
private var hightLightViewColorConfig = SurfaceColorConfiguration().with {
|
||||
private var hightLightViewColorConfiguration = SurfaceColorConfiguration().with {
|
||||
$0.lightColor = VDSColor.paletteWhite.withAlphaComponent(0.3)
|
||||
$0.darkColor = VDSColor.paletteBlack.withAlphaComponent(0.3)
|
||||
}
|
||||
@ -265,19 +265,19 @@ open class TileContainer: Control {
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
|
||||
highlightView.backgroundColor = hightLightViewColorConfig.getColor(self)
|
||||
highlightView.backgroundColor = hightLightViewColorConfiguration.getColor(self)
|
||||
highlightView.isHidden = !isHighlighted
|
||||
|
||||
if let backgroundImage {
|
||||
backgroundImageView.image = backgroundImage
|
||||
backgroundImageView.isHidden = false
|
||||
backgroundColor = imageFallbackColorConfig.getColor(self)
|
||||
backgroundColor = imageFallbackColorConfiguration.getColor(self)
|
||||
} else {
|
||||
backgroundImageView.isHidden = true
|
||||
backgroundColor = backgroundColorConfig.getColor(self)
|
||||
backgroundColor = backgroundColorConfiguration.getColor(self)
|
||||
}
|
||||
|
||||
layer.borderColor = borderColorConfig.getColor(self).cgColor
|
||||
layer.borderColor = borderColorConfiguration.getColor(self).cgColor
|
||||
layer.borderWidth = showBorder ? VDSFormControls.widthBorder : 0
|
||||
|
||||
containerTopConstraint?.constant = padding.value
|
||||
|
||||
@ -61,27 +61,27 @@ open class Tooltip: Control, TooltipLaunchable {
|
||||
switch fillColor {
|
||||
|
||||
case .primary:
|
||||
return primaryColorConfig.eraseToAnyColorable()
|
||||
return primaryColorConfiguration.eraseToAnyColorable()
|
||||
case .secondary:
|
||||
return secondaryColorConfig.eraseToAnyColorable()
|
||||
return secondaryColorConfiguration.eraseToAnyColorable()
|
||||
case .brandHighlight:
|
||||
return brandHighlightColorConfig.eraseToAnyColorable()
|
||||
return brandHighlightColorConfiguration.eraseToAnyColorable()
|
||||
}
|
||||
}
|
||||
|
||||
private var primaryColorConfig = ControlColorConfiguration().with {
|
||||
private var primaryColorConfiguration = ControlColorConfiguration().with {
|
||||
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .normal)
|
||||
$0.setSurfaceColors(VDSColor.interactiveActiveOnlight, VDSColor.interactiveActiveOndark, forState: .highlighted)
|
||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
|
||||
}
|
||||
|
||||
private var secondaryColorConfig = ControlColorConfiguration().with {
|
||||
private var secondaryColorConfiguration = ControlColorConfiguration().with {
|
||||
$0.setSurfaceColors(VDSColor.elementsSecondaryOnlight, VDSColor.elementsSecondaryOndark, forState: .normal)
|
||||
$0.setSurfaceColors(VDSColor.paletteGray65, VDSColor.paletteGray65, forState: .highlighted)
|
||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
|
||||
}
|
||||
|
||||
private var brandHighlightColorConfig = ControlColorConfiguration().with {
|
||||
private var brandHighlightColorConfiguration = ControlColorConfiguration().with {
|
||||
$0.setSurfaceColors(VDSColor.elementsBrandhighlight, VDSColor.elementsBrandhighlight, forState: .normal)
|
||||
$0.setSurfaceColors(VDSColor.elementsBrandhighlight, VDSColor.elementsBrandhighlight, forState: .highlighted)
|
||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user