// A studio's CLASS (Sharmila's boards, 23 Oct 2026; Codex round 2 and the// coordinator's review of aa7f6389e), drawn on the kinds the deck already// has, on the flavour's own card (`CardMaterial`: her theme's white card).//// A CLASS (syz-class-2): an event card with a picture (a yoga session, an// event, a booking) is its words down the left and its photograph tall down// the right, to the card's edge. The day spaced small, the time in large// figures with its am/pm small after them, the length by a clock (`subtitle`,// the start and its `also` joined by the core), a short coral rule, the class// heavy, its trainer on a round mount (`people`), a few lines of what it is// (`body`), the room by a pin (`source`), and the places — the core's words// (`place`: "7 of 12 places taken") over a coral bar of the places taken of// the room (`used` of `limit`). No Book button: acts live on the fan.// Every word is the core's (`DeckCard`); the face lays them out. A class is// an event card with a picture: the deck reaches this face through its event// adapter (CottonUI's `DeckFace`), its trainer's picture through the picture// hook (`FaceMount`).importCottonPaperimportCottonValuesimportSwiftUI/// What the studio's class reads off a card: its time.extensionStudioReading {/// The time large and what the core joined after it ("60 min").publicstaticfunc time(_ words: String?) -> (time: String, rest: String?)? {guardlet words else { returnnil }let parts = words.components(separatedBy: ShellLines.line("cards", "join")) .map { $0.trimmingCharacters(in: .whitespaces) }.filter { !$0.isEmpty }guardlet first = parts.first else { returnnil }let rest = parts.dropFirst().joined(separator: ShellLines.line("cards", "join"))return (first, rest.isEmpty ? nil : rest) }}/// A class: its words down the left, its photograph tall down the right.publicstructClassFace<Photo: View>: View {let card: DeckCardvar photo: Photo?publicinit(card: DeckCard, photo: Photo?) {self.card = cardself.photo = photo }publicvar body: someView {GeometryReader { sheet in HStack(spacing: 0) {ClassWords(card: card) .padding(StudioFaceKnobs.inset) .frame(width: photo == nil ? sheet.size.width : sheet.size.width * StudioFaceKnobs.wordsShare, height: sheet.size.height, alignment: .topLeading)iflet photo { photo .frame(width: sheet.size.width * (1 - StudioFaceKnobs.wordsShare), height: sheet.size.height) .clipped() .accessibilityIdentifier("face-photo") .facePart(.picture) } } .frame(width: sheet.size.width, height: sheet.size.height, alignment: .topLeading) .clipped() } .onCardPaper(ClassFaceCatalogue.stock.laid(card.pace)) }}/// The class's words: day, time, length, name, trainer, what it is, room,/// places.privatestructClassWords: View {let card: DeckCard @Environment(\.theme) privatevar themevar body: someView { VStack(alignment: .leading, spacing: 8) {iflet day = card.text("date") {Text(day) .font(theme.type.title(StudioFaceKnobs.daySize)) .tracking(StudioFaceKnobs.dayTracking) .textCase(.uppercase) .lineLimit(1) .faceInk(.ink) .facePart(.when) }ClassTime(card: card) .facePart(.subtitle)Rectangle() .fill(theme.colors.accent.color) .frame(width: StudioFaceKnobs.ruleWidth, height: StudioFaceKnobs.ruleHeight) .padding(.vertical, 4)iflet title = card.text("title") {Text(title) .font(theme.type.display(StudioFaceKnobs.titleSize)) .faceInk(.ink) .lineLimit(3) .minimumScaleFactor(0.6) .accessibilityIdentifier("deck-title") .facePart(.title) }ClassTrainer(card: card) .facePart(.people)iflet about = card.text("body") {Text(about) .font(theme.type.body(StudioFaceKnobs.aboutSize)) .lineLimit(StudioFaceKnobs.aboutLines) .foregroundStyle(theme.colors.inkBody.color.opacity(StudioFaceKnobs.labelFaint)) .facePart(.body) }Spacer(minLength: 0)ClassPlaces(card: card) } }}/// The time in the large figures, its am/pm small after them, and the/// length under it; an event's kind, which is no clock, as a plain line.privatestructClassTime: View {let card: DeckCard @Environment(\.theme) privatevar themevar body: someView {iflet when = StudioReading.time(card.text("subtitle")) { VStack(alignment: .leading, spacing: 2) {iflet clock = StudioReading.clock(when.time) { HStack(alignment: .firstTextBaseline, spacing: 4) {Text(clock.figures) .font(theme.type.figure(StudioFaceKnobs.timeSize)) .lineLimit(1) .minimumScaleFactor(0.5)iflet suffix = clock.suffix {Text(suffix) .font(theme.type.title(StudioFaceKnobs.suffixSize)) .textCase(.uppercase) .lineLimit(1) .fixedSize() } } .faceInk(.ink) } else {Text(when.time) .font(theme.type.title(StudioFaceKnobs.lengthSize)) .lineLimit(1) .faceInk(.ink) }iflet rest = when.rest {StudioFact(symbol: "clock", said: rest, tint: theme.colors.ink.color, size: StudioFaceKnobs.lengthSize) } } .accessibilityElement(children: .combine) .accessibilityIdentifier("face-time") } }}/// The class's trainer on a round mount — their picture, or their initials.privatestructClassTrainer: View {let card: DeckCard @Environment(\.theme) privatevar themevar body: someView {iflet entry = card.entries("people").first, let name = entry["name"]?.text { HStack(spacing: 8) {FaceMount(name: name, picture: entry["picture"]?.text, size: StudioFaceKnobs.personMount)Text(name) .font(theme.type.title(StudioFaceKnobs.lineSize)) .lineLimit(2) .minimumScaleFactor(0.8) .faceInk(.ink) } .accessibilityElement(children: .combine) .accessibilityIdentifier("face-trainer") } }}/// The room by a pin, the core's places words, and the places taken as a/// coral bar.privatestructClassPlaces: View {let card: DeckCard @Environment(\.theme) privatevar themevar body: someView { VStack(alignment: .leading, spacing: 8) {iflet room = card.text("source") {StudioFact(symbol: "mappin", said: room, tint: theme.colors.accent.color, size: StudioFaceKnobs.lineSize + 1) }iflet left = card.text("place") {Text(left) .font(theme.type.body(StudioFaceKnobs.lineSize)) .lineLimit(2) .faceInk(.ink) .facePart(.place) }iflet seats = StudioReading.seats(card) {SeatRule(share: StudioReading.ringShare(taken: seats.taken, of: seats.of), color: theme.colors.accent.color) } } .accessibilityElement(children: .combine) .accessibilityIdentifier("face-seats") }}/// The class face, and the cards it is reviewed in. No card kind names it: a/// class is an event card with a picture, drawn so by the deck's event/// adapter (CottonUI's `DeckFace`).publicenumClassFaceCatalogue {publicstaticlet stock: FaceStock = .framedpublicstaticlet ground: FaceGround = .paperpublicstaticlet face = Face(id: "sharmila.class", specimens: [Specimen("flow", flow, picture: "verandah")]) { card, picture, _ inClassFace(card: card, photo: picture) }publicstaticlet flow = DeckCard(face: .event, fields: ["photo": .text("verandah"), "title": .text("Invented flow"), "subtitle": .text("7:00 am \u{00B7} 60 min"),"date": .text("Thu 29 Oct"), "body": .text("An invented class for an invented morning."), "source": .text("Invented room"),"place": .text("7 of 12 places taken"), "used": .number(7), "limit": .number(12),"people": .list([.object(["name": .text("Invented Trainer"), "picture": .text("portrait")])]), ])}