updated tilelet directional icon model

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-05-22 16:54:33 -05:00
parent 44323a0a84
commit 4ba2b4e744
2 changed files with 12 additions and 4 deletions

View File

@ -542,7 +542,7 @@ open class Tilelet: TileContainerBase<Tilelet.Padding> {
if let directionalIconModel {
directionalIcon.name = directionalIconModel.iconType.iconName
directionalIcon.colorConfiguration = directionalIconModel.colorConfiguration
directionalIcon.size = directionalIconModel.size
directionalIcon.size = directionalIconModel.size.value
directionalIcon.surface = backgroundColorSurface
directionalIcon.accessibilityLabel = directionalIconModel.accessibleText
showIconContainerView = true

View File

@ -39,7 +39,7 @@ extension Tilelet {
/// Model that represents the options available for the directional icon.
public struct DirectionalIcon {
public enum IconType {
public enum IconType: String, CaseIterable {
case rightArrow
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.
public var colorConfiguration: SurfaceColorConfiguration
@ -58,11 +66,11 @@ extension Tilelet {
public var iconType: IconType
/// Enum for a preset height and width for the icon.
public var size: Icon.Size
public var size: IconSize
public init(iconType: IconType = .rightArrow,
colorConfiguration: SurfaceColorConfiguration = .init(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark),
size: Icon.Size = .medium,
size: IconSize = .medium,
accessibleText: String? = nil) {
self.iconType = iconType