refactor: add color assets and update UI components

This commit is contained in:
2026-03-16 16:36:21 +07:00
parent 37b87ececd
commit d991d06f17
25 changed files with 532 additions and 160 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ struct AppBackgroundModifier: ViewModifier {
func body(content: Content) -> some View {
content.background(
LinearGradient(
colors: [Color(.systemGroupedBackground), Color.red.opacity(0.08)],
colors: [Color(.systemGroupedBackground), Color.brand.opacity(0.08)],
startPoint: .top,
endPoint: .bottom
)
+15
View File
@@ -0,0 +1,15 @@
import SwiftUI
extension Color {
static let brand = Color("Brand")
static let success = Color("Success")
static let warning = Color("Warning")
static let info = Color("Info")
}
extension ShapeStyle where Self == Color {
static var brand: Color { .brand }
static var success: Color { .success }
static var warning: Color { .warning }
static var info: Color { .info }
}
+5
View File
@@ -23,3 +23,8 @@ struct AppSecureField: View {
)
}
}
#Preview {
AppSecureField(title: "Password", icon: "lock.fill", text: .constant(""))
.padding()
}
+5
View File
@@ -23,3 +23,8 @@ struct AppTextField: View {
)
}
}
#Preview {
AppTextField(title: "Email", icon: "envelope.fill", text: .constant("user@example.com"))
.padding()
}
+14 -4
View File
@@ -17,10 +17,10 @@ enum NotificationSeverity: String {
var color: Color {
switch self {
case .critical: return .red
case .warning: return .orange
case .info: return .blue
case .success: return .green
case .critical: return .brand
case .warning: return .warning
case .info: return .info
case .success: return .success
}
}
@@ -45,3 +45,13 @@ struct NotificationIconView: View {
}
}
}
#Preview {
HStack(spacing: 16) {
NotificationIconView(severity: .critical, isActive: true)
NotificationIconView(severity: .warning, isActive: false)
NotificationIconView(severity: .info, isActive: false)
NotificationIconView(severity: .success, isActive: false)
}
.padding()
}