diff --git a/VDS/Components/Badge/Badge.swift b/VDS/Components/Badge/Badge.swift index d0333a09..d151516e 100644 --- a/VDS/Components/Badge/Badge.swift +++ b/VDS/Components/Badge/Badge.swift @@ -37,6 +37,7 @@ open class Badge: View { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- + /// Enum used to describe the primary color for the view. public enum FillColor: String, CaseIterable { case red, yellow, green, orange, blue, black, white } diff --git a/VDS/Components/BadgeIndicator/BadgeIndicator.swift b/VDS/Components/BadgeIndicator/BadgeIndicator.swift index d368df96..4a7fb4a3 100644 --- a/VDS/Components/BadgeIndicator/BadgeIndicator.swift +++ b/VDS/Components/BadgeIndicator/BadgeIndicator.swift @@ -34,17 +34,17 @@ open class BadgeIndicator: View { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- - /// Enum type for fill color. + /// Enum used to describe the primary color for the view. public enum FillColor: String, CaseIterable { case red, yellow, green, orange, blue, gray, grayLowContrast, black, white } - /// Enum type for kind of BadgeIndicator. + /// Enum used to describe the kind of BadgeIndicator. public enum Kind: String, CaseIterable { case simple, numbered } - /// Enum type for maximum number of digits. + /// Enum used to describe the maximum number of digits. public enum MaximumDigits: String, CaseIterable { case one case two diff --git a/VDS/Components/Buttons/Button/Button.swift b/VDS/Components/Buttons/Button/Button.swift index cda4df66..828a7dd4 100644 --- a/VDS/Components/Buttons/Button/Button.swift +++ b/VDS/Components/Buttons/Button/Button.swift @@ -11,6 +11,7 @@ import VDSColorTokens import VDSFormControlsTokens import Combine +/// Enum used to describe the size of a buttonable. public enum ButtonSize: String, CaseIterable { case large case small diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index 92c501d6..b059089b 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -33,10 +33,12 @@ open class ButtonGroup: View { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- + /// Enum used to describe the alignment of the buttons. public enum Alignment: String, CaseIterable { case left, center, right } + /// Enum used to describe the width of any buttons. public enum ChildWidth { case percentage(CGFloat) case value(CGFloat) diff --git a/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift b/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift index efc173b1..a37131c5 100644 --- a/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift +++ b/VDS/Components/Buttons/TextLinkCaret/TextLinkCaret.swift @@ -37,6 +37,7 @@ open class TextLinkCaret: ButtonBase, Buttonable { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- + /// Enum used to describe the position of the icon in relation to the title label. public enum IconPosition: String, CaseIterable { case left, right } diff --git a/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift b/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift index 9a28291d..e7033354 100644 --- a/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift +++ b/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift @@ -33,17 +33,17 @@ open class ButtonIcon: Control { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- - /// Enum for the type of button based on the contrast. + /// Enum used to describe the type of button based on the contrast. public enum Kind: String, CaseIterable { case ghost, lowContrast, highContrast } - /// Enum for the background inside icon button determining the surface type. + /// Enum used to describe the background inside icon button determining the surface type. public enum SurfaceType: String, CaseIterable { case colorFill, media } - /// Enum for the size of button icon and icon + /// Enum used to describe the size of button icon. public enum Size: String, EnumSubset { case large case small diff --git a/VDS/Components/Icon/IconSize.swift b/VDS/Components/Icon/IconSize.swift index 54bebfdf..8cf7178d 100644 --- a/VDS/Components/Icon/IconSize.swift +++ b/VDS/Components/Icon/IconSize.swift @@ -8,7 +8,7 @@ import Foundation extension Icon { - /// Enum for a preset height and width for the icon. + /// Enum used to describe the height and width for the icon. public enum Size: String, CaseIterable { case xsmall case small diff --git a/VDS/Components/Label/Attributes/ImageLabelAttribute.swift b/VDS/Components/Label/Attributes/ImageLabelAttribute.swift index 081b3877..2596b316 100644 --- a/VDS/Components/Label/Attributes/ImageLabelAttribute.swift +++ b/VDS/Components/Label/Attributes/ImageLabelAttribute.swift @@ -12,6 +12,7 @@ public struct ImageLabelAttribute: AttachmentLabelAttributeModel { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- + /// Enum used to describe the type of error that can occur. public enum Error: Swift.Error { case bundleNotFound case imageNotFound(String) diff --git a/VDS/Components/Line/Line.swift b/VDS/Components/Line/Line.swift index c57f4dff..4135678f 100644 --- a/VDS/Components/Line/Line.swift +++ b/VDS/Components/Line/Line.swift @@ -31,12 +31,12 @@ open class Line: View { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- - /// Style of the line that will be displayed. + /// Enum used to describe the style the line that will be displayed. public enum Style: String, CaseIterable { case primary, secondary } - /// Orientation that will be displayed. + /// Enum used to describe the orientation that will be displayed. public enum Orientation: String, CaseIterable { case horizontal, vertical } diff --git a/VDS/Components/Notification/Notification.swift b/VDS/Components/Notification/Notification.swift index 95ab8054..2a409fd0 100644 --- a/VDS/Components/Notification/Notification.swift +++ b/VDS/Components/Notification/Notification.swift @@ -35,7 +35,7 @@ open class Notification: View { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- - /// Type of Notification. + /// Enum used to describe the type of Notification. public enum Style: String, CaseIterable { case info, success, warning, error @@ -53,7 +53,7 @@ open class Notification: View { } } - /// Orientation of Notification. + /// Enum used to describe the orientation of Notification. public enum Layout: String, CaseIterable { case vertical, horizontal } diff --git a/VDS/Components/Tabs/Tabs.swift b/VDS/Components/Tabs/Tabs.swift index 5fdb92bc..218ae582 100644 --- a/VDS/Components/Tabs/Tabs.swift +++ b/VDS/Components/Tabs/Tabs.swift @@ -31,13 +31,13 @@ open class Tabs: View { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- - /// Layout Axis of the Tabs + /// Enum used to describe the layout axis of the tabs public enum Orientation: String, CaseIterable{ case vertical case horizontal } - /// Position for the Hover Border Accent for a Tab. + /// Enum used to describe the position for the Hover Border Accent for a Tab. public enum IndicatorPosition: String, CaseIterable { case top case bottom @@ -51,13 +51,13 @@ open class Tabs: View { } } - /// Type of behavior for Scrolling + /// Enum used to describe the type of behavior for Scrolling public enum Overflow: String, CaseIterable { case scroll case none } - /// Available size for tabs + /// Enum used to describe the available size for tabs public enum Size: String, CaseIterable { case medium case large diff --git a/VDS/Components/Tabs/TabsContainer.swift b/VDS/Components/Tabs/TabsContainer.swift index 06b6c3cc..13401e99 100644 --- a/VDS/Components/Tabs/TabsContainer.swift +++ b/VDS/Components/Tabs/TabsContainer.swift @@ -29,6 +29,7 @@ open class TabsContainer: View { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- + /// Enum used to describe the width of each tab public enum TabsWidth { case percentage(CGFloat) case value(CGFloat) diff --git a/VDS/Components/TextFields/EntryFieldBase.swift b/VDS/Components/TextFields/EntryFieldBase.swift index 07bdba89..6051ce2b 100644 --- a/VDS/Components/TextFields/EntryFieldBase.swift +++ b/VDS/Components/TextFields/EntryFieldBase.swift @@ -33,6 +33,7 @@ open class EntryFieldBase: Control, Changeable { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- + /// Enum used to describe the position of the helper text. public enum HelperTextPlacement: String, CaseIterable { case bottom, right } diff --git a/VDS/Components/TextFields/InputField/InputField.swift b/VDS/Components/TextFields/InputField/InputField.swift index 0e64e27a..27886b55 100644 --- a/VDS/Components/TextFields/InputField/InputField.swift +++ b/VDS/Components/TextFields/InputField/InputField.swift @@ -35,6 +35,7 @@ open class InputField: EntryFieldBase, UITextFieldDelegate { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- + /// Enum used to describe the input type. public enum FieldType: String, CaseIterable { case text, number, calendar, inlineAction, password, creditCard, tel, date, securityCode } diff --git a/VDS/Components/TileContainer/TileContainer.swift b/VDS/Components/TileContainer/TileContainer.swift index bc363df7..137c84ff 100644 --- a/VDS/Components/TileContainer/TileContainer.swift +++ b/VDS/Components/TileContainer/TileContainer.swift @@ -31,7 +31,7 @@ open class TileContainer: Control { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- - /// Background color choices used for this component. + /// Enum used to describe the background color choices used for this component. public enum BackgroundColor: String, CaseIterable { case white case black @@ -39,7 +39,7 @@ open class TileContainer: Control { case transparent } - /// Padding choices used for this component. + /// Enum used to describe the padding choices used for this component. public enum Padding: String, CaseIterable { case padding2X case padding4X @@ -63,7 +63,7 @@ open class TileContainer: Control { } } - /// Aspect ratios used for this component. + /// Enum used to describe the aspect ratios used for this component. public enum AspectRatio: String, CaseIterable { case ratio1x1 = "1:1" case ratio3x4 = "3:4" diff --git a/VDS/Components/Tilelet/TileletSubTitleModel.swift b/VDS/Components/Tilelet/TileletSubTitleModel.swift index cb2b34bb..dab4c81c 100644 --- a/VDS/Components/Tilelet/TileletSubTitleModel.swift +++ b/VDS/Components/Tilelet/TileletSubTitleModel.swift @@ -13,7 +13,7 @@ extension Tilelet { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- - /// Enum for the textStyle of the subTitle label. + /// Enum used to describe the textStyle of the subTitle label. public enum StandardStyle: String, EnumSubset { case bodyLarge case bodyMedium diff --git a/VDS/Components/TitleLockup/TitleLockup.swift b/VDS/Components/TitleLockup/TitleLockup.swift index 4f727678..fc0ae176 100644 --- a/VDS/Components/TitleLockup/TitleLockup.swift +++ b/VDS/Components/TitleLockup/TitleLockup.swift @@ -33,6 +33,7 @@ open class TitleLockup: View { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- + /// Enum used to describe the alignment of the text. public enum TextPosition: String, EnumSubset { case left, center diff --git a/VDS/Components/Tooltip/Tooltip.swift b/VDS/Components/Tooltip/Tooltip.swift index 58f945a3..c179973d 100644 --- a/VDS/Components/Tooltip/Tooltip.swift +++ b/VDS/Components/Tooltip/Tooltip.swift @@ -35,10 +35,12 @@ open class Tooltip: Control, TooltipLaunchable { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- + /// Enum used to describe the color of the tooltip. public enum FillColor: String, CaseIterable { case primary, secondary, brandHighlight } + /// Enum used to describe the size of the icon. public enum Size: String, EnumSubset { case small case medium @@ -56,22 +58,29 @@ open class Tooltip: Control, TooltipLaunchable { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- + /// Icon used to render the tooltip image. open var icon = Icon().with { $0.name = .info $0.size = .small $0.isUserInteractionEnabled = false } + /// Will render the text for Close button for tooltip dialog when on mobile devices open var closeButtonText: String = "Close" { didSet { setNeedsUpdate() }} + /// Will render icon in brand colors. open var fillColor: FillColor = .primary { didSet { setNeedsUpdate() }} + /// Size of the icon open var size: Size = .medium { didSet { setNeedsUpdate() }} + /// Text rendered for the title of the tooltip open var title: String? { didSet { setNeedsUpdate() }} + /// Text rendered for the content of the tooltip open var content: String? { didSet { setNeedsUpdate() }} + /// UIView rendered for the content area of the tooltip open var contentView: UIView? { didSet { setNeedsUpdate() }} //-------------------------------------------------- diff --git a/VDS/Components/Tooltip/TrailingTooltipLabel.swift b/VDS/Components/Tooltip/TrailingTooltipLabel.swift index 15b68b61..a53d59cd 100644 --- a/VDS/Components/Tooltip/TrailingTooltipLabel.swift +++ b/VDS/Components/Tooltip/TrailingTooltipLabel.swift @@ -37,26 +37,36 @@ open class TrailingTooltipLabel: View, TooltipLaunchable { //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- + /// Label used to render the label text. open var label = Label() + /// Text used to render the label. open var labelText: String? { didSet { setNeedsUpdate() }} + /// Attributes used to render the label. open var labelAttributes: [any LabelAttributeModel]? { didSet { setNeedsUpdate() } } + /// Text style used to render the label. open var labelTextStyle: TextStyle = .defaultStyle { didSet { setNeedsUpdate() } } + /// Text position used to render the label. open var labelTextPosition: TextPosition = .left { didSet { setNeedsUpdate() } } + /// Color configuration set for the label. public lazy var textColorConfiguration: AnyColorable = { label.textColorConfiguration }() { didSet { setNeedsUpdate() }} + /// Will render the text for Close button for tooltip dialog when on mobile devices open var tooltipCloseButtonText: String = "Close" { didSet { setNeedsUpdate() } } - + + /// Text rendered for the title of the tooltip open var tooltipTitle: String? { didSet { setNeedsUpdate() } } + /// Text rendered for the content of the tooltip open var tooltipContent: String? { didSet { setNeedsUpdate() } } + /// UIView rendered for the content area of the tooltip open var tooltipContentView: UIView? { didSet { setNeedsUpdate() } } //-------------------------------------------------- @@ -115,6 +125,7 @@ open class TrailingTooltipLabel: View, TooltipLaunchable { extension Label { + /// Model used to represent the tooltip. public struct TooltipModel { /// Current Surface and this is used to pass down to child objects that implement Surfacable public var surface: Surface @@ -131,6 +142,7 @@ extension Label { } } + /// Helper to add a tool tip attribute to an existing label. public func addTooltip(model: TooltipModel) { var newAttributes: [any LabelAttributeModel] = [] diff --git a/VDS/Extensions/VDSLayout.swift b/VDS/Extensions/VDSLayout.swift index 9478e7fc..f30a0635 100644 --- a/VDS/Extensions/VDSLayout.swift +++ b/VDS/Extensions/VDSLayout.swift @@ -7,7 +7,9 @@ import Foundation +/// Represents constants used that deal with layout. public struct VDSLayout { + /// Enum used to describe the spacing constants. public enum Spacing: String, CaseIterable { case space1X case space2X diff --git a/VDS/Protocols/Useable.swift b/VDS/Protocols/Useable.swift index 43c4f4cc..d421db83 100644 --- a/VDS/Protocols/Useable.swift +++ b/VDS/Protocols/Useable.swift @@ -9,10 +9,12 @@ import Foundation import UIKit import VDSColorTokens +/// Enum to describe types of use. public enum Use: String, Equatable { case primary, secondary } public protocol Useable { + /// Selection for the type of use. var use: Use { get set } } diff --git a/VDS/Typography/Typogprahy+Styles.swift b/VDS/Typography/Typogprahy+Styles.swift index 05a6eb64..e278646d 100644 --- a/VDS/Typography/Typogprahy+Styles.swift +++ b/VDS/Typography/Typogprahy+Styles.swift @@ -218,6 +218,7 @@ extension UIEdgeInsets { } extension TextStyle { + /// Enum used to describe the naming convention for the Typography. public enum StandardStyle: String, CaseIterable { case featureXLarge, featureLarge, @@ -234,15 +235,18 @@ extension TextStyle { bodySmall, micro + /// The bold version for this Standard Style. public var bold: TextStyle { return TextStyle(rawValue: "bold\(rawValue.prefix(1).uppercased())\(rawValue.dropFirst())")! } + /// The regular version for this Standard Style. public var regular: TextStyle { TextStyle(rawValue: rawValue)! } } + /// The converting a TextStyle to a StandardStyle. public func toStandardStyle() -> StandardStyle { var rawName = rawValue if rawName.hasPrefix("bold") { diff --git a/VDS/Typography/Typography+Enums.swift b/VDS/Typography/Typography+Enums.swift index 104515f7..902cdff1 100644 --- a/VDS/Typography/Typography+Enums.swift +++ b/VDS/Typography/Typography+Enums.swift @@ -65,6 +65,7 @@ extension TextStyle { //MARK: FontSize extension TextStyle { + /// Enum used to describe the size of font. public enum FontSize: String, CaseIterable { case xxlarge = "2XLarge" case xlarge = "XLarge" @@ -75,7 +76,7 @@ extension TextStyle { } } - +/// Enum used to describe the alignment of text. public enum TextPosition: String, CaseIterable { case left, right, center diff --git a/VDS/Typography/Typography+SpacingConfig.swift b/VDS/Typography/Typography+SpacingConfig.swift index 84b61e20..97cd3e3a 100644 --- a/VDS/Typography/Typography+SpacingConfig.swift +++ b/VDS/Typography/Typography+SpacingConfig.swift @@ -26,6 +26,7 @@ extension TextStyle { } public struct DeviceSpacingConfig { + /// Enum used to describe the type of device for this configuration. public enum DeviceType { case iPhone, iPad, all }