@@ -24,7 +24,11 @@ interface TypographySelectorProps {
2424 onChange : ( value : any ) => void ;
2525}
2626
27- function TypographySelector ( { title, value, onChange } : TypographySelectorProps ) {
27+ function TypographySelector ( {
28+ title,
29+ value,
30+ onChange,
31+ } : TypographySelectorProps ) {
2832 const renderDemo = ( ) => {
2933 return (
3034 < div className = "space-y-2 flex flex-col" >
@@ -37,7 +41,7 @@ function TypographySelector({ title, value, onChange }: TypographySelectorProps)
3741 value ?. lineHeight || "" ,
3842 value ?. letterSpacing || "" ,
3943 value ?. textAlign || "" ,
40- value ?. textTransform || "normal-case"
44+ value ?. textTransform || "normal-case" ,
4145 ) }
4246 >
4347 The quick brown fox jumps over the lazy dog
@@ -64,33 +68,35 @@ function TypographySelector({ title, value, onChange }: TypographySelectorProps)
6468 < SelectValue placeholder = "Select font family" />
6569 </ SelectTrigger >
6670 < SelectContent >
67- { Object . entries ( fontFamilyOptions ) . map ( ( [ category , fonts ] , index ) => (
68- < React . Fragment key = { category } >
69- { index > 0 && < div className = "h-5" /> }
70- < SelectItem
71- value = { `category-${ category . toLowerCase ( ) } ` }
72- disabled
73- className = "text-xs font-semibold text-muted-foreground uppercase tracking-wider py-2"
74- >
75- { category }
76- </ SelectItem >
77- { fonts . map ( ( font ) => (
71+ { Object . entries ( fontFamilyOptions ) . map (
72+ ( [ category , fonts ] , index ) => (
73+ < React . Fragment key = { category } >
74+ { index > 0 && < div className = "h-5" /> }
7875 < SelectItem
79- key = { font . value }
80- value = { font . value }
81- className = { cn (
82- "pl-8 text-sm min-h-[2rem] flex items-center" ,
83- font . value
84- ) }
85- style = { {
86- paddingLeft : '2rem' ,
87- } }
76+ value = { `category-${ category . toLowerCase ( ) } ` }
77+ disabled
78+ className = "text-xs font-semibold text-muted-foreground uppercase tracking-wider py-2"
8879 >
89- { font . label }
80+ { category }
9081 </ SelectItem >
91- ) ) }
92- </ React . Fragment >
93- ) ) }
82+ { fonts . map ( ( font ) => (
83+ < SelectItem
84+ key = { font . value }
85+ value = { font . value }
86+ className = { cn (
87+ "pl-8 text-sm min-h-[2rem] flex items-center" ,
88+ font . value ,
89+ ) }
90+ style = { {
91+ paddingLeft : "2rem" ,
92+ } }
93+ >
94+ { font . label }
95+ </ SelectItem >
96+ ) ) }
97+ </ React . Fragment >
98+ ) ,
99+ ) }
94100 </ SelectContent >
95101 </ Select >
96102 </ div >
@@ -111,7 +117,10 @@ function TypographySelector({ title, value, onChange }: TypographySelectorProps)
111117 </ SelectTrigger >
112118 < SelectContent >
113119 { fontSizeOptions . map ( ( option ) => (
114- < SelectItem key = { option . value } value = { option . value } >
120+ < SelectItem
121+ key = { option . value }
122+ value = { option . value }
123+ >
115124 { option . label }
116125 </ SelectItem >
117126 ) ) }
@@ -134,7 +143,10 @@ function TypographySelector({ title, value, onChange }: TypographySelectorProps)
134143 </ SelectTrigger >
135144 < SelectContent >
136145 { fontWeightOptions . map ( ( option ) => (
137- < SelectItem key = { option . value } value = { option . value } >
146+ < SelectItem
147+ key = { option . value }
148+ value = { option . value }
149+ >
138150 { option . label }
139151 </ SelectItem >
140152 ) ) }
@@ -159,7 +171,10 @@ function TypographySelector({ title, value, onChange }: TypographySelectorProps)
159171 </ SelectTrigger >
160172 < SelectContent >
161173 { lineHeightOptions . map ( ( option ) => (
162- < SelectItem key = { option . value } value = { option . value } >
174+ < SelectItem
175+ key = { option . value }
176+ value = { option . value }
177+ >
163178 { option . label }
164179 </ SelectItem >
165180 ) ) }
@@ -182,7 +197,10 @@ function TypographySelector({ title, value, onChange }: TypographySelectorProps)
182197 </ SelectTrigger >
183198 < SelectContent >
184199 { letterSpacingOptions . map ( ( option ) => (
185- < SelectItem key = { option . value } value = { option . value } >
200+ < SelectItem
201+ key = { option . value }
202+ value = { option . value }
203+ >
186204 { option . label }
187205 </ SelectItem >
188206 ) ) }
@@ -207,7 +225,10 @@ function TypographySelector({ title, value, onChange }: TypographySelectorProps)
207225 </ SelectTrigger >
208226 < SelectContent >
209227 { textAlignOptions . map ( ( option ) => (
210- < SelectItem key = { option . value } value = { option . value } >
228+ < SelectItem
229+ key = { option . value }
230+ value = { option . value }
231+ >
211232 { option . label }
212233 </ SelectItem >
213234 ) ) }
@@ -230,7 +251,10 @@ function TypographySelector({ title, value, onChange }: TypographySelectorProps)
230251 </ SelectTrigger >
231252 < SelectContent >
232253 { textTransformOptions . map ( ( option ) => (
233- < SelectItem key = { option . value } value = { option . value } >
254+ < SelectItem
255+ key = { option . value }
256+ value = { option . value }
257+ >
234258 { option . label }
235259 </ SelectItem >
236260 ) ) }
@@ -247,9 +271,7 @@ function TypographySelector({ title, value, onChange }: TypographySelectorProps)
247271 < div className = "border rounded-lg p-2 h-[100px] overflow-auto" >
248272 { renderDemo ( ) }
249273 </ div >
250- < div className = "space-y-6" >
251- { renderConfig ( ) }
252- </ div >
274+ < div className = "space-y-6" > { renderConfig ( ) } </ div >
253275 </ div >
254276 ) ;
255277}
0 commit comments