-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add wrap property to Container component (#4548)
Add ability to control flex-wrap property of container so it's flexbox support is more complete.
- Loading branch information
Showing
5 changed files
with
91 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@toptal/picasso-container': minor | ||
--- | ||
|
||
- add wrap property to control flex-wrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
packages/base/Container/src/Container/story/Wrap.example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import React from 'react' | ||
import { Container, Grid, Typography } from '@toptal/picasso' | ||
|
||
const LargeContent = () => { | ||
return ( | ||
<> | ||
<Container variant='red' padded='xlarge'> | ||
1 | ||
</Container> | ||
<Container variant='red' padded='xlarge'> | ||
2 | ||
</Container> | ||
<Container variant='red' padded='xlarge'> | ||
3 | ||
</Container> | ||
<Container variant='red' padded='xlarge'> | ||
4 | ||
</Container> | ||
<Container variant='red' padded='xlarge'> | ||
5 | ||
</Container> | ||
<Container variant='red' padded='xlarge'> | ||
6 | ||
</Container> | ||
<Container variant='red' padded='xlarge'> | ||
7 | ||
</Container> | ||
</> | ||
) | ||
} | ||
|
||
const Example = () => ( | ||
<Grid> | ||
<Grid.Item sm={6} style={{ overflow: 'hidden' }}> | ||
<Typography variant='heading' size='medium'> | ||
Default (nowrap) | ||
</Typography> | ||
|
||
<Container top='small' flex gap='xlarge'> | ||
<LargeContent /> | ||
</Container> | ||
</Grid.Item> | ||
<Grid.Item sm={6} style={{ overflow: 'hidden' }}> | ||
<Typography variant='heading' size='medium'> | ||
Explicit nowrap | ||
</Typography> | ||
|
||
<Container top='small' flex gap='xlarge' wrap='nowrap'> | ||
<LargeContent /> | ||
</Container> | ||
</Grid.Item> | ||
<Grid.Item sm={6}> | ||
<Typography variant='heading' size='medium'> | ||
Wrap | ||
</Typography> | ||
<Container top='small' flex gap='xlarge' wrap='wrap'> | ||
<LargeContent /> | ||
</Container> | ||
</Grid.Item> | ||
<Grid.Item sm={6}> | ||
<Typography variant='heading' size='medium'> | ||
Wrap (reverse) | ||
</Typography> | ||
|
||
<Container top='small' flex gap='xlarge' wrap='wrap-reverse'> | ||
<LargeContent /> | ||
</Container> | ||
</Grid.Item> | ||
</Grid> | ||
) | ||
|
||
export default Example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters