// LyrebirdMessageHelpers.swift // Lyrebird // // Copyright (c) 2026 Joshua Parmenter / realizedsound // SPDX-License-Identifier: MIT #if canImport(SwiftUI) import SwiftUI import LyrebirdSynth /// Module-internal styling helpers shared between ``LyrebirdMessageView`` /// and ``LyrebirdMessageBanner``. /// /// Lives in a `*Helpers.swift` per the project rule for shared file-scope /// helpers used across more than one source file. enum LyrebirdMessageTierStyle { static func color(for tier: LyrebirdMessageTier) -> Color { switch tier { case .info: return .blue case .warning: return .orange case .error: return .red } } static func shortLabel(for tier: LyrebirdMessageTier) -> String { switch tier { case .info: return "INFO" case .warning: return "WARN" case .error: return "ERR" } } } #else // Linux/GTK4 counterpart to the Apple `LyrebirdMessageTierStyle`. Identical // per-tier colour/label mapping; `Color` here is SwiftOpenUI's, not SwiftUI's. // // SwiftOpenUI is always present in this target (see Package.swift). import SwiftOpenUI import LyrebirdSynth /// Module-internal styling helpers shared between ``LyrebirdMessageView`` /// and ``LyrebirdMessageBanner`` on Linux/GTK4. enum LyrebirdMessageTierStyle { static func color(for tier: LyrebirdMessageTier) -> Color { switch tier { case .info: return .blue case .warning: return .orange case .error: return .red } } static func shortLabel(for tier: LyrebirdMessageTier) -> String { switch tier { case .info: return "INFO" case .warning: return "WARN" case .error: return "ERR" } } } #endif