Skip to content

Commit 74040b7

Browse files
Add stories for responsive props in Flex and Grid (adobe#2014)
Co-authored-by: Robert Snow <[email protected]>
1 parent 64e41c5 commit 74040b7

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

packages/@react-spectrum/layout/stories/Flex.stories.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,14 @@ storiesOf('Flex', module)
159159
<View backgroundColor="magenta-600" order={1} width="size-800" height="size-800" />
160160
</Flex>
161161
)
162+
)
163+
.add(
164+
'responsive',
165+
() => (
166+
<Flex direction={{base: 'column', L: 'row'}} gap={{base: 'size-100', M: 'size-250', L: 'size-350'}}>
167+
<View backgroundColor="celery-600" width="size-800" height="size-800" />
168+
<View backgroundColor="blue-600" width="size-800" height="size-800" />
169+
<View backgroundColor="magenta-600" width="size-800" height="size-800" />
170+
</Flex>
171+
)
162172
);

packages/@react-spectrum/layout/stories/Grid.stories.tsx

+15
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,21 @@ storiesOf('Grid', module)
5959
)}
6060
</Grid>
6161
)
62+
)
63+
.add(
64+
'responsive',
65+
() => (
66+
<Grid
67+
columns={{base: repeat('auto-fit', 'size-800'), M: repeat('auto-fit', 'size-1200'), L: repeat('auto-fit', 'size-2000')}}
68+
autoRows={{base: 'size-800', M: 'size-1200', L: 'size-2000'}}
69+
justifyContent="center"
70+
width="80%"
71+
gap={{base: 'size-100', M: 'size-250', L: 'size-350'}}>
72+
{colors.map(color =>
73+
<View key={color} backgroundColor={color} />
74+
)}
75+
</Grid>
76+
)
6277
);
6378

6479
// function render(props: GridProps) {

0 commit comments

Comments
 (0)