@@ -4,51 +4,71 @@ import { Button } from '@onlook/ui/button';
4
4
import { Icons } from '@onlook/ui/icons' ;
5
5
import { Popover , PopoverContent , PopoverTrigger } from '@onlook/ui/popover' ;
6
6
import React , { useCallback , useEffect , useRef , useState } from 'react' ;
7
- import { Border } from '.. /dropdowns/border' ;
8
- import { ColorBackground } from '.. /dropdowns/color-background' ;
9
- import { Display } from '.. /dropdowns/display' ;
10
- import { Height } from '.. /dropdowns/height' ;
11
- import { Margin } from '.. /dropdowns/margin' ;
12
- import { Opacity } from '.. /dropdowns/opacity' ;
13
- import { Padding } from '.. /dropdowns/padding' ;
14
- import { Radius } from '.. /dropdowns/radius' ;
15
- import { Width } from '.. /dropdowns/width' ;
16
- import { useTextControl } from '.. /hooks/use-text-control' ;
17
- import { ViewButtons } from '.. /panels/panel-bar/bar' ;
18
- import { InputSeparator } from '.. /separator' ;
19
- import { AdvancedTypography } from './advanced-typography' ;
20
- import { FontFamilySelector } from './font-family' ;
21
- import { FontSizeSelector } from './font-size' ;
22
- import { FontWeightSelector } from './font-weight' ;
23
- import { TextAlignSelector } from './text-align' ;
24
- import { TextColor } from './text-color' ;
7
+ import { Border } from './dropdowns/border' ;
8
+ import { ColorBackground } from './dropdowns/color-background' ;
9
+ import { Display } from './dropdowns/display' ;
10
+ import { Height } from './dropdowns/height' ;
11
+ import { Margin } from './dropdowns/margin' ;
12
+ import { Opacity } from './dropdowns/opacity' ;
13
+ import { Padding } from './dropdowns/padding' ;
14
+ import { Radius } from './dropdowns/radius' ;
15
+ import { Width } from './dropdowns/width' ;
16
+ import { useTextControl } from './hooks/use-text-control' ;
17
+ import { ViewButtons } from './panels/panel-bar/bar' ;
18
+ import { InputSeparator } from './separator' ;
19
+ import { AdvancedTypography } from './text-inputs/ advanced-typography' ;
20
+ import { FontFamilySelector } from './text-inputs/ font-family' ;
21
+ import { FontSizeSelector } from './text-inputs/ font-size' ;
22
+ import { FontWeightSelector } from './text-inputs/ font-weight' ;
23
+ import { TextAlignSelector } from './text-inputs/text- align' ;
24
+ import { TextColor } from './text-inputs/text- color' ;
25
25
26
26
// Group definitions for the text-selected toolbar
27
27
export const TEXT_SELECTED_GROUPS = [
28
28
{
29
29
key : 'typography' ,
30
30
label : 'Typography' ,
31
- components : [ 'FontFamily' , 'FontWeight' , 'FontSize' , 'TextColor' , 'TextAlign' , 'AdvancedTypography' ] ,
31
+ components : [
32
+ < FontFamilySelector fontFamily = "Arial" /> ,
33
+ < FontWeightSelector fontWeight = "normal" handleFontWeightChange = { ( ) => { } } /> ,
34
+ < FontSizeSelector fontSize = { 16 } handleFontSizeChange = { ( ) => { } } /> ,
35
+ < TextColor handleTextColorChange = { ( ) => { } } textColor = "black" /> ,
36
+ < TextAlignSelector textAlign = "left" handleTextAlignChange = { ( ) => { } } /> ,
37
+ < AdvancedTypography /> ,
38
+ ] ,
32
39
} ,
33
40
{
34
41
key : 'dimensions' ,
35
42
label : 'Dimensions' ,
36
- components : [ 'Width' , 'Height' ] ,
43
+ components : [
44
+ < Width /> ,
45
+ < Height /> ,
46
+ ] ,
37
47
} ,
38
48
{
39
49
key : 'base' ,
40
50
label : 'Base' ,
41
- components : [ 'ColorBackground' , 'Border' , 'Radius' ] ,
51
+ components : [
52
+ < ColorBackground /> ,
53
+ < Border /> ,
54
+ < Radius /> ,
55
+ ] ,
42
56
} ,
43
57
{
44
58
key : 'layout' ,
45
59
label : 'Layout' ,
46
- components : [ 'Display' , 'Padding' , 'Margin' ] ,
60
+ components : [
61
+ < Display /> ,
62
+ < Padding /> ,
63
+ < Margin /> ,
64
+ ] ,
47
65
} ,
48
66
{
49
67
key : 'opacity' ,
50
68
label : 'Opacity' ,
51
- components : [ 'Opacity' ] ,
69
+ components : [
70
+ < Opacity /> ,
71
+ ] ,
52
72
} ,
53
73
] ;
54
74
@@ -175,10 +195,11 @@ export const TextSelected = ({ availableWidth = 0 }: { availableWidth?: number }
175
195
className = "flex items-center justify-center gap-0.5"
176
196
ref = { el => { groupRefs . current [ groupIdx ] = el ; } }
177
197
>
178
- { group . components . map ( ( compKey , idx ) => {
179
- const Comp = COMPONENT_MAP [ compKey ] ;
180
- return Comp ? < Comp key = { compKey + idx } /> : null ;
181
- } ) }
198
+ { group . components . map ( ( comp , idx ) => (
199
+ < React . Fragment key = { idx } >
200
+ { comp }
201
+ </ React . Fragment >
202
+ ) ) }
182
203
</ div >
183
204
) ) }
184
205
</ div >
@@ -188,10 +209,11 @@ export const TextSelected = ({ availableWidth = 0 }: { availableWidth?: number }
188
209
< React . Fragment key = { group . key } >
189
210
{ groupIdx > 0 && < InputSeparator /> }
190
211
< div className = "flex items-center justify-center gap-0.5" >
191
- { group . components . map ( ( compKey , idx ) => {
192
- const Comp = COMPONENT_MAP [ compKey ] ;
193
- return Comp ? < Comp key = { compKey + idx } /> : null ;
194
- } ) }
212
+ { group . components . map ( ( comp , idx ) => (
213
+ < React . Fragment key = { idx } >
214
+ { comp }
215
+ </ React . Fragment >
216
+ ) ) }
195
217
</ div >
196
218
</ React . Fragment >
197
219
) : null
@@ -214,10 +236,11 @@ export const TextSelected = ({ availableWidth = 0 }: { availableWidth?: number }
214
236
< React . Fragment key = { group . key } >
215
237
{ groupIdx > 0 && < InputSeparator /> }
216
238
< div className = "flex items-center gap-0.5" >
217
- { group . components . map ( ( compKey , idx ) => {
218
- const Comp = COMPONENT_MAP [ compKey ] ;
219
- return Comp ? < Comp key = { compKey + idx } /> : null ;
220
- } ) }
239
+ { group . components . map ( ( comp , idx ) => (
240
+ < React . Fragment key = { idx } >
241
+ { comp }
242
+ </ React . Fragment >
243
+ ) ) }
221
244
</ div >
222
245
</ React . Fragment >
223
246
) ) }
0 commit comments