@@ -5,7 +5,7 @@ import styled, { css } from 'styled-components/macro';
5
5
import AllOrNone from '../../../components/AllOrNone' ;
6
6
import Checkbox from '../../../components/Checkbox' ;
7
7
import { textStyle } from '../../../components/Typography/base' ;
8
- import theme from '../../../theme' ;
8
+ import theme , { hiddenButAccessible } from '../../../theme' ;
9
9
import { highlightStyles } from '../../constants' ;
10
10
import ColorIndicator from '../../highlights/components/ColorIndicator' ;
11
11
import { filters , mobileMarginSides } from '../../styles/PopupConstants' ;
@@ -19,6 +19,17 @@ const ColorLabel = styled.span`
19
19
white-space : nowrap;
20
20
` ;
21
21
22
+ // tslint:disable-next-line: variable-name
23
+ const Fieldset = styled . fieldset `
24
+ padding : 0 ;
25
+ border : none;
26
+ margin : 0 ;
27
+
28
+ legend {
29
+ ${ hiddenButAccessible }
30
+ }
31
+ ` ;
32
+
22
33
export interface ColorFilterProps {
23
34
className ?: string ;
24
35
disabled ?: boolean ;
@@ -58,19 +69,22 @@ const ColorFilter = ({
58
69
onAll = { ( ) => setSelectedColors ( { remove : [ ] , new : Array . from ( colorFiltersWithContent ) } ) }
59
70
disabled = { disabled }
60
71
/>
61
- { styles . map ( ( style ) => < Checkbox
62
- key = { style . label }
63
- checked = { selectedColorFilters . has ( style . label ) }
64
- disabled = { disabled || ! colorFiltersWithContent . has ( style . label ) }
65
- onChange = { ( ) => handleChange ( style . label ) }
66
- >
67
- < ColorIndicator style = { style } size = 'small' />
68
- < ColorLabel >
69
- < FormattedMessage id = { labelKey ( style . label ) } >
70
- { ( msg ) => msg }
71
- </ FormattedMessage >
72
- </ ColorLabel >
73
- </ Checkbox > ) }
72
+ < Fieldset >
73
+ < legend > Filter by colors</ legend >
74
+ { styles . map ( ( style ) => < Checkbox
75
+ key = { style . label }
76
+ checked = { selectedColorFilters . has ( style . label ) }
77
+ disabled = { disabled || ! colorFiltersWithContent . has ( style . label ) }
78
+ onChange = { ( ) => handleChange ( style . label ) }
79
+ >
80
+ < ColorIndicator style = { style } size = 'small' />
81
+ < ColorLabel >
82
+ < FormattedMessage id = { labelKey ( style . label ) } >
83
+ { ( msg ) => msg }
84
+ </ FormattedMessage >
85
+ </ ColorLabel >
86
+ </ Checkbox > ) }
87
+ </ Fieldset >
74
88
</ div > ;
75
89
} ;
76
90
0 commit comments