diff --git a/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift b/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift index f3718b81..efc173b1 100644 --- a/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift +++ b/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift @@ -40,43 +40,44 @@ open class TextLinkCaret: ButtonBase, Buttonable { public enum IconPosition: String, CaseIterable { case left, right } - + //-------------------------------------------------- // MARK: - Private Properties //-------------------------------------------------- - open override var textStyle: TextStyle { - TextStyle.boldBodyLarge - } - - private var imageAttribute: CaretLabelAttribute? - - open override var textAttributes: [any LabelAttributeModel]? { - guard let imageAttribute else { return nil } - return [imageAttribute] - } - - //-------------------------------------------------- - // MARK: - Properties - //-------------------------------------------------- - /// The ButtonSize available to this type of Buttonable. - public override var availableSizes: [ButtonSize] { [.large] } - - open var iconPosition: IconPosition = .right { didSet { setNeedsUpdate() } } - private var height: CGFloat { 44 } - - /// UIColor used on the titleLabel text. - open override var textColor: UIColor { - textColorConfiguration.getColor(self) - } private var textColorConfiguration = ControlColorConfiguration().with { $0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .normal) $0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled) $0.setSurfaceColors(VDSColor.interactiveActiveOnlight, VDSColor.interactiveActiveOndark, forState: .highlighted) } + + private var imageAttribute: CaretLabelAttribute? + + //-------------------------------------------------- + // MARK: - Public Properties + //-------------------------------------------------- + /// The ButtonSize available to this type of Buttonable. + public override var availableSizes: [ButtonSize] { [.large] } + + /// Determines icon position of Caret. + open var iconPosition: IconPosition = .right { didSet { setNeedsUpdate() } } + + open override var textAttributes: [any LabelAttributeModel]? { + guard let imageAttribute else { return nil } + return [imageAttribute] + } + + /// UIColor used on the titleLabel text. + open override var textColor: UIColor { + textColorConfiguration.getColor(self) + } + + open override var textStyle: TextStyle { + TextStyle.boldBodyLarge + } //-------------------------------------------------- // MARK: - Overrides @@ -97,7 +98,7 @@ open class TextLinkCaret: ButtonBase, Buttonable { open override func reset() { super.reset() iconPosition = .right - text = nil + text = nil } /// The natural size for the receiving view, considering only properties of the view itself. @@ -117,7 +118,7 @@ extension TextLinkCaret { var spacerWidth: CGFloat = 4.0 var width: CGFloat { caretSize.width + spacerWidth } var caretSize: CGSize { Icon.Size.xsmall.dimensions } - + init(tintColor: UIColor, position: IconPosition) { self.tintColor = tintColor self.position = position