feat: Adds more buttons and reverse label style

This commit is contained in:
2024-06-04 19:38:40 -04:00
parent dd8f360417
commit a65ac76dde
5 changed files with 130 additions and 16 deletions

View File

@@ -0,0 +1,24 @@
import SwiftUI
/// A label style that puts the title first and icon second.
public struct ReverseLabelStyle: LabelStyle {
let spacing: CGFloat
public init(spacing: CGFloat = 3) {
self.spacing = spacing
}
public func makeBody(configuration: Configuration) -> some View {
HStack(spacing: spacing) {
configuration.title
configuration.icon
}
}
}
extension LabelStyle where Self == ReverseLabelStyle {
public static func reverse(spacing: CGFloat = 3) -> Self {
.init(spacing: spacing)
}
}