mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-03 10:55:54 +00:00
- Fix code signing in Mac and iOS test workflows - Fix all SwiftFormat and SwiftLint issues - Fix ESLint issues in web code - Remove force casts and unwrapping in Swift code - Update build scripts to use correct file paths
50 lines
1.2 KiB
Swift
50 lines
1.2 KiB
Swift
import SwiftUI
|
|
|
|
// MARK: - View Extensions
|
|
|
|
extension View {
|
|
/// Applies standard padding used throughout the app.
|
|
///
|
|
/// - Parameters:
|
|
/// - horizontal: Horizontal padding (default: 16)
|
|
/// - vertical: Vertical padding (default: 14)
|
|
public func standardPadding(
|
|
horizontal: CGFloat = 16,
|
|
vertical: CGFloat = 14
|
|
)
|
|
-> some View
|
|
{
|
|
self
|
|
.padding(.horizontal, horizontal)
|
|
.padding(.vertical, vertical)
|
|
}
|
|
}
|
|
|
|
// MARK: - Previews
|
|
|
|
#Preview("Standard Padding") {
|
|
VStack(spacing: 16) {
|
|
HStack {
|
|
Text("Default Padding")
|
|
Spacer()
|
|
Text("16pt H, 14pt V")
|
|
.font(.caption)
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
.standardPadding()
|
|
.background(Color.blue.opacity(0.1))
|
|
|
|
HStack {
|
|
Text("Custom Padding")
|
|
Spacer()
|
|
Text("24pt H, 20pt V")
|
|
.font(.caption)
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
.standardPadding(horizontal: 24, vertical: 20)
|
|
.background(Color.green.opacity(0.1))
|
|
}
|
|
.padding()
|
|
.frame(width: 400)
|
|
.background(Color(NSColor.windowBackgroundColor))
|
|
}
|