From 740960363d0bc16a53fd40b3e44b1f5d509ef571 Mon Sep 17 00:00:00 2001 From: huwilkes <67026548+huwilkes@users.noreply.github.com> Date: Fri, 7 Jul 2023 11:51:49 -0700 Subject: [PATCH] Update Textfield tokens (#1820) * Add dangerStroke2 * Update Textfield tokens --- .../Demos/AliasColorTokensDemoController.swift | 4 ++++ ios/FluentUI/Core/Theme/FluentTheme+Tokens.swift | 1 + ios/FluentUI/Core/Theme/Tokens/AliasTokens.swift | 4 ++++ ios/FluentUI/TextField/TextFieldTokenSet.swift | 8 ++++---- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ios/FluentUI.Demo/FluentUI.Demo/Demos/AliasColorTokensDemoController.swift b/ios/FluentUI.Demo/FluentUI.Demo/Demos/AliasColorTokensDemoController.swift index b1cf8034a..b4225b684 100644 --- a/ios/FluentUI.Demo/FluentUI.Demo/Demos/AliasColorTokensDemoController.swift +++ b/ios/FluentUI.Demo/FluentUI.Demo/Demos/AliasColorTokensDemoController.swift @@ -99,6 +99,7 @@ class AliasColorTokensDemoController: DemoTableViewController { .dangerForeground1, .dangerForeground2, .dangerStroke1, + .dangerStroke2, .successBackground2, .successForeground1, .successForeground2, @@ -252,6 +253,7 @@ private enum AliasColorTokensDemoSection: CaseIterable { .dangerForeground1, .dangerForeground2, .dangerStroke1, + .dangerStroke2, .successBackground1, .successBackground2, .successForeground1, @@ -409,6 +411,8 @@ private extension FluentTheme.ColorToken { return "DangerForeground2" case .dangerStroke1: return "DangerStroke1" + case .dangerStroke2: + return "DangerStroke2" case .successBackground1: return "SuccessBackground1" case .successBackground2: diff --git a/ios/FluentUI/Core/Theme/FluentTheme+Tokens.swift b/ios/FluentUI/Core/Theme/FluentTheme+Tokens.swift index f4fe263dd..3133dbefa 100644 --- a/ios/FluentUI/Core/Theme/FluentTheme+Tokens.swift +++ b/ios/FluentUI/Core/Theme/FluentTheme+Tokens.swift @@ -94,6 +94,7 @@ public extension FluentTheme { case dangerForeground1 case dangerForeground2 case dangerStroke1 + case dangerStroke2 case successBackground1 case successBackground2 case successForeground1 diff --git a/ios/FluentUI/Core/Theme/Tokens/AliasTokens.swift b/ios/FluentUI/Core/Theme/Tokens/AliasTokens.swift index da9dc9872..21f01df9c 100644 --- a/ios/FluentUI/Core/Theme/Tokens/AliasTokens.swift +++ b/ios/FluentUI/Core/Theme/Tokens/AliasTokens.swift @@ -142,6 +142,7 @@ public final class AliasTokens: NSObject { case dangerForeground1 case dangerForeground2 case dangerStroke1 + case dangerStroke2 case successBackground1 case successBackground2 case successForeground1 @@ -431,6 +432,9 @@ extension AliasTokens { case .dangerStroke1: return DynamicColor(light: GlobalTokens.sharedColors(.red, .tint20), dark: GlobalTokens.sharedColors(.red, .tint20)) + case .dangerStroke2: + return DynamicColor(light: GlobalTokens.sharedColors(.red, .primary), + dark: GlobalTokens.sharedColors(.red, .tint30)) case .successBackground1: return DynamicColor(light: GlobalTokens.sharedColors(.green, .tint60), dark: GlobalTokens.sharedColors(.green, .shade40)) diff --git a/ios/FluentUI/TextField/TextFieldTokenSet.swift b/ios/FluentUI/TextField/TextFieldTokenSet.swift index c2446e045..39c377082 100644 --- a/ios/FluentUI/TextField/TextFieldTokenSet.swift +++ b/ios/FluentUI/TextField/TextFieldTokenSet.swift @@ -62,7 +62,7 @@ public class TextFieldTokenSet: ControlTokenSet { case .unfocused, .focused: return theme.color(.foreground2) case .error: - return theme.color(.dangerForeground1) + return theme.color(.dangerForeground2) } } case .assistiveTextFont: @@ -92,9 +92,9 @@ public class TextFieldTokenSet: ControlTokenSet { case .unfocused: return theme.color(.stroke1) case .focused: - return theme.color(.brandForeground1) + return theme.color(.brandStroke1) case .error: - return theme.color(.dangerForeground1) + return theme.color(.dangerStroke2) } } case .titleLabelColor: @@ -105,7 +105,7 @@ public class TextFieldTokenSet: ControlTokenSet { case .focused: return theme.color(.brandForeground1) case .error: - return theme.color(.dangerForeground1) + return theme.color(.dangerForeground2) } } case .titleLabelFont: