@@ -10,7 +10,6 @@ import {
10
10
StyledLabel
11
11
} from '../common/SwitchBase' ;
12
12
import { noOp } from '../common/utils' ;
13
- import { StyledMenuListItem } from '../MenuList/MenuList' ;
14
13
import { StyledScrollView } from '../ScrollView/ScrollView' ;
15
14
import { CommonThemeProps } from '../types' ;
16
15
@@ -25,7 +24,7 @@ type CheckboxProps = {
25
24
onChange ?: React . ChangeEventHandler < HTMLInputElement > ;
26
25
style ?: React . CSSProperties ;
27
26
value ?: number | string ;
28
- variant ?: 'default' | 'flat' | 'menu' ;
27
+ variant ?: 'default' | 'flat' ;
29
28
} & Omit <
30
29
React . InputHTMLAttributes < HTMLInputElement > ,
31
30
| 'checked'
@@ -41,7 +40,7 @@ type CheckboxProps = {
41
40
42
41
type CheckmarkProps = {
43
42
$disabled : boolean ;
44
- variant : 'default' | 'flat' | 'menu' ;
43
+ variant : 'default' | 'flat' ;
45
44
} ;
46
45
47
46
const sharedCheckboxStyles = css `
@@ -77,20 +76,6 @@ const StyledFlatCheckbox = styled.div<CommonThemeProps>`
77
76
$disabled ? theme . flatLight : theme . canvas } ;
78
77
` ;
79
78
80
- const StyledMenuCheckbox = styled . div < CommonThemeProps > `
81
- position: relative;
82
- box-sizing: border-box;
83
- display: inline-block;
84
- background: ${ ( { $disabled, theme } ) =>
85
- $disabled ? theme . flatLight : theme . canvas } ;
86
- ${ sharedCheckboxStyles }
87
- width: ${ size - 4 } px;
88
- height: ${ size - 4 } px;
89
- background: none;
90
- border: none;
91
- outline: none;
92
- ` ;
93
-
94
79
const CheckmarkIcon = styled . span . attrs ( ( ) => ( {
95
80
'data-testid' : 'checkmarkIcon'
96
81
} ) ) < CheckmarkProps > `
@@ -113,30 +98,8 @@ const CheckmarkIcon = styled.span.attrs(() => ({
113
98
border-width: 0 3px 3px 0;
114
99
transform: translate(-50%, -50%) rotate(45deg);
115
100
116
- ${ ( { $disabled, theme, variant } ) =>
117
- variant === 'menu'
118
- ? css `
119
- border-color : ${ $disabled
120
- ? theme . materialTextDisabled
121
- : theme . materialText } ;
122
- filter : drop-shadow (
123
- 1px 1px 0px
124
- ${ $disabled ? theme . materialTextDisabledShadow : 'transparent' }
125
- );
126
- `
127
- : css `
128
- border-color : ${ $disabled
129
- ? theme . checkmarkDisabled
130
- : theme . checkmark } ;
131
- ` }
132
- ${ StyledMenuListItem } :hover & {
133
- ${ ( { $disabled, theme, variant } ) =>
134
- ! $disabled &&
135
- variant === 'menu' &&
136
- css `
137
- border-color : ${ theme . materialTextInvert } ;
138
- ` } ;
139
- }
101
+ border-color: ${ p =>
102
+ p . $disabled ? p . theme . checkmarkDisabled : p . theme . checkmark } ;
140
103
}
141
104
` ;
142
105
const IndeterminateIcon = styled . span . attrs ( ( ) => ( {
@@ -145,16 +108,9 @@ const IndeterminateIcon = styled.span.attrs(() => ({
145
108
display: inline-block;
146
109
position: relative;
147
110
148
- ${ ( { variant } ) =>
149
- variant === 'menu'
150
- ? css `
151
- height : calc (100% - 4px );
152
- width : calc (100% - 4px );
153
- `
154
- : css `
155
- width : 100% ;
156
- height : 100% ;
157
- ` }
111
+ width: 100%;
112
+ height: 100%;
113
+
158
114
&:after {
159
115
content: '';
160
116
display: block;
@@ -167,27 +123,12 @@ const IndeterminateIcon = styled.span.attrs(() => ({
167
123
mainColor : $disabled ? theme . checkmarkDisabled : theme . checkmark
168
124
} ) }
169
125
background-position: 0px 0px, 2px 2px;
170
-
171
- ${ ( { $disabled, theme, variant } ) =>
172
- variant === 'menu' &&
173
- css `
174
- ${ StyledMenuListItem } : hover & {
175
- ${ createHatchedBackground ( {
176
- mainColor : theme . materialTextInvert
177
- } ) }
178
- }
179
- filter : drop-shadow (
180
- 1px 1px 0px
181
- ${ $disabled ? theme . materialTextDisabledShadow : 'transparent' }
182
- );
183
- ` } ;
184
126
}
185
127
` ;
186
128
187
129
const CheckboxComponents = {
188
130
flat : StyledFlatCheckbox ,
189
- default : StyledCheckbox ,
190
- menu : StyledMenuCheckbox
131
+ default : StyledCheckbox
191
132
} ;
192
133
193
134
const Checkbox = forwardRef < HTMLInputElement , CheckboxProps > (
0 commit comments