chore(LilithForms): 🔧 Update UI components (SearchInput.swift, TextArea.swift) to reflect latest design system updates
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
b1a3889917
commit
983e04f903
2 changed files with 10 additions and 3 deletions
|
|
@ -4,6 +4,9 @@
|
|||
// Search input field with magnifying glass icon and clear button
|
||||
|
||||
import SwiftUI
|
||||
#if canImport(UIKit)
|
||||
import UIKit
|
||||
#endif
|
||||
import LilithDesignTokens
|
||||
|
||||
/// Search input field
|
||||
|
|
@ -74,8 +77,10 @@ public struct SearchInput: View {
|
|||
TextField(placeholder, text: $text)
|
||||
.font(AppTypography.body())
|
||||
.foregroundColor(AppColors.textPrimary)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
#if os(iOS) || os(tvOS) || os(watchOS) || os(visionOS)
|
||||
.textInputAutocapitalization(.never)
|
||||
#endif
|
||||
.autocorrectionDisabled()
|
||||
.disabled(isDisabled)
|
||||
.focused($isFocused)
|
||||
.onChange(of: text) { _, newValue in
|
||||
|
|
@ -151,9 +156,10 @@ public struct SearchInput: View {
|
|||
private func clearSearch() {
|
||||
text = ""
|
||||
|
||||
// Light haptic feedback
|
||||
#if canImport(UIKit)
|
||||
let generator = UIImpactFeedbackGenerator(style: .light)
|
||||
generator.impactOccurred()
|
||||
#endif
|
||||
|
||||
onSearch?("")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,6 +194,7 @@ public struct TextArea: View {
|
|||
// MARK: - Preview Provider
|
||||
|
||||
#if DEBUG
|
||||
@available(macOS 14.0, iOS 17.0, *)
|
||||
struct TextArea_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ScrollView {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue