// A studio's CLIENT in its own look (Codex round 2: syz-admin; the// coordinator's review of aa7f6389e): a member, a lead, or a trainer with no// photograph (`TrainerFace`). Never a stock face: their initials large on a band of the// look's blush where the design has a photograph, the corner's why-now as a// coral pill while pressing, the name heavy and the plan under it// (`subtitle`), a hairline, the facts each by its symbol with its label and// its words heavier (`facts`: Ends 12 Nov, Usually Mon 7:00 · Iyengar, Last// attended 2 Oct — or, until the package says them, when they last came,// `reached`), and the classes of the period: the core's words (`count`: 2 of// 12 this month) with the share as a percent and a coral bar (`used` of// `limit`). No action is drawn on the card. Every word is the core's.importCottonPaperimportCottonValuesimportSwiftUI/// A member or a lead: their initials large where the design has a/// photograph, their why-now, name, plan, facts and classes of the period.publicstructClientFace: View {let card: DeckCard/// The pages its card turns to after it (`card.pages`), each a column's/// words under its label (`FaceTurns`).var pages: [CardPage] = [] @Environment(\.theme) privatevar themepublicinit(card: DeckCard, pages: [CardPage] = []) {self.card = cardself.pages = pages }publicvar body: someView {FaceTurns(pages: pages) { front } .onCardPaper(ClientFaceCatalogue.stock.laid(card.pace)) }/// The face itself, before the pages its card turns to. @ViewBuilder privatevar front: someView {GeometryReader { sheet in VStack(alignment: .leading, spacing: 0) {ClientBand(card: card) .frame(width: sheet.size.width, height: sheet.size.height * StudioBrandKnobs.clientBand)ClientWords(card: card) .padding(StudioBrandKnobs.inset) .frame(width: sheet.size.width, alignment: .topLeading) } .frame(width: sheet.size.width, height: sheet.size.height, alignment: .topLeading) } }}/// The band across the top: the look's blush, the initials large in it, the/// why-now pill at its corner.privatestructClientBand: View {let card: DeckCard @Environment(\.theme) privatevar themevar body: someView { ZStack(alignment: .topTrailing) { theme.colors.highlight.color.opacity(0.55)iflet name = card.text("title") {StudioMonogram(name: name, size: StudioBrandKnobs.clientMount) .frame(maxWidth: .infinity, maxHeight: .infinity) }iflet corner = card.corner {Text(corner) .font(theme.type.body(StudioBrandKnobs.cornerSize)) .lineLimit(1) .foregroundStyle(card.pressing ? theme.colors.accentContrast.color : theme.colors.ink.color) .padding(StudioBrandKnobs.cornerPad) .background(Capsule().fill(card.pressing ? theme.colors.accent.color : theme.colors.paper.color)) .padding(16) .accessibilityIdentifier("face-corner") .facePart(.when) } } }}privatestructClientWords: View {let card: DeckCard @Environment(\.theme) privatevar themevar body: someView { VStack(alignment: .leading, spacing: 12) { VStack(alignment: .leading, spacing: 2) {iflet name = card.text("title") {Text(name) .font(theme.type.display(StudioBrandKnobs.clientName)) .lineLimit(1) .minimumScaleFactor(0.6) .faceInk(.ink) .accessibilityIdentifier("deck-title") .facePart(.title) }iflet plan = card.text("subtitle") {Text(plan) .font(theme.type.body(StudioBrandKnobs.lineSize + 1)) .lineLimit(1) .foregroundStyle(theme.colors.ink.color) .facePart(.subtitle) } }Rectangle() .fill(theme.colors.hairline.color.opacity(StudioBrandKnobs.hairlineFaint)) .frame(height: 1)ClientFacts(card: card)ClientClasses(card: card).padding(.top, 4) } }}/// The client's facts, each by its symbol: its label, then its words.privatestructClientFacts: View {let card: DeckCard @Environment(\.theme) privatevar themevar body: someView {let facts = StudioReading.facts(card)let symbols = StudioBrandKnobs.factSymbols VStack(alignment: .leading, spacing: 10) {ForEach(Array(facts.prefix(symbols.count).enumerated()), id: \.offset) { index, fact inStudioFact(symbol: symbols[index], label: fact.label, said: fact.said, tint: theme.colors.ink.color, size: StudioBrandKnobs.factSize) }if facts.isEmpty, let reached = card.text("reached") {StudioFact(symbol: symbols[symbols.count - 1], said: reached, tint: theme.colors.ink.color, size: StudioBrandKnobs.factSize) } } }}/// The classes of the period: the core's words and the share as a percent,/// over a coral bar.privatestructClientClasses: View {let card: DeckCard @Environment(\.theme) privatevar themevar body: someView {iflet seats = StudioReading.seats(card) { VStack(alignment: .leading, spacing: 8) { HStack(alignment: .firstTextBaseline) {iflet words = card.text("count") {Text(words) .font(theme.type.body(StudioBrandKnobs.factSize + 1)) .lineLimit(1) .foregroundStyle(theme.colors.inkBody.color) }Spacer(minLength: 8)Text(Double(StudioReading.percent(taken: seats.taken, of: seats.of)) / 100, format: .percent.precision(.fractionLength(0))) .font(theme.type.body(StudioBrandKnobs.factSize - 1)) .foregroundStyle(theme.colors.inkBody.color.opacity(StudioFaceKnobs.labelFaint)) }SeatRule(share: StudioReading.ringShare(taken: seats.taken, of: seats.of), color: theme.colors.accent.color) } .accessibilityElement(children: .combine) .accessibilityIdentifier("face-seats") } }}/// The client face, and the cards it is reviewed in. A studio's kit names it/// for its members and leads (`sharmila.client`), with the pages its card/// turns to.publicenumClientFaceCatalogue {publicstaticlet stock: FaceStock = .creampublicstaticlet ground: FaceGround = .paperpublicstaticlet face = Face(id: "sharmila.client", specimens: [Specimen("member", member)]) { card, _, _ inClientFace(card: card, pages: card.pages) }publicstaticlet member = DeckCard(face: .sharmilaClient, corner: "not seen 3 weeks", pressing: true, fields: ["title": .text("Invented Member"), "subtitle": .text("Invented line"), "reached": .text("2 Oct"),"facts": .list([ .object(["label": .text("Invented label"), "said": .text("Mon 9:15 AM")]), .object(["label": .text("Invented label"), "said": .text("Wed 11:30 AM")]), ]),"count": .text("2 of 12 this month"), "used": .number(2), "limit": .number(12), ])}