File tree Expand file tree Collapse file tree 2 files changed +22
-11
lines changed Expand file tree Collapse file tree 2 files changed +22
-11
lines changed Original file line number Diff line number Diff line change 11import { styled , Theme } from "../../styles" ;
22import { Icon } from "../../icons" ;
3- import { filterProps , clickOnEnter } from '../component-utils' ;
3+ import { clickOnEnter } from '../component-utils' ;
44
55interface CloseButtonProps {
66 onClose : ( ) => void ;
7- inverted ?: boolean ;
87 top ?: string ;
98 right ?: string ;
109
1110 theme ?: Theme ;
1211}
1312
14- export const CloseButton = styled (
15- filterProps ( Icon , 'inverted' )
16- ) . attrs ( ( props : CloseButtonProps ) => ( {
13+ export const CloseButton = styled ( Icon ) . attrs ( ( props : CloseButtonProps ) => ( {
1714 icon : [ 'fas' , 'times' ] ,
1815 size : '2x' ,
1916
@@ -25,12 +22,15 @@ export const CloseButton = styled(
2522 z-index: 1;
2623 cursor: pointer;
2724
28- color: ${ ( p : CloseButtonProps ) => p . inverted ?
29- p . theme ! . mainBackground : p . theme ! . mainColor
30- } ;
25+ color: ${ p => p . theme ! . mainColor } ;
3126
32- top: ${ p => p . top || '10px' } ;
33- right: ${ p => p . right || '15px' } ;
27+ &:focus-visible {
28+ outline: none;
29+ color: ${ p => p . theme ! . popColor } ;
30+ }
31+
32+ top: ${ ( p : CloseButtonProps ) => p . top || '10px' } ;
33+ right: ${ ( p : CloseButtonProps ) => p . right || '15px' } ;
3434
3535 &:hover {
3636 opacity: 0.6;
Original file line number Diff line number Diff line change @@ -231,6 +231,8 @@ export class InterceptOption extends React.Component<InterceptOptionProps> {
231231 ? 4
232232 : 3 ;
233233
234+ const isExpandable = ! ! ConfigComponent && ! isDisabled ;
235+
234236 return < InterceptOptionCard
235237 ref = { this . cardRef }
236238
@@ -239,6 +241,12 @@ export class InterceptOption extends React.Component<InterceptOptionProps> {
239241 uiConfig = { uiConfig }
240242 gridWidth = { gridWidth }
241243
244+ role = { ! this . expanded ? 'button' : 'section' }
245+ aria-expanded = { isExpandable
246+ ? this . expanded
247+ : undefined
248+ }
249+
242250 disabled = { isDisabled }
243251 onKeyDown = { clickOnEnter }
244252 onClick = { this . expanded ? undefined : this . onClick }
@@ -260,7 +268,10 @@ export class InterceptOption extends React.Component<InterceptOptionProps> {
260268
261269 { ConfigComponent && expanded
262270 ? < >
263- < CloseButton onClose = { this . onClose } />
271+ < CloseButton
272+ title = "Close this interceptor"
273+ onClose = { this . onClose }
274+ />
264275 < ConfigComponent
265276 interceptor = { interceptor }
266277 activateInterceptor = { activateInterceptor }
You can’t perform that action at this time.
0 commit comments