updated tilelet directional icon model
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
44323a0a84
commit
4ba2b4e744
@ -542,7 +542,7 @@ open class Tilelet: TileContainerBase<Tilelet.Padding> {
|
|||||||
if let directionalIconModel {
|
if let directionalIconModel {
|
||||||
directionalIcon.name = directionalIconModel.iconType.iconName
|
directionalIcon.name = directionalIconModel.iconType.iconName
|
||||||
directionalIcon.colorConfiguration = directionalIconModel.colorConfiguration
|
directionalIcon.colorConfiguration = directionalIconModel.colorConfiguration
|
||||||
directionalIcon.size = directionalIconModel.size
|
directionalIcon.size = directionalIconModel.size.value
|
||||||
directionalIcon.surface = backgroundColorSurface
|
directionalIcon.surface = backgroundColorSurface
|
||||||
directionalIcon.accessibilityLabel = directionalIconModel.accessibleText
|
directionalIcon.accessibilityLabel = directionalIconModel.accessibleText
|
||||||
showIconContainerView = true
|
showIconContainerView = true
|
||||||
|
|||||||
@ -39,7 +39,7 @@ 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 {
|
public enum IconType: String, CaseIterable {
|
||||||
case rightArrow
|
case rightArrow
|
||||||
case externalLink
|
case externalLink
|
||||||
|
|
||||||
@ -48,6 +48,14 @@ extension Tilelet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum IconSize: String, EnumSubset {
|
||||||
|
case small
|
||||||
|
case medium
|
||||||
|
case large
|
||||||
|
|
||||||
|
public var defaultValue: Icon.Size { .medium }
|
||||||
|
}
|
||||||
|
|
||||||
/// Color of the icon.
|
/// Color of the icon.
|
||||||
public var colorConfiguration: SurfaceColorConfiguration
|
public var colorConfiguration: SurfaceColorConfiguration
|
||||||
|
|
||||||
@ -58,11 +66,11 @@ extension Tilelet {
|
|||||||
public var iconType: IconType
|
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: IconSize
|
||||||
|
|
||||||
public init(iconType: IconType = .rightArrow,
|
public init(iconType: IconType = .rightArrow,
|
||||||
colorConfiguration: SurfaceColorConfiguration = .init(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark),
|
colorConfiguration: SurfaceColorConfiguration = .init(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark),
|
||||||
size: Icon.Size = .medium,
|
size: IconSize = .medium,
|
||||||
accessibleText: String? = nil) {
|
accessibleText: String? = nil) {
|
||||||
|
|
||||||
self.iconType = iconType
|
self.iconType = iconType
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user