File tree Expand file tree Collapse file tree 2 files changed +28
-41
lines changed
packages/ui/src/elements/Collapsible Expand file tree Collapse file tree 2 files changed +28
-41
lines changed Original file line number Diff line number Diff line change 19
19
border-top-left-radius : $style-radius-m ;
20
20
width : 100% ;
21
21
22
- & > * {
23
- z-index : 1 ;
22
+ & :hover {
23
+ background : var ( --theme-elevation-100 ) ;
24
24
}
25
25
26
26
& :has (.collapsible__drag ) {
31
31
& __drag {
32
32
display : flex ;
33
33
opacity : 0.5 ;
34
- z-index : 2 ;
35
34
top : var (--toggle-pad-v );
36
35
width : base (1.2 );
37
36
height : base (1.2 );
56
55
position : absolute ;
57
56
top : 0 ;
58
57
left : 0 ;
59
- z-index : 1 ;
60
58
61
59
span {
62
60
user-select : none ;
74
72
color : var (--theme-text );
75
73
}
76
74
}
77
- & .collapsible--hovered {
78
- > .collapsible__toggle-wrap .collapsible__toggle {
79
- background : var (--theme-elevation-100 );
75
+ }
76
+
77
+ & --style-error {
78
+ border : 1px solid var (--theme-error-400 );
79
+ > .collapsible__toggle-wrap {
80
+ background-color : var (--theme-error-100 );
81
+
82
+ & :hover {
83
+ background : var (--theme-error-150 );
84
+ }
85
+
86
+ .row-label {
87
+ color : var (--theme-error-950 );
80
88
}
81
89
}
82
90
}
147
155
padding : var (--gutter-h );
148
156
}
149
157
}
150
-
151
- & --style-error {
152
- border : 1px solid var (--theme-error-400 );
153
- & :hover {
154
- border : 1px solid var (--theme-error-500 );
155
- }
156
-
157
- > .collapsible__toggle-wrap {
158
- .row-label {
159
- color : var (--theme-error-950 );
160
- }
161
- .collapsible__toggle {
162
- background : var (--theme-error-100 );
163
- }
164
- }
165
- & .collapsible--hovered {
166
- > .collapsible__toggle-wrap .collapsible__toggle {
167
- background : var (--theme-error-150 );
168
- }
169
- }
170
- }
171
158
}
Original file line number Diff line number Diff line change @@ -72,15 +72,6 @@ export const Collapsible: React.FC<Props> = ({
72
72
onMouseEnter = { ( ) => setHoveringToggle ( true ) }
73
73
onMouseLeave = { ( ) => setHoveringToggle ( false ) }
74
74
>
75
- { dragHandleProps && (
76
- < div
77
- className = { `${ baseClass } __drag` }
78
- { ...dragHandleProps . attributes }
79
- { ...dragHandleProps . listeners }
80
- >
81
- < DragHandleIcon />
82
- </ div >
83
- ) }
84
75
< button
85
76
className = { [
86
77
`${ baseClass } __toggle` ,
@@ -93,7 +84,16 @@ export const Collapsible: React.FC<Props> = ({
93
84
>
94
85
< span > { t ( 'fields:toggleBlock' ) } </ span >
95
86
</ button >
96
- { header && (
87
+ { dragHandleProps && (
88
+ < div
89
+ className = { `${ baseClass } __drag` }
90
+ { ...dragHandleProps . attributes }
91
+ { ...dragHandleProps . listeners }
92
+ >
93
+ < DragHandleIcon />
94
+ </ div >
95
+ ) }
96
+ { header ? (
97
97
< div
98
98
className = { [
99
99
`${ baseClass } __header-wrap` ,
@@ -102,11 +102,11 @@ export const Collapsible: React.FC<Props> = ({
102
102
. filter ( Boolean )
103
103
. join ( ' ' ) }
104
104
>
105
- { header && header }
105
+ { header }
106
106
</ div >
107
- ) }
107
+ ) : null }
108
108
< div className = { `${ baseClass } __actions-wrap` } >
109
- { actions && < div className = { `${ baseClass } __actions` } > { actions } </ div > }
109
+ { actions ? < div className = { `${ baseClass } __actions` } > { actions } </ div > : null }
110
110
< div className = { `${ baseClass } __indicator` } >
111
111
< ChevronIcon direction = { ! isCollapsed ? 'up' : undefined } />
112
112
</ div >
You can’t perform that action at this time.
0 commit comments