@@ -4,6 +4,22 @@ import { createUseStyles } from "react-jss";
44
55type FlexAlignType = "center" | "space-between" | "start" ;
66
7+ export type ContainerProps = {
8+ backgroundColor ?: string ,
9+ border ?: string ,
10+ borderBottom ?: string ,
11+ borderLeft ?: string ,
12+ borderRight ?: string ,
13+ boderTop ?: string ,
14+ height ?: string ,
15+ padding ?: string ,
16+ paddingBottom ?: string ,
17+ paddingLeft ?: string ,
18+ paddingRight ?: string ,
19+ paddingTop ?: string ,
20+ width ?: string ,
21+ } ;
22+
723export type LayoutProps = {
824 height ?: string ,
925 width ?: string ,
@@ -12,26 +28,24 @@ export type LayoutProps = {
1228type RowType = {
1329 justifyContent : FlexAlignType ,
1430 alignItems : FlexAlignType ,
15- backgroundColor ?: string ,
31+ container ?: ContainerProps ,
1632 children ?: React . Node ,
1733 className ?: string ,
1834} ;
1935
2036export function Row ( {
2137 alignItems,
2238 justifyContent,
23- backgroundColor ,
39+ container ,
2440 children,
2541 className,
26- height,
27- width,
2842} : RowType & LayoutProps ) : React . Node {
29- const classes = useRowStyles ( { alignItems, backgroundColor , justifyContent } ) ;
30- const layoutClasses = useLayoutStyles ( { height , width } ) ;
43+ const classes = useRowStyles ( { alignItems, justifyContent } ) ;
44+ const containerClasses = useContainerStyles ( container || { } ) ;
3145
3246 return (
3347 < div
34- className = { [ classes . row , layoutClasses . layout , className ]
48+ className = { [ classes . row , containerClasses . container , className ]
3549 . join ( " " )
3650 . trim ( ) }
3751 >
@@ -52,8 +66,6 @@ const useRowStyles = createUseStyles({
5266 alignItems : ( { alignItems } : { alignItems : FlexAlignType } ) => alignItems ,
5367 justifyContent : ( { justifyContent } : { justifyContent : FlexAlignType } ) =>
5468 justifyContent ,
55- backgroundColor : ( { backgroundColor } : { backgroundColor : string } ) =>
56- backgroundColor ,
5769 } ,
5870} ) ;
5971
@@ -65,3 +77,25 @@ export const useLayoutStyles: (LayoutProps) => {
6577 width : ( { width } ) => width ,
6678 } ,
6779} ) ;
80+
81+ export const useContainerStyles : (
82+ container : ContainerProps
83+ ) => {
84+ container : string ,
85+ } = createUseStyles ( {
86+ container : {
87+ backgroundColor : ( container ) => container . backgroundColor ,
88+ border : ( container ) => container . border ,
89+ borderBottom : ( container ) => container . borderBottom ,
90+ borderLeft : ( container ) => container . borderLeft ,
91+ borderRight : ( container ) => container . borderRight ,
92+ borderTop : ( container ) => container . borderTop ,
93+ height : ( container ) => container . height ,
94+ padding : ( container ) => container . padding ,
95+ paddingBottom : ( container ) => container . paddingBottom ,
96+ paddingLeft : ( container ) => container . paddingLeft ,
97+ paddingRight : ( container ) => container . paddingRight ,
98+ paddingTop : ( container ) => container . paddingTop ,
99+ width : ( container ) => container . width ,
100+ } ,
101+ } ) ;
0 commit comments