Some more tweaks to compound for User Status. (#5708)

* Add a plain list modifier to Compound.

* Move ElementTextFieldStyle into Compound and support more styles from the Figma

- More accurately reflects our Liquid Glass updates.
- Adds support for the .raised style.

* Update Element X snapshots.
This commit is contained in:
Doug
2026-06-05 15:59:34 +01:00
committed by GitHub
parent 21d2f59b26
commit 097d055dbe
151 changed files with 574 additions and 531 deletions
@@ -8,12 +8,28 @@
import SwiftUI
public enum CompoundListKind {
/// The default style for `List` or `Form`.
case inset
/// The `.plain` style when using a `List`.
case plain
}
public extension View {
/// Styles a list using the Compound design tokens.
func compoundList() -> some View {
environment(\.defaultMinListRowHeight, 48)
.scrollContentBackground(.hidden)
.background(Color.compound.bgSubtleSecondaryLevel0.ignoresSafeArea())
@ViewBuilder
func compoundList(_ kind: CompoundListKind = .inset) -> some View {
switch kind {
case .inset:
environment(\.defaultMinListRowHeight, 48)
.scrollContentBackground(.hidden)
.background(Color.compound.bgSubtleSecondaryLevel0.ignoresSafeArea())
case .plain:
listStyle(.plain)
.environment(\.defaultMinListRowHeight, 48)
.scrollContentBackground(.hidden)
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
}
}
/// Styles a list section header using the Compound design tokens.