feat: Adds more flagged view style options.

This commit is contained in:
2024-06-07 10:00:42 -04:00
parent 75fa3b55ae
commit 280cb3b863
8 changed files with 116 additions and 17 deletions

View File

@@ -0,0 +1,28 @@
import SharedModels
import Styleguide
import SwiftUI
/// Represents the message of a flagged value result, which is stylable using the
/// `.flaggedMessageLabelStyle` modifier on a view.
///
/// By default the status label is colored using the default status color.
public struct FlaggedMessageLabel: View {
@Environment(\.flaggedMessageLabelStyle) private var style
let message: String?
public init(message: String?) {
self.message = message
}
public var body: some View {
if let message {
TextLabel(message)
.textLabelStyle(style)
}
}
}
#Preview {
FlaggedStatusLabel(status: .warning)
.flaggedStatusLabelStyle(.heavyTitle2)
}