@@ -226,7 +226,7 @@ const _InfoItemValue = (
226226 ref = { ref as never }
227227 display = "flex"
228228 flexDirection = "row"
229- alignItems = "flex-start "
229+ alignItems = "center "
230230 // Horizontal: `flex={1}` grows the value to fill the row beside the fixed label column.
231231 // Vertical: the value sits BELOW the label inside a flex COLUMN, where `flex={1}` would
232232 // (wrongly) grow it along the vertical axis; instead stretch it to the full cell width so
@@ -400,7 +400,8 @@ const InfoItem = assignWithoutSideEffects(React.forwardRef(_InfoItem), {
400400 * column count with an equal-width wrapping flex layout (each cell gets width `100 / N %`).
401401 *
402402 * We only need to handle the two shapes InfoGroup actually uses:
403- * - `repeat(N, ...)` / `repeat(min(N, ...), ...)` -> N (web default is `repeat(min(4, count), 1fr)`)
403+ * - `repeat(N, ...)` / `repeat(min(N, M), ...)` / `repeat(max(N, M), ...)` -> N or min/max(N, M)
404+ * (web default is `repeat(min(4, count), 1fr)`)
404405 * - an explicit track list, e.g. `1fr`, `1fr 1fr`, `50% 50%` -> number of tracks
405406 * - undefined / unrecognized -> `min(4, childCount)` (mirrors the web default)
406407 */
@@ -413,13 +414,26 @@ const getVerticalColumnCount = (
413414 const template = String ( gridTemplateColumns ?? '' ) . trim ( ) ;
414415 if ( ! template ) return fallback ;
415416
416- // `repeat(N, ...)` / `repeat(min(N, ...), ...)` -> the leading integer is the column count.
417- const repeatMatch = / r e p e a t \( \s * (?: m i n | m a x | m i n m a x ) ? \( ? \s * ( \d + ) / i. exec ( template ) ;
418- if ( repeatMatch ) {
419- const parsed = parseInt ( repeatMatch [ 1 ] , 10 ) ;
417+ // `repeat(N, ...)` -> N is the column count.
418+ // `repeat(min(N, M), ...)` -> Math.min(N, M) is the column count.
419+ // `repeat(max(N, M), ...)` -> Math.max(N, M) is the column count.
420+ // `repeat(minmax(N, M), ...)` -> N is a reasonable default (the min track count).
421+ const simpleRepeatMatch = / r e p e a t \( \s * ( \d + ) / i. exec ( template ) ;
422+ if ( simpleRepeatMatch ) {
423+ const parsed = parseInt ( simpleRepeatMatch [ 1 ] , 10 ) ;
420424 return parsed > 0 ? parsed : fallback ;
421425 }
422426
427+ const minRepeatMatch = / r e p e a t \( \s * m i n \( \s * ( \d + ) \s * , \s * ( \d + ) / i. exec ( template ) ;
428+ if ( minRepeatMatch ) {
429+ return Math . min ( parseInt ( minRepeatMatch [ 1 ] , 10 ) , parseInt ( minRepeatMatch [ 2 ] , 10 ) ) ;
430+ }
431+
432+ const maxRepeatMatch = / r e p e a t \( \s * m a x \( \s * ( \d + ) \s * , \s * ( \d + ) / i. exec ( template ) ;
433+ if ( maxRepeatMatch ) {
434+ return Math . max ( parseInt ( maxRepeatMatch [ 1 ] , 10 ) , parseInt ( maxRepeatMatch [ 2 ] , 10 ) ) ;
435+ }
436+
423437 // Explicit track list -> number of whitespace-separated tracks.
424438 const tracks = template . split ( / \s + / ) . filter ( Boolean ) . length ;
425439 return tracks > 0 ? tracks : fallback ;
@@ -506,7 +520,9 @@ const _InfoGroup = (
506520 { ! isHorizontal
507521 ? React . Children . map ( children , ( child , index ) => {
508522 if ( ! React . isValidElement ( child ) ) return child ;
509- const isLastColumn = index % verticalColumnCount === verticalColumnCount - 1 ;
523+ const isLastColumn =
524+ index % verticalColumnCount === verticalColumnCount - 1 ||
525+ index === childCount - 1 ;
510526 const isLastRow = Math . floor ( index / verticalColumnCount ) === verticalRowCount - 1 ;
511527 return (
512528 < BaseBox
0 commit comments