8
8
DropdownMenuItem ,
9
9
DropdownMenuTrigger ,
10
10
} from "@onlook/ui-v4/dropdown-menu" ;
11
- import { StateDropdown } from "./state-dropdown" ;
11
+ import { StateDropdown } from "./dropdowns/ state-dropdown" ;
12
12
import { InputDropdown } from "./inputs/input-dropdown" ;
13
13
import { InputIcon } from "./inputs/input-icon" ;
14
14
import { InputRange } from "./inputs/input-range" ;
@@ -18,6 +18,11 @@ import { Padding } from "./dropdowns/padding";
18
18
import { Margin } from "./dropdowns/margin" ;
19
19
import { Radius } from "./dropdowns/radius" ;
20
20
import { useState } from "react" ;
21
+ import { ImageBackground } from "./dropdowns/img-background" ;
22
+ import { ColorBackground } from "./dropdowns/color-background" ;
23
+ import { Border } from "./dropdowns/border" ;
24
+ import { Display } from "./dropdowns/display" ;
25
+ import { ViewButtons } from "./panels/panel-bar/bar" ;
21
26
22
27
export const DivSelected = ( ) => {
23
28
const [ activeTab , setActiveTab ] = useState ( 'individual' ) ;
@@ -28,89 +33,7 @@ export const DivSelected = () => {
28
33
29
34
< div className = "h-6 w-[1px] bg-border" />
30
35
31
- < DropdownMenu >
32
- < DropdownMenuTrigger asChild >
33
- < Button
34
- variant = "ghost"
35
- className = "flex items-center gap-2 text-muted-foreground border border-border/0 cursor-pointer rounded-lg hover:bg-background-tertiary/20 hover:text-white hover:border hover:border-border data-[state=open]:bg-background-tertiary/20 data-[state=open]:text-white data-[state=open]:border data-[state=open]:border-border px-3 focus-visible:ring-0 focus-visible:ring-offset-0 focus:outline-none focus-visible:outline-none active:border-0"
36
- >
37
- < Icons . Layout className = "h-4 w-4 min-h-4 min-w-4" />
38
- < span className = "text-sm" > Flex</ span >
39
- </ Button >
40
- </ DropdownMenuTrigger >
41
- < DropdownMenuContent align = "start" className = "min-w-[120px] mt-2 p-1 rounded-lg" >
42
- < div className = "p-2 space-y-2" >
43
- < div className = "space-y-1" >
44
- < span className = "text-sm text-muted-foreground" > Type</ span >
45
- < div className = "flex gap-1" >
46
- < button className = "flex-1 text-sm px-3 py-1 rounded-md text-muted-foreground hover:bg-background-tertiary/10" > --</ button >
47
- < button className = "flex-1 text-sm px-3 py-1 rounded-md bg-background-tertiary/20 text-white" > Flex</ button >
48
- < button className = "flex-1 text-sm px-3 py-1 rounded-md text-muted-foreground hover:bg-background-tertiary/10" > Grid</ button >
49
- </ div >
50
- </ div >
51
-
52
- < div className = "space-y-1" >
53
- < span className = "text-sm text-muted-foreground" > Direction</ span >
54
- < div className = "flex gap-1" >
55
- < button className = "flex-1 flex items-center justify-center text-sm p-1.5 rounded-md text-muted-foreground hover:bg-background-tertiary/10" >
56
- < Icons . ArrowDown className = "h-4 w-4" />
57
- </ button >
58
- < button className = "flex-1 flex items-center justify-center text-sm p-1.5 rounded-md bg-background-tertiary/20 text-white" >
59
- < Icons . ArrowRight className = "h-4 w-4" />
60
- </ button >
61
- </ div >
62
- </ div >
63
-
64
- < div className = "space-y-1" >
65
- < span className = "text-sm text-muted-foreground" > Vertical</ span >
66
- < div className = "flex gap-1" >
67
- < button className = "flex-1 flex items-center justify-center text-sm p-1.5 rounded-md text-muted-foreground hover:bg-background-tertiary/10" >
68
- < Icons . AlignTop className = "h-4 w-4" />
69
- </ button >
70
- < button className = "flex-1 flex items-center justify-center text-sm p-1.5 rounded-md bg-background-tertiary/20 text-white" >
71
- < Icons . AlignCenterVertically className = "h-4 w-4" />
72
- </ button >
73
- < button className = "flex-1 flex items-center justify-center text-sm p-1.5 rounded-md text-muted-foreground hover:bg-background-tertiary/10" >
74
- < Icons . AlignBottom className = "h-4 w-4" />
75
- </ button >
76
- < button className = "flex-1 flex items-center justify-center text-sm p-1.5 rounded-md text-muted-foreground hover:bg-background-tertiary/10" >
77
- < Icons . SpaceBetweenVertically className = "h-4 w-4" />
78
- </ button >
79
- </ div >
80
- </ div >
81
-
82
- < div className = "space-y-1" >
83
- < span className = "text-sm text-muted-foreground" > Horizontal</ span >
84
- < div className = "flex gap-1" >
85
- < button className = "flex-1 flex items-center justify-center text-sm p-1.5 rounded-md text-muted-foreground hover:bg-background-tertiary/10" >
86
- < Icons . AlignLeft className = "h-4 w-4" />
87
- </ button >
88
- < button className = "flex-1 flex items-center justify-center text-sm p-1.5 rounded-md bg-background-tertiary/20 text-white" >
89
- < Icons . AlignCenterHorizontally className = "h-4 w-4" />
90
- </ button >
91
- < button className = "flex-1 flex items-center justify-center text-sm p-1.5 rounded-md text-muted-foreground hover:bg-background-tertiary/10" >
92
- < Icons . AlignRight className = "h-4 w-4" />
93
- </ button >
94
- < button className = "flex-1 flex items-center justify-center text-sm p-1.5 rounded-md text-muted-foreground hover:bg-background-tertiary/10" >
95
- < Icons . SpaceBetweenHorizontally className = "h-4 w-4" />
96
- </ button >
97
- </ div >
98
- </ div >
99
-
100
- < div className = "space-y-1" >
101
- < span className = "text-sm text-muted-foreground" > Gap</ span >
102
- < div className = "flex items-center bg-background-tertiary/50 rounded-md px-3 py-1.5" >
103
- < input
104
- type = "text"
105
- value = "12"
106
- className = "w-full bg-transparent text-sm text-white focus:outline-none"
107
- />
108
- < span className = "text-sm text-muted-foreground" > PX</ span >
109
- </ div >
110
- </ div >
111
- </ div >
112
- </ DropdownMenuContent >
113
- </ DropdownMenu >
36
+ < Display />
114
37
115
38
< div className = "h-6 w-[1px] bg-border" />
116
39
@@ -134,71 +57,17 @@ export const DivSelected = () => {
134
57
135
58
< div className = "h-6 w-[1px] bg-border" />
136
59
137
- < DropdownMenu >
138
- < DropdownMenuTrigger asChild >
139
- < Button
140
- variant = "ghost"
141
- className = "flex items-center gap-2 text-muted-foreground border border-border/0 cursor-pointer rounded-lg hover:bg-background-tertiary/20 hover:text-white hover:border hover:border-border px-3"
142
- >
143
- < Icons . BorderEdit className = "h-4 w-4 min-h-4 min-w-4" />
144
- < span className = "text-sm" > 1px</ span >
145
- </ Button >
146
- </ DropdownMenuTrigger >
147
- < DropdownMenuContent align = "start" className = "w-[280px] mt-1 p-3 rounded-lg" >
148
- < div className = "flex items-center gap-2 mb-3" >
149
- < button
150
- onClick = { ( ) => setActiveTab ( 'all' ) }
151
- className = { `flex-1 text-sm px-4 py-1.5 rounded-md transition-colors cursor-pointer ${
152
- activeTab === 'all'
153
- ? 'text-white bg-background-tertiary/20'
154
- : 'text-muted-foreground hover:bg-background-tertiary/10'
155
- } `}
156
- >
157
- All sides
158
- </ button >
159
- < button
160
- onClick = { ( ) => setActiveTab ( 'individual' ) }
161
- className = { `flex-1 text-sm px-4 py-1.5 rounded-md transition-colors cursor-pointer ${
162
- activeTab === 'individual'
163
- ? 'text-white bg-background-tertiary/20'
164
- : 'text-muted-foreground hover:bg-background-tertiary/10'
165
- } `}
166
- >
167
- Individual
168
- </ button >
169
- </ div >
170
- { activeTab === 'all' ? (
171
- < InputRange value = { 12 } onChange = { ( value ) => console . log ( value ) } />
172
- ) : (
173
- < div className = "grid grid-cols-2 gap-2" >
174
- < InputIcon icon = "LeftSide" value = { 12 } />
175
- < InputIcon icon = "TopSide" value = { 18 } />
176
- < InputIcon icon = "RightSide" value = { 12 } />
177
- < InputIcon icon = "BottomSide" value = { 18 } />
178
- </ div >
179
- ) }
180
- < div className = "mt-3" >
181
- < div className = "flex items-center w-full" >
182
- < div className = "flex-1 flex mr-[1px] items-center bg-background-tertiary/50 rounded-md px-3 py-1.5" >
183
- < input
184
- type = "text"
185
- value = "#080808"
186
- className = "w-full bg-transparent text-sm text-white focus:outline-none"
187
- />
188
- </ div >
189
- < div className = "min-w-[70px] max-w-[70px] flex items-center bg-background-tertiary/50 rounded-md px-3 py-1.5" >
190
- < input
191
- type = "text"
192
- value = "100"
193
- className = "w-full bg-transparent text-sm text-white focus:outline-none text-right"
194
- />
195
- < span className = "text-sm text-muted-foreground ml-1" > %</ span >
196
- </ div >
197
- </ div >
198
- </ div >
199
- </ DropdownMenuContent >
200
- </ DropdownMenu >
60
+ < Border />
201
61
62
+ < div className = "h-6 w-[1px] bg-border" />
63
+
64
+ < ColorBackground />
65
+
66
+ < div className = "h-6 w-[1px] bg-border" />
67
+
68
+ < ImageBackground />
69
+
70
+ < ViewButtons />
202
71
</ div >
203
72
) ;
204
73
} ;
0 commit comments