feat(chat): share SwiftUI chat across macOS+iOS

This commit is contained in:
Peter Steinberger
2025-12-14 00:17:07 +00:00
parent c286573f5c
commit e6d522493b
22 changed files with 2001 additions and 1061 deletions

View File

@@ -0,0 +1,47 @@
import SwiftUI
#if os(macOS)
import AppKit
#else
import UIKit
#endif
enum ClawdisChatTheme {
static var surface: Color {
#if os(macOS)
Color(nsColor: .windowBackgroundColor)
#else
Color(uiColor: .systemBackground)
#endif
}
static var card: Color {
#if os(macOS)
Color(nsColor: .textBackgroundColor)
#else
Color(uiColor: .secondarySystemBackground)
#endif
}
static var subtleCard: Color {
#if os(macOS)
Color(nsColor: .textBackgroundColor).opacity(0.55)
#else
Color(uiColor: .secondarySystemBackground).opacity(0.9)
#endif
}
static var divider: Color {
Color.secondary.opacity(0.2)
}
}
enum ClawdisPlatformImageFactory {
static func image(_ image: ClawdisPlatformImage) -> Image {
#if os(macOS)
Image(nsImage: image)
#else
Image(uiImage: image)
#endif
}
}