1+ declare const twJustifyContentValues : readonly [ "justify-start" , "justify-end" , "justify-center" , "justify-between" , "justify-around" , "justify-evenly" ] ;
2+ declare type JustifyContent = typeof twJustifyContentValues [ number ] ;
3+ declare const twAlignItemsValues : readonly [ "items-start" , "items-end" , "items-center" , "items-baseline" , "items-stretch" ] ;
4+ declare type AlignItems = typeof twAlignItemsValues [ number ] ;
5+ declare const twFlexDirectionValues : readonly [ "row" , "column" ] ;
6+ declare type FlexDirection = typeof twFlexDirectionValues [ number ] ;
7+
8+ type GradingFlexProps = {
9+ justifyContent ?: JustifyContent ;
10+ alignItems ?: AlignItems ;
11+ flexDirection ?: FlexDirection ;
12+ children ?: React . ReactNode ;
13+ style ?: React . CSSProperties ;
14+ className ?: string ;
15+ } & React . RefAttributes < HTMLDivElement > ;
16+
17+ const GradingFlex : React . FC < GradingFlexProps > = ( { justifyContent, alignItems, flexDirection, children, style, className, } : GradingFlexProps ) => {
18+ const defaultStyle : React . CSSProperties = {
19+ display : "flex" ,
20+ justifyContent :
21+ ( justifyContent === "justify-start"
22+ ? "flex-start"
23+ : justifyContent === "justify-end"
24+ ? "flex-end"
25+ : justifyContent === "justify-center"
26+ ? "center"
27+ : justifyContent === "justify-between"
28+ ? "space-between"
29+ : justifyContent === "justify-around"
30+ ? "space-around"
31+ : justifyContent === "justify-evenly"
32+ ? "space-evenly"
33+ : ""
34+ ) ,
35+ alignItems :
36+ ( alignItems === "items-start"
37+ ? "start"
38+ : alignItems === "items-end"
39+ ? "end"
40+ : alignItems === "items-center"
41+ ? "center"
42+ : alignItems === "items-baseline"
43+ ? "baseline"
44+ : ""
45+ ) ,
46+ flexDirection : flexDirection ,
47+ } ;
48+
49+ return (
50+ < div className = { className } style = { { ...defaultStyle , ...style } } >
51+ { children }
52+ </ div >
53+ ) ;
54+ }
55+
56+ export default GradingFlex ;
0 commit comments