documentation update
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
d78a87273e
commit
e3f791960a
@ -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
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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() }}
|
||||
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -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] = []
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 }
|
||||
}
|
||||
|
||||
@ -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") {
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user