| 1 |
/** |
| 2 |
* WordPress dependencies |
| 3 |
*/ |
| 4 |
import { Flex } from '@wordpress/components'; |
| 5 |
|
| 6 |
/** |
| 7 |
* Vertical stack with a consistent gap. |
| 8 |
* |
| 9 |
* Our controls set `__nextHasNoMarginBottom`, so vertical spacing between |
| 10 |
* sibling fields is owned here (a single Flex gap), not by per-control margins. |
| 11 |
* |
| 12 |
* @param {Object} props Props (forwarded to Flex). |
| 13 |
* @param {Element} props.children Stack contents. |
| 14 |
* |
| 15 |
* @return {Element} The stack. |
| 16 |
*/ |
| 17 |
export function Stack( { children, ...props } ) { |
| 18 |
return ( |
| 19 |
<Flex |
| 20 |
direction="column" |
| 21 |
gap={ 4 } |
| 22 |
align="stretch" |
| 23 |
justify="flex-start" |
| 24 |
{ ...props } |
| 25 |
> |
| 26 |
{ children } |
| 27 |
</Flex> |
| 28 |
); |
| 29 |
} |
| 30 |
|
| 31 |
export default Stack; |
| 32 |
|