feat(components): export the grouped-list inset as GroupedListInset

The 16dp a grouped list keeps from the screen edge was a private literal in
GroupedRow, so everything that sits outside the cards but belongs to them —
section headers, hints, picker descriptions — had to repeat the number and
had quietly drifted to 24dp in places, leaving pages with two ragged left
margins. Exporting it gives those callers the one value to take.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-30 21:12:37 +02:00
parent bb3ff1f316
commit 38e508b259

View File

@@ -37,6 +37,16 @@ fun positionOf(index: Int, count: Int): Position = when {
else -> Position.Middle
}
/**
* The inset a grouped list keeps from the screen edge.
*
* Exported because it is a *shared* line, not a private detail of [GroupedRow]:
* everything that sits outside the cards but belongs to them — section headers,
* hints, picker descriptions — has to start on the same edge, or the page reads
* as two ragged columns. Take this value rather than writing 16.dp again.
*/
val GroupedListInset = 16.dp
/** Corner radii for a grouped segment: full at the group's outer edges, small between. */
fun groupedShape(position: Position, full: Dp, small: Dp): Shape = when (position) {
Position.Alone -> RoundedCornerShape(full)
@@ -140,7 +150,7 @@ fun GroupedRow(
}
GroupedSurface(
position = position,
modifier = modifier.padding(horizontal = 16.dp),
modifier = modifier.padding(horizontal = GroupedListInset),
onClick = onClick,
color = containerColor,
gapBelow = gapBelow,