From e646be1462b63a03a7f41df16d1f2986efc630a5 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 20 Sep 2023 08:24:03 -0500 Subject: [PATCH 1/5] ONEAPP-5109 - Typography/Label - Accessibility iOS Signed-off-by: Matt Bruce --- VDS/Components/Label/Label.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/VDS/Components/Label/Label.swift b/VDS/Components/Label/Label.swift index 76dceb19..3aa5f05d 100644 --- a/VDS/Components/Label/Label.swift +++ b/VDS/Components/Label/Label.swift @@ -227,6 +227,11 @@ open class Label: UILabel, ViewProtocol, UserInfoable { open func updateAccessibility() { accessibilityLabel = text + if isEnabled { + accessibilityTraits.remove(.notEnabled) + } else { + accessibilityTraits.insert(.notEnabled) + } } //-------------------------------------------------- From 2d46b77b222ebfeb97f408cc55fbb0963f7e6d1a Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 20 Sep 2023 08:53:43 -0500 Subject: [PATCH 2/5] added notes Signed-off-by: Matt Bruce --- VDS/SupportingFiles/ReleaseNotes.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/VDS/SupportingFiles/ReleaseNotes.txt b/VDS/SupportingFiles/ReleaseNotes.txt index d1a68aef..fa341e8d 100644 --- a/VDS/SupportingFiles/ReleaseNotes.txt +++ b/VDS/SupportingFiles/ReleaseNotes.txt @@ -1,3 +1,7 @@ +1.0.44 +======= +- ONEAPP-5109 - Typography/Label - Accessibility iOS + 1.0.43 ======= - CXTDT-464973 - Button - Width percentage parameter missing. From 0fc6d78d3c6dad19be38cb0fd7bb859c707a1ec8 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 20 Sep 2023 13:44:19 -0500 Subject: [PATCH 3/5] added static var Signed-off-by: Matt Bruce --- VDS/Components/Line/Line.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/VDS/Components/Line/Line.swift b/VDS/Components/Line/Line.swift index 17bf92c1..4100c63a 100644 --- a/VDS/Components/Line/Line.swift +++ b/VDS/Components/Line/Line.swift @@ -45,7 +45,7 @@ open class Line: View { // MARK: - Configuration //-------------------------------------------------- /// Width of the line. - public let lineWidth: CGFloat = 1.0 + public static let lineWidth: CGFloat = 1.0 //-------------------------------------------------- // MARK: - Public Properties @@ -59,9 +59,9 @@ open class Line: View { /// The natural size for the receiving view, considering only properties of the view itself. open override var intrinsicContentSize: CGSize { if orientation == .vertical { - return .init(width: 1, height: bounds.height) + return .init(width: Self.lineWidth, height: bounds.height) } else { - return .init(width: bounds.width, height: 1) + return .init(width: bounds.width, height: Self.lineWidth) } } @@ -103,7 +103,7 @@ open class Line: View { guard let context = UIGraphicsGetCurrentContext() else { return } context.setStrokeColor(lineViewColorConfiguration.getColor(self).cgColor) - context.setLineWidth(lineWidth) + context.setLineWidth(Self.lineWidth) if orientation == .horizontal { context.move(to: CGPoint(x: 0, y: rect.height / 2)) From a3d239779dd21085fb7e13a2a09e49d848671ef7 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 20 Sep 2023 14:02:18 -0500 Subject: [PATCH 4/5] updated property getter for lineColor Signed-off-by: Matt Bruce --- VDS/Components/Line/Line.swift | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/VDS/Components/Line/Line.swift b/VDS/Components/Line/Line.swift index 4100c63a..78ffd545 100644 --- a/VDS/Components/Line/Line.swift +++ b/VDS/Components/Line/Line.swift @@ -45,7 +45,7 @@ open class Line: View { // MARK: - Configuration //-------------------------------------------------- /// Width of the line. - public static let lineWidth: CGFloat = 1.0 + public let lineWidth: CGFloat = 1.0 //-------------------------------------------------- // MARK: - Public Properties @@ -56,12 +56,15 @@ open class Line: View { /// Allows to render the line vertically. open var orientation: Orientation = .horizontal { didSet { setNeedsUpdate() } } + /// Line Color for current Style and Surface. + open var lineColor: UIColor { lineViewColorConfiguration.getColor(self) } + /// The natural size for the receiving view, considering only properties of the view itself. open override var intrinsicContentSize: CGSize { if orientation == .vertical { - return .init(width: Self.lineWidth, height: bounds.height) + return .init(width: lineWidth, height: bounds.height) } else { - return .init(width: bounds.width, height: Self.lineWidth) + return .init(width: bounds.width, height: lineWidth) } } @@ -76,7 +79,7 @@ open class Line: View { config.setSurfaceColors(VDSColor.elementsLowcontrastOnlight, VDSColor.elementsLowcontrastOndark, forKey: .secondary) return config.eraseToAnyColorable() }() - + //-------------------------------------------------- // MARK: - Overrides //-------------------------------------------------- @@ -102,8 +105,8 @@ open class Line: View { open override func draw(_ rect: CGRect) { guard let context = UIGraphicsGetCurrentContext() else { return } - context.setStrokeColor(lineViewColorConfiguration.getColor(self).cgColor) - context.setLineWidth(Self.lineWidth) + context.setStrokeColor(lineColor.cgColor) + context.setLineWidth(lineWidth) if orientation == .horizontal { context.move(to: CGPoint(x: 0, y: rect.height / 2)) From 6eb709a1e79fab9bbeaa824e64199029dc4c0de8 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 20 Sep 2023 14:04:01 -0500 Subject: [PATCH 5/5] refactored line even more Signed-off-by: Matt Bruce --- VDS/Components/Line/Line.swift | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/VDS/Components/Line/Line.swift b/VDS/Components/Line/Line.swift index 78ffd545..c90665be 100644 --- a/VDS/Components/Line/Line.swift +++ b/VDS/Components/Line/Line.swift @@ -41,12 +41,6 @@ open class Line: View { case horizontal, vertical } - //-------------------------------------------------- - // MARK: - Configuration - //-------------------------------------------------- - /// Width of the line. - public let lineWidth: CGFloat = 1.0 - //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- @@ -55,9 +49,6 @@ open class Line: View { /// Allows to render the line vertically. open var orientation: Orientation = .horizontal { didSet { setNeedsUpdate() } } - - /// Line Color for current Style and Surface. - open var lineColor: UIColor { lineViewColorConfiguration.getColor(self) } /// The natural size for the receiving view, considering only properties of the view itself. open override var intrinsicContentSize: CGSize { @@ -71,6 +62,12 @@ open class Line: View { //-------------------------------------------------- // MARK: - Configuration //-------------------------------------------------- + /// Width of the line. + public let lineWidth: CGFloat = 1.0 + + /// Line Color for current Style and Surface. + open var lineColor: UIColor { lineViewColorConfiguration.getColor(self) } + /// Color configuration use for text color. This is a configuration that will provide a color based /// of local properties such as style and surface. open var lineViewColorConfiguration: AnyColorable = {