updated icon models for color and icon type
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
a440ba4844
commit
05829907a9
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import VDSTokens
|
||||||
|
|
||||||
extension Tilelet {
|
extension Tilelet {
|
||||||
|
|
||||||
@ -15,17 +16,21 @@ extension Tilelet {
|
|||||||
/// A representation that will be used to render the icon with corresponding name.
|
/// A representation that will be used to render the icon with corresponding name.
|
||||||
public var name: Icon.Name
|
public var name: Icon.Name
|
||||||
|
|
||||||
|
/// Color of the icon.
|
||||||
|
public var color: UIColor
|
||||||
|
|
||||||
/// Enum for a preset height and width for the icon.
|
/// Enum for a preset height and width for the icon.
|
||||||
public var size: Icon.Size
|
public var size: Icon.Size
|
||||||
|
|
||||||
/// Accessible Text for the Icon
|
/// Accessible Text for the Icon
|
||||||
var accessibleText: String
|
public var accessibleText: String
|
||||||
|
|
||||||
/// Current Surface and this is used to pass down to child objects that implement Surfacable
|
/// Current Surface and this is used to pass down to child objects that implement Surfacable
|
||||||
public var surface: Surface
|
public var surface: Surface
|
||||||
|
|
||||||
public init(name: Icon.Name = .multipleDocuments, size: Icon.Size = .medium, accessibleText: String? = nil, surface: Surface = .dark) {
|
public init(name: Icon.Name = .multipleDocuments, color: UIColor = VDSColor.paletteBlack, size: Icon.Size = .medium, accessibleText: String? = nil, surface: Surface = .dark) {
|
||||||
self.name = name
|
self.name = name
|
||||||
|
self.color = color
|
||||||
self.accessibleText = accessibleText ?? name.rawValue
|
self.accessibleText = accessibleText ?? name.rawValue
|
||||||
self.size = size
|
self.size = size
|
||||||
self.surface = surface
|
self.surface = surface
|
||||||
@ -34,13 +39,34 @@ extension Tilelet {
|
|||||||
|
|
||||||
/// Model that represents the options available for the directional icon.
|
/// Model that represents the options available for the directional icon.
|
||||||
public struct DirectionalIcon {
|
public struct DirectionalIcon {
|
||||||
|
public enum IconType {
|
||||||
|
case rightArrow
|
||||||
|
case externalLink
|
||||||
|
|
||||||
|
public var iconName: Icon.Name {
|
||||||
|
return self == .rightArrow ? .rightArrow : .externalLink
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Color of the icon.
|
||||||
|
public var color: UIColor
|
||||||
|
|
||||||
|
/// Accessible Text for the Icon
|
||||||
|
public var accessibleText: String
|
||||||
|
|
||||||
|
/// Enum for a icon type you want shown..
|
||||||
|
public var iconType: IconType
|
||||||
|
|
||||||
/// Enum for a preset height and width for the icon.
|
/// Enum for a preset height and width for the icon.
|
||||||
public var size: Icon.Size
|
public var size: Icon.Size
|
||||||
|
|
||||||
/// Current Surface and this is used to pass down to child objects that implement Surfacable
|
/// Current Surface and this is used to pass down to child objects that implement Surfacable
|
||||||
public var surface: Surface
|
public var surface: Surface
|
||||||
|
|
||||||
public init(size: Icon.Size = .medium, surface: Surface = .dark) {
|
public init(iconType: IconType = .rightArrow, color: UIColor = VDSColor.paletteBlack, size: Icon.Size = .medium, accessibleText: String? = nil, surface: Surface = .dark) {
|
||||||
|
self.iconType = iconType
|
||||||
|
self.color = color
|
||||||
|
self.accessibleText = accessibleText ?? iconType.iconName.rawValue
|
||||||
self.size = size
|
self.size = size
|
||||||
self.surface = surface
|
self.surface = surface
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user