// The small record primitive: the chip.//// THE COLOUR RULE: colour NEVER names a kind. A chip is typed on the straw// pill every kind shares.//// ON PAPER (phase 20, 2026-09-14) it speaks one of the kit's voices: a chip is// typed.//// Five more lived here — the date line, the kind badge, the pending badge and// the todo check until 2026-09-15, the mark line until the gallery went. Each// was left with no caller but its own gallery specimen and went with it; what// survived them is drawn elsewhere — the hand tick is `Paper/Marks.swift`'s// `HandTick`, and the box around it the todo card's own `TodoCheckSquare`.importSwiftUI// ── The chip ──────────────────────────────────────────────────────────────/// The paper pill a badge and a chip are typed on — ONE dye for every kind,/// because colour never names a kind.enumRecordPill {staticlet dye: PaperDye = .straw}/// TWO STATES, ONE OBJECT. With no action it is bare TEXT — no ground, no/// padding, no chip form; a data chip is a fact, not a control that does/// nothing. With one it is a pill.////// A chip is TEXT: no colour dot, no hue coding. Callers pass the bare name and/// the sigil separately — a double `##` is a caller's bug, not a chip's.publicstructChip: View { @Environment(\.theme) privatevar themepublicenumPrefix: String, Sendable { case project = "#", person = "@" }privatelet label: Stringprivatelet prefix: Prefix?privatelet isSelected: Boolprivatelet isDisabled: Boolprivatelet accessibilityText: String?privatelet action: (() -> Void)?publicinit( label: String, prefix: Prefix? = nil, selected: Bool = false, disabled: Bool = false, accessibilityLabel: String? = nil, action: (() -> Void)? = nil ) {self.label = labelself.prefix = prefixself.isSelected = selectedself.isDisabled = disabledself.accessibilityText = accessibilityLabelself.action = action }privatevar shown: String { "\(prefix?.rawValue ?? "")\(label)" }publicvar body: someView {iflet action {Button {// Guarded in the HANDLER as well as by `disabled`: the phone// learned that a disabled pressable can still fire under some// gesture responders, and the guard costs nothing.guard !isDisabled else { return } action() } label: {Text(shown) .font(CottonFonts.type(13)) .foregroundStyle(isSelected ? RecordPill.dye.fill : theme.print(.ink)) .padding(.horizontal, 10) .padding(.vertical, 4) .background(// Selected is the ink disc's own grammar: ink under// paper-coloured type.Capsule().fill(isSelected ? theme.print(.ink) : RecordPill.dye.fill) ) .opacity(isDisabled ? DisabledOpacity.control : 1) } .buttonStyle(MotionButtonStyle()) .disabled(isDisabled) .accessibilityLabel(accessibilityText ?? label) .accessibilityAddTraits(isSelected ? .isSelected : []) } else {Text(shown).paperBody(13, ink: .pencil) } }}