diff --git a/VDS/Components/Checkbox/CheckboxGroup.swift b/VDS/Components/Checkbox/CheckboxGroup.swift index 221f4463..163d649a 100644 --- a/VDS/Components/Checkbox/CheckboxGroup.swift +++ b/VDS/Components/Checkbox/CheckboxGroup.swift @@ -81,6 +81,8 @@ open class CheckboxGroup: SelectorGroupHandlerBase { } private var _showError: Bool = false + + /// Whether not to show the error. open var showError: Bool { get { _showError } set { diff --git a/VDS/Components/Checkbox/CheckboxItem.swift b/VDS/Components/Checkbox/CheckboxItem.swift index 6dd4c2ad..3abec418 100644 --- a/VDS/Components/Checkbox/CheckboxItem.swift +++ b/VDS/Components/Checkbox/CheckboxItem.swift @@ -28,8 +28,10 @@ open class CheckboxItem: SelectorItemBase { } //-------------------------------------------------- - // MARK: - Properties + // MARK: - Public Properties //-------------------------------------------------- + /// Whether or not there is animation when the checkbox changes state from non-selected to a selected state. + open var isAnimated: Bool = false { didSet { setNeedsUpdate() }} //-------------------------------------------------- diff --git a/VDS/Components/Icon/Icon.swift b/VDS/Components/Icon/Icon.swift index 873609f6..53209aca 100644 --- a/VDS/Components/Icon/Icon.swift +++ b/VDS/Components/Icon/Icon.swift @@ -39,12 +39,14 @@ open class Icon: View { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- + /// UIImageView used to render the icon. open var imageView = UIImageView().with { $0.translatesAutoresizingMaskIntoConstraints = false $0.contentMode = .scaleAspectFill $0.clipsToBounds = true } + /// Color of the icon. open var color: UIColor = VDSColor.paletteBlack { didSet { if let hex = color.hexString, !UIColor.isVDSColor(color: color) { @@ -53,8 +55,14 @@ open class Icon: View { setNeedsUpdate() } } + + /// Size of the icon. open var size: Size = .medium { didSet { setNeedsUpdate() }} + + /// This will be used to render the icon with corresponding name. open var name: Name? { didSet { setNeedsUpdate() }} + + /// A custom size of the icon. open var customSize: Int? { didSet { setNeedsUpdate() }} /// The natural size for the receiving view, considering only properties of the view itself. diff --git a/VDS/Components/Icon/IconName.swift b/VDS/Components/Icon/IconName.swift index ebb666b4..c2d5076b 100644 --- a/VDS/Components/Icon/IconName.swift +++ b/VDS/Components/Icon/IconName.swift @@ -10,6 +10,20 @@ import UIKit import VDSColorTokens extension Icon { + + /// A representation that will be used to render the icon with corresponding name. + /// + /// A Icon.Name will only show up as a selection if the developer has created one and added to the Icon.Name namespace. + /// ``` + /// /// add the new Icon.Name to the namespace. + /// extension Icon.Name { + /// public static let foo = Name(name: "foo-image") + /// } + /// + /// /// use the new Icon.Name you just created. + /// let icon = Icon() + /// icon.name = .foo + /// ``` public struct Name: RawRepresentable { public typealias RawValue = String public var rawValue: String diff --git a/VDS/Components/Icon/IconSize.swift b/VDS/Components/Icon/IconSize.swift index 86b865f7..54bebfdf 100644 --- a/VDS/Components/Icon/IconSize.swift +++ b/VDS/Components/Icon/IconSize.swift @@ -8,6 +8,7 @@ import Foundation extension Icon { + /// Enum for a preset height and width for the icon. public enum Size: String, CaseIterable { case xsmall case small