diff --git a/Backpack-SwiftUI/SearchInputSummary/Classes/BPKSearchInputSummary.swift b/Backpack-SwiftUI/SearchInputSummary/Classes/BPKSearchInputSummary.swift index ba0e7de5f..9d39b4ee2 100644 --- a/Backpack-SwiftUI/SearchInputSummary/Classes/BPKSearchInputSummary.swift +++ b/Backpack-SwiftUI/SearchInputSummary/Classes/BPKSearchInputSummary.swift @@ -58,7 +58,7 @@ public struct BPKSearchInputSummary: View { HStack(spacing: .md) { prefixView .accessibilityHidden(true) - TextField(placeholder, text: $text) + TextField(placeholder, text: $text, prompt: placeholderView) .font(style: .bodyDefault) .foregroundColor(state.textColor) .disabled(state.isDisabled) @@ -82,6 +82,7 @@ public struct BPKSearchInputSummary: View { BPKIconView(icon.icon) .foregroundColor(icon.color) } + .opacity(text.isEmpty ? 0.0 : 1.0) .accessibilityElement(children: .ignore) .accessibilityLabel(accessibilityLabel) .accessibilityAddTraits(.isButton) @@ -93,6 +94,12 @@ public struct BPKSearchInputSummary: View { } } + @ViewBuilder + private var placeholderView: Text { + Text(placeholder) + .foregroundColor(Color(BPKColor.textSecondaryColor.value)) + } + @ViewBuilder private var prefixView: some View { switch inputPrefix { diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContent.dark-mode.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContent.dark-mode.png index 1a79ce818..687838edf 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContent.dark-mode.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContent.dark-mode.png differ diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContent.light-mode.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContent.light-mode.png index 4d79b01a7..3402df30b 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContent.light-mode.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContent.light-mode.png differ diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContent.rtl.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContent.rtl.png index 9834bd94b..c813d228a 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContent.rtl.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContent.rtl.png differ diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentInputStateClear.dark-mode.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentInputStateClear.dark-mode.png index 20d2df03e..687838edf 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentInputStateClear.dark-mode.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentInputStateClear.dark-mode.png differ diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentInputStateClear.light-mode.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentInputStateClear.light-mode.png index 2d2474318..3402df30b 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentInputStateClear.light-mode.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentInputStateClear.light-mode.png differ diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentInputStateClear.rtl.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentInputStateClear.rtl.png index 46b6da265..c813d228a 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentInputStateClear.rtl.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentInputStateClear.rtl.png differ diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsCustomText.dark-mode.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsCustomText.dark-mode.png index 0b0c5c934..f2c22ff2d 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsCustomText.dark-mode.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsCustomText.dark-mode.png differ diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsCustomText.light-mode.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsCustomText.light-mode.png index 679c93c62..a31e2b1c8 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsCustomText.light-mode.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsCustomText.light-mode.png differ diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsCustomText.rtl.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsCustomText.rtl.png index d45cffbfa..ab1f1b686 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsCustomText.rtl.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsCustomText.rtl.png differ diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsIcon.dark-mode.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsIcon.dark-mode.png index 1a79ce818..687838edf 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsIcon.dark-mode.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsIcon.dark-mode.png differ diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsIcon.light-mode.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsIcon.light-mode.png index 4d79b01a7..3402df30b 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsIcon.light-mode.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsIcon.light-mode.png differ diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsIcon.rtl.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsIcon.rtl.png index 9834bd94b..c813d228a 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsIcon.rtl.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withContentWhenPrefixIsIcon.rtl.png differ diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withLoading.dark-mode.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withLoading.dark-mode.png index 79ac84d3a..1ae138482 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withLoading.dark-mode.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withLoading.dark-mode.png differ diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withLoading.light-mode.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withLoading.light-mode.png index 21ed9da60..9530b95a5 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withLoading.light-mode.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withLoading.light-mode.png differ diff --git a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withLoading.rtl.png b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withLoading.rtl.png index 90d2cd6b3..34f6559c9 100644 Binary files a/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withLoading.rtl.png and b/Backpack-SwiftUI/Tests/AppSearchModal/__Snapshots__/BPKAppSearchModalTests/test_withLoading.rtl.png differ