@@ -514,6 +514,103 @@ export const CompleteApplicationShell: Story = {
514514 } ,
515515} ;
516516
517+ export const FlexSubComponent : Story = {
518+ render : ( ) => (
519+ < Layout height = "300px" >
520+ < Layout . Header title = "Layout.Flex Example" />
521+ < Layout . Flex
522+ flow = "row"
523+ gap = "1x"
524+ placeItems = "center"
525+ placeContent = "center"
526+ >
527+ < Card width = "100px" height = "80px" >
528+ Item 1
529+ </ Card >
530+ < Card width = "100px" height = "80px" >
531+ Item 2
532+ </ Card >
533+ < Card width = "100px" height = "80px" >
534+ Item 3
535+ </ Card >
536+ </ Layout . Flex >
537+ </ Layout >
538+ ) ,
539+ } ;
540+
541+ export const FlexWithScrolling : Story = {
542+ render : ( ) => (
543+ < Layout height = "200px" >
544+ < Layout . Header title = "Scrollable Flex Container" />
545+ < Layout . Flex flow = "row" gap = "1x" placeItems = "start" >
546+ { Array . from ( { length : 20 } , ( _ , i ) => (
547+ < Card key = { i } width = "100px" height = "100px" flexShrink = { 0 } >
548+ Item { i + 1 }
549+ </ Card >
550+ ) ) }
551+ </ Layout . Flex >
552+ </ Layout >
553+ ) ,
554+ } ;
555+
556+ export const GridSubComponent : Story = {
557+ render : ( ) => (
558+ < Layout height = "400px" >
559+ < Layout . Header title = "Layout.Grid Example" />
560+ < Layout . Grid
561+ columns = "repeat(3, 1fr)"
562+ rows = "repeat(2, 1fr)"
563+ gap = "1x"
564+ flexGrow = { 1 }
565+ >
566+ < Card > Cell 1</ Card >
567+ < Card > Cell 2</ Card >
568+ < Card > Cell 3</ Card >
569+ < Card > Cell 4</ Card >
570+ < Card > Cell 5</ Card >
571+ < Card > Cell 6</ Card >
572+ </ Layout . Grid >
573+ </ Layout >
574+ ) ,
575+ } ;
576+
577+ export const GridWithTemplate : Story = {
578+ render : ( ) => (
579+ < Layout height = "400px" >
580+ < Layout . Header title = "Grid with Template" />
581+ < Layout . Grid
582+ template = { `
583+ "header header header" auto
584+ "sidebar main main" 1fr
585+ "footer footer footer" auto
586+ / 200px 1fr 1fr
587+ ` }
588+ gap = "1x"
589+ >
590+ < Card gridArea = "header" > Header</ Card >
591+ < Card gridArea = "sidebar" > Sidebar</ Card >
592+ < Card gridArea = "main" > Main Content</ Card >
593+ < Card gridArea = "footer" > Footer</ Card >
594+ </ Layout . Grid >
595+ </ Layout >
596+ ) ,
597+ } ;
598+
599+ export const GridWithScrolling : Story = {
600+ render : ( ) => (
601+ < Layout height = "300px" >
602+ < Layout . Header title = "Scrollable Grid" />
603+ < Layout . Grid gap = "1x" >
604+ { Array . from ( { length : 16 } , ( _ , i ) => (
605+ < Card key = { i } width = "100px" height = "80px" whiteSpace = "nowrap" >
606+ Card { i + 1 }
607+ </ Card >
608+ ) ) }
609+ </ Layout . Grid >
610+ </ Layout >
611+ ) ,
612+ } ;
613+
517614/**
518615 * Layout automatically applies height: 100% when it detects it has collapsed
519616 * to 0 height. This happens when the Layout is placed in a container without
0 commit comments