Files
swiftapp/swift/Sources/Core/Design/ButtonStyles.swift
T
jkunz 2fe6b8a6df WIP: local handoff implementation
Local work on the social.io handoff before merging the claude
worktree branch. Includes the full per-spec Sources/Core/Design
module (8 files), watchOS target under WatchApp/, Live Activity +
widget extension, entitlements, scheme, and asset catalog.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 16:26:38 +02:00

58 lines
2.1 KiB
Swift

import SwiftUI
public struct PrimaryActionStyle: ButtonStyle {
public init() {}
public func makeBody(configuration: Configuration) -> some View {
configuration.label
.font(.headline.weight(.semibold))
.foregroundStyle(.white)
.padding(.horizontal, 16)
.padding(.vertical, 11)
.frame(minHeight: 44)
.background(
RoundedRectangle(cornerRadius: SIO.controlRadius, style: .continuous)
.fill(SIO.tint.opacity(configuration.isPressed ? 0.82 : 1))
)
.opacity(configuration.isPressed ? 0.94 : 1)
}
}
public struct SecondaryActionStyle: ButtonStyle {
public init() {}
public func makeBody(configuration: Configuration) -> some View {
configuration.label
.font(.headline.weight(.semibold))
.foregroundStyle(.primary)
.padding(.horizontal, 16)
.padding(.vertical, 11)
.frame(minHeight: 44)
.background(.regularMaterial, in: RoundedRectangle(cornerRadius: SIO.controlRadius, style: .continuous))
.overlay(
RoundedRectangle(cornerRadius: SIO.controlRadius, style: .continuous)
.strokeBorder(Color.primary.opacity(0.08), lineWidth: 1)
)
.opacity(configuration.isPressed ? 0.9 : 1)
}
}
public struct DestructiveStyle: ButtonStyle {
public init() {}
public func makeBody(configuration: Configuration) -> some View {
configuration.label
.font(.headline.weight(.semibold))
.foregroundStyle(.red)
.padding(.horizontal, 16)
.padding(.vertical, 11)
.frame(minHeight: 44)
.background(.regularMaterial, in: RoundedRectangle(cornerRadius: SIO.controlRadius, style: .continuous))
.overlay(
RoundedRectangle(cornerRadius: SIO.controlRadius, style: .continuous)
.strokeBorder(Color.red.opacity(configuration.isPressed ? 0.35 : 0.18), lineWidth: 1)
)
.opacity(configuration.isPressed ? 0.9 : 1)
}
}