diff --git a/VDS/Components/Badge/Badge.swift b/VDS/Components/Badge/Badge.swift index b3ffb2bd..40c1139b 100644 --- a/VDS/Components/Badge/Badge.swift +++ b/VDS/Components/Badge/Badge.swift @@ -67,7 +67,7 @@ public class Badge: View, Accessable { isAccessibilityElement = true accessibilityTraits = .staticText - layer.cornerRadius = 2 + layer.cornerRadius = VDSFormControls.borderradius addSubview(label) label.pinToSuperView(.init(top: 2, left: 4, bottom: 2, right: 4)) diff --git a/VDS/Components/Buttons/Button/Button.swift b/VDS/Components/Buttons/Button/Button.swift index ee2c0ab5..43682d96 100644 --- a/VDS/Components/Buttons/Button/Button.swift +++ b/VDS/Components/Buttons/Button/Button.swift @@ -146,7 +146,7 @@ open class Button: ButtonBase, Useable { super.updateView() let bgColor = backgroundColorConfiguration.getColor(self) let borderColor = borderColorConfiguration.getColor(self) - let borderWidth = use == .secondary ? 1.0 : 0.0 + let borderWidth = use == .secondary ? VDSFormControls.widthBorder : 0.0 let buttonHeight = size.height let cornerRadius = size.cornerRadius let minWidth = size.minimumWidth diff --git a/VDS/Components/Checkbox/Checkbox.swift b/VDS/Components/Checkbox/Checkbox.swift index 91c08aab..d16c12f4 100644 --- a/VDS/Components/Checkbox/Checkbox.swift +++ b/VDS/Components/Checkbox/Checkbox.swift @@ -371,8 +371,8 @@ open class CheckboxBase: Control, Accessable, DataTrackable, Errorable { selectorView.backgroundColor = backgroundColor selectorView.layer.borderColor = borderColor.cgColor - selectorView.layer.cornerRadius = 2.0 - selectorView.layer.borderWidth = 1.0 + selectorView.layer.cornerRadius = VDSFormControls.borderradius + selectorView.layer.borderWidth = VDSFormControls.widthBorder if shapeLayer == nil { let bounds = selectorView.bounds diff --git a/VDS/Components/RadioBox/RadioBox.swift b/VDS/Components/RadioBox/RadioBox.swift index 7951c4cd..d9398259 100644 --- a/VDS/Components/RadioBox/RadioBox.swift +++ b/VDS/Components/RadioBox/RadioBox.swift @@ -281,10 +281,10 @@ open class RadioBoxBase: Control, Accessable, DataTrackable{ //-------------------------------------------------- // MARK: - Configuration Properties //-------------------------------------------------- - private var strikeThroughLineThickness: CGFloat = 1.0 - private var selectorCornerRadius: CGFloat = 4.0 - private var selectorBorderWidthSelected: CGFloat = 2.0 - private var selectorBorderWidth: CGFloat = 1.0 + private var strikeThroughLineThickness: CGFloat = VDSFormControls.widthBorder + private var selectorCornerRadius: CGFloat = VDSFormControls.borderradius + private var selectorBorderWidthSelected: CGFloat = VDSFormControls.widthBorder + VDSFormControls.widthBorder + private var selectorBorderWidth: CGFloat = VDSFormControls.widthBorder private var backgroundColorConfiguration = ControlColorConfiguration().with { $0.setSurfaceColors(VDSFormControlsColor.backgroundOnlight, VDSFormControlsColor.backgroundOndark, forState: .normal) @@ -311,7 +311,7 @@ open class RadioBoxBase: Control, Accessable, DataTrackable{ //get the colors let backgroundColor = backgroundColorConfiguration.getColor(self) let borderColor = borderColorConfiguration.getColor(self) - let borderWidth = isSelected || isHighlighted ? selectorBorderWidthSelected : selectorBorderWidth + let borderWidth = isSelected ? selectorBorderWidthSelected : selectorBorderWidth selectorView.backgroundColor = backgroundColor selectorView.layer.borderColor = borderColor.cgColor diff --git a/VDS/Components/RadioButton/RadioButton.swift b/VDS/Components/RadioButton/RadioButton.swift index 674a0a6f..3972fcf7 100644 --- a/VDS/Components/RadioButton/RadioButton.swift +++ b/VDS/Components/RadioButton/RadioButton.swift @@ -373,7 +373,7 @@ open class RadioButtonBase: Control, Accessable, DataTrackable, Errorable { selectorView.backgroundColor = backgroundColor selectorView.layer.borderColor = borderColor.cgColor selectorView.layer.cornerRadius = selectorView.bounds.width * 0.5 - selectorView.layer.borderWidth = 1.0 + selectorView.layer.borderWidth = VDSFormControls.widthBorder if shapeLayer == nil { let selectedBounds = radioButtonSelectedSize diff --git a/VDS/Components/RadioSwatch/RadioSwatch.swift b/VDS/Components/RadioSwatch/RadioSwatch.swift index 5c36c575..e17eef28 100644 --- a/VDS/Components/RadioSwatch/RadioSwatch.swift +++ b/VDS/Components/RadioSwatch/RadioSwatch.swift @@ -162,8 +162,8 @@ open class RadioSwatchBase: Control, Accessable, DataTrackable { //-------------------------------------------------- // MARK: - Configuration Properties //-------------------------------------------------- - private var strikeThroughLineThickness: CGFloat = 1.0 - private var selectorBorderWidth: CGFloat = 1.0 + private var strikeThroughLineThickness: CGFloat = VDSFormControls.widthBorder + private var selectorBorderWidth: CGFloat = VDSFormControls.widthBorder public let swatchSize = CGSize(width: 48, height: 48) public let fillSize = CGSize(width: 36, height: 36) public let disabledAlpha = 0.5 diff --git a/VDS/Components/TextFields/EntryField/EntryField.swift b/VDS/Components/TextFields/EntryField/EntryField.swift index 851fb0e5..ab9c0a98 100644 --- a/VDS/Components/TextFields/EntryField/EntryField.swift +++ b/VDS/Components/TextFields/EntryField/EntryField.swift @@ -285,8 +285,8 @@ open class EntryField: Control, Accessable { containerView.backgroundColor = backgroundColorConfiguration.getColor(self) containerView.layer.borderColor = borderColorConfiguration.getColor(self).cgColor - containerView.layer.borderWidth = 1 - containerView.layer.cornerRadius = 4 + containerView.layer.borderWidth = VDSFormControls.widthBorder + containerView.layer.cornerRadius = VDSFormControls.borderradius updateTitleLabel() updateErrorLabel() diff --git a/VDS/Components/TileContainer/TileContainer.swift b/VDS/Components/TileContainer/TileContainer.swift index 1f676421..f6086b47 100644 --- a/VDS/Components/TileContainer/TileContainer.swift +++ b/VDS/Components/TileContainer/TileContainer.swift @@ -7,6 +7,7 @@ import Foundation import VDSColorTokens +import VDSFormControlsTokens import UIKit @objc(VDSTileContainer) @@ -181,8 +182,8 @@ open class TileContainer: Control { //corner radius layer.cornerRadius = cornerRadius - backgroundImageView.layer.cornerRadius = 8 - highlightView.layer.cornerRadius = 8 + backgroundImageView.layer.cornerRadius = cornerRadius + highlightView.layer.cornerRadius = cornerRadius } @@ -194,7 +195,7 @@ open class TileContainer: Control { //-------------------------------------------------- // MARK: - Configuration //-------------------------------------------------- - private let cornerRadius = 8.0 + private let cornerRadius = VDSFormControls.borderradius * 2 private var backgroundColorConfig = BackgroundColorConfiguration() @@ -262,7 +263,7 @@ open class TileContainer: Control { } layer.borderColor = borderColorConfig.getColor(self).cgColor - layer.borderWidth = showBorder ? 1 : 0 + layer.borderWidth = showBorder ? VDSFormControls.widthBorder : 0 containerTopConstraint?.constant = padding containerLeadingConstraint?.constant = padding diff --git a/VDS/Extensions/UIView.swift b/VDS/Extensions/UIView.swift index 6db07dd2..951cbbf5 100644 --- a/VDS/Extensions/UIView.swift +++ b/VDS/Extensions/UIView.swift @@ -7,6 +7,7 @@ import Foundation import UIKit +import VDSFormControlsTokens extension UIView { public func pin(_ view: UIView, with edges: UIEdgeInsets = UIEdgeInsets.zero) { @@ -122,7 +123,7 @@ extension UIView { public func debugBorder(show shouldShow: Bool = true, color: UIColor = .red) { if shouldShow { layer.borderColor = color.cgColor - layer.borderWidth = 1 + layer.borderWidth = VDSFormControls.widthBorder } else { layer.borderColor = UIColor.clear.cgColor layer.borderWidth = 0