// A list's row as a slip: the page's paper — the row's title over its line —// whose tap opens what it names, so it carries the chevron (recordslips rule// 4; R3: no colour fill, no inline Add, no "All N"). Every measure is the// theme's (`slip_*`).importSwiftUI/// A slip's strip: the page's paper and its top and bottom edge.structSlipPaper: View { @Environment(\.theme) privatevar themevar body: someView {let scale = theme.scalelet shape = RoundedRectangle(cornerRadius: scale[.slipRadius], style: .continuous) shape .fill(theme.sheet(.cream)) .overlay(alignment: .top) { Rectangle().fill(theme.colors.hairline.color).frame(height: scale[.slipEdge]) } .overlay(alignment: .bottom) { Rectangle().fill(theme.colors.hairline.color).frame(height: scale[.slipEdge]) } .clipShape(shape) }}/// The one mark a slip carries at rest: a small pencil chevron at its right/// edge, on a slip whose tap leaves the page (a link, "and N more").structSlipChevron: View { @Environment(\.theme) privatevar themevar body: someView {let tall = theme.scale[.slipChevron]Path { path in path.move(to: .zero) path.addLine(to: CGPoint(x: tall / 2, y: tall / 2)) path.addLine(to: CGPoint(x: 0, y: tall)) } .stroke(theme.colors.inkTertiary.color, style: StrokeStyle(lineWidth: theme.scale[.stroke], lineCap: .round, lineJoin: .round)) .frame(width: tall / 2, height: tall) .accessibilityHidden(true) }/// The room a slip's words keep beside the chevron.staticfunc room(_ theme: Theme) -> CGFloat { theme.scale[.slipChevron] / 2 + theme.scale[.slipPad] }}/// One row of a list, or the list's "and N more": a slip of the page's paper/// whose tap opens what it names.structListSlip: View { @Environment(\.theme) privatevar themelet title: Stringvar line: String? = nilvar onTap: () -> Voidvar body: someView {let scale = theme.scaleButton(action: onTap) { VStack(alignment: .leading, spacing: scale[.slipGap] / 2) {Text(title) .paperBody(nil) .fixedSize(horizontal: false, vertical: true)iflet line, !line.isEmpty {Text(line).paperHand(scale[.typeCaptionSize]) .fixedSize(horizontal: false, vertical: true) } } .padding(scale[.slipPad]) .padding(.trailing, SlipChevron.room(theme)) .frame(maxWidth: .infinity, alignment: .topLeading) .background { SlipPaper() } .overlay(alignment: .trailing) { SlipChevron().padding(.trailing, scale[.slipPad]) } .contentShape(Rectangle()) } .buttonStyle(.plain) .accessibilityElement(children: .combine) .accessibilityAddTraits(.isLink) }}