Near-monochrome palette (ink tokens), black primary buttons, spring animations, 0.5pt hairline dividers, shadow cards, squircle corners. Replaces all blue/coloured accents. Adds ButtonStyles component. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
45 lines
1.5 KiB
Swift
45 lines
1.5 KiB
Swift
import SwiftUI
|
|
|
|
struct FolderRow: View {
|
|
let item: NASItem
|
|
let isSelected: Bool
|
|
let onTap: () -> Void
|
|
|
|
var body: some View {
|
|
Button(action: onTap) {
|
|
HStack(spacing: 12) {
|
|
Image(systemName: item.isDirectory ? "folder" : "doc")
|
|
.font(.system(size: 15, weight: .regular))
|
|
.foregroundStyle(isSelected ? .white : AppTheme.inkSecondary)
|
|
.frame(width: 22)
|
|
|
|
Text(item.name)
|
|
.font(.system(size: 15, weight: isSelected ? .medium : .regular))
|
|
.foregroundStyle(isSelected ? .white : AppTheme.ink)
|
|
.lineLimit(1)
|
|
|
|
Spacer()
|
|
|
|
if isSelected {
|
|
Image(systemName: "checkmark")
|
|
.font(.system(size: 12, weight: .semibold))
|
|
.foregroundStyle(.white)
|
|
} else if item.isDirectory {
|
|
Image(systemName: "chevron.right")
|
|
.font(.system(size: 12, weight: .medium))
|
|
.foregroundStyle(AppTheme.inkQuaternary)
|
|
}
|
|
}
|
|
.padding(.horizontal, 16)
|
|
.padding(.vertical, 12)
|
|
.background(
|
|
isSelected
|
|
? AppTheme.ink
|
|
: Color.clear
|
|
)
|
|
.animation(.spring(response: 0.2, dampingFraction: 0.8), value: isSelected)
|
|
}
|
|
.buttonStyle(PlainButtonStyle())
|
|
}
|
|
}
|