({
children,
space,
align,
}: {
children: ReactNode;
space: BoxProps['paddingBottom'];
align?: ResponsiveValue<'left' | 'center' | 'right'>;
})
| 13 | } as const; |
| 14 | |
| 15 | export const Stack = ({ |
| 16 | children, |
| 17 | space, |
| 18 | align, |
| 19 | }: { |
| 20 | children: ReactNode; |
| 21 | space: BoxProps['paddingBottom']; |
| 22 | align?: ResponsiveValue<'left' | 'center' | 'right'>; |
| 23 | }) => { |
| 24 | const stackItems = Children.toArray(children); |
| 25 | const alignItems = align |
| 26 | ? mapResponsiveValue(align, (value) => alignToFlexAlign[value]) |
| 27 | : undefined; |
| 28 | |
| 29 | return ( |
| 30 | <Box display="flex" flexDirection="column" alignItems={alignItems}> |
| 31 | {stackItems.map((item, index) => ( |
| 32 | <Box |
| 33 | key={index} |
| 34 | paddingBottom={index !== stackItems.length - 1 ? space : undefined} |
| 35 | > |
| 36 | {item} |
| 37 | </Box> |
| 38 | ))} |
| 39 | </Box> |
| 40 | ); |
| 41 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…