@@ -129,19 +129,23 @@ export function DrawerHeader({
129
129
const { onClose} = useDrawerContentContext ( ) ;
130
130
131
131
return (
132
- < Header ref = { ref } className = { className } >
132
+ < Header
133
+ ref = { ref }
134
+ className = { className }
135
+ hideCloseButton = { hideCloseButton }
136
+ hideBar = { hideBar }
137
+ >
133
138
{ ! hideCloseButton && (
134
139
< Fragment >
135
- < CloseButton
136
- priority = "link "
140
+ < Button
141
+ priority = "transparent "
137
142
size = "xs"
138
- borderless
139
143
aria-label = { t ( 'Close Drawer' ) }
140
144
icon = { < IconClose /> }
141
145
onClick = { onClose }
142
146
>
143
147
{ t ( 'Close' ) }
144
- </ CloseButton >
148
+ </ Button >
145
149
{ ! hideBar && < HeaderBar /> }
146
150
</ Fragment >
147
151
) }
@@ -150,28 +154,25 @@ export function DrawerHeader({
150
154
) ;
151
155
}
152
156
153
- const CloseButton = styled ( Button ) `
154
- color: ${ p => p . theme . subText } ;
155
- &:hover {
156
- color: ${ p => p . theme . textColor } ;
157
- }
158
- ` ;
159
-
160
157
const HeaderBar = styled ( 'div' ) `
161
158
margin: 0 ${ space ( 2 ) } ;
159
+ margin-left: ${ space ( 1 ) } ;
162
160
border-right: 1px solid ${ p => p . theme . border } ;
163
161
` ;
164
162
165
- const Header = styled ( 'header' ) `
163
+ const Header = styled ( 'header' ) < { hideBar ?: boolean ; hideCloseButton ?: boolean } > `
166
164
position: sticky;
167
165
top: 0;
168
166
z-index: ${ p => p . theme . zIndex . drawer + 1 } ;
169
167
background: ${ p => p . theme . background } ;
170
168
justify-content: flex-start;
171
169
display: flex;
170
+ gap: ${ p => ( p . hideBar ? space ( 1 ) : 0 ) } ;
172
171
padding: ${ space ( 1.5 ) } ;
173
172
box-shadow: ${ p => p . theme . border } 0 1px;
174
- padding-left: 24px;
173
+ padding-left: ${ p => ( p . hideCloseButton ? '24px' : space ( 2 ) ) } ;
174
+ padding-top: ${ p => ( p . hideCloseButton ? space ( 1.5 ) : space ( 0.75 ) ) } ;
175
+ padding-bottom: ${ p => ( p . hideCloseButton ? space ( 1.5 ) : space ( 0.75 ) ) } ;
175
176
` ;
176
177
177
178
export const DrawerBody = styled ( 'aside' ) `
0 commit comments