// A section's heading as the link to all of it — the board's sections and a // group's stack draw it. import CottonKit import SwiftUI /// A section's heading AS the link to all of it: the kit's `PaperSection` /// lockup — the name in the serif, the hairline, the handwritten "3 of 12" — /// with a chevron after the count, the person page's own "See all" mark /// (`PersonSectionHeading`). The whole heading opens the list; the chevron is /// what says so. struct ProjectSectionHeading: View { @Environment(\.theme) private var theme let title: String let count: String? var body: some View { HStack(alignment: .center, spacing: SectionHeadingKnobs.sectionHeadingChevronGap) { PaperSection(title: title, count: count) Image(systemName: "chevron.right") .font(theme.type.interface(SectionHeadingKnobs.sectionHeadingChevronSize, weight: .semibold)) .foregroundStyle(theme.print(.pencil)) .padding(.trailing, SectionHeadingKnobs.sectionHeadingChevronTrailingInset) } .frame(minHeight: SectionHeadingKnobs.sectionHeadingMinHeight) } } /// The sizes, counts and timings SectionHeading draws with: Swift's own, beside /// their reader — a theme sets only its tokens (`scale.tokens`). enum SectionHeadingKnobs { static let sectionHeadingChevronGap: CGFloat = 3 static let sectionHeadingChevronSize: CGFloat = 9 static let sectionHeadingChevronTrailingInset: CGFloat = 2 static let sectionHeadingMinHeight: CGFloat = 32 }