@@ -6,12 +6,22 @@ import { Box } from '../Box';
6
6
import { Label } from '../Label' ;
7
7
8
8
export const CheckBox = forwardRef ( function CheckBox ( {
9
- className,
10
- hidden,
9
+ autoComplete,
10
+ checked,
11
+ defaultChecked,
12
+ disabled,
13
+ form,
14
+ id,
11
15
indeterminate,
12
- invisible,
13
- style,
16
+ name,
17
+ required,
18
+ tabIndex,
19
+ value,
20
+ qa,
21
+ 'data-qa' : dataQa ,
14
22
onChange,
23
+ onInput,
24
+ onInvalid,
15
25
...props
16
26
} , ref ) {
17
27
const innerRef = useRef ( ) ;
@@ -26,12 +36,46 @@ export const CheckBox = forwardRef(function CheckBox({
26
36
onChange && onChange . call ( innerRef . current , event ) ;
27
37
} , [ innerRef , indeterminate , onChange ] ) ;
28
38
29
- return < Box is = { Label } componentClassName = 'rcx-check-box' className = { className } hidden = { hidden } invisible = { invisible } style = { style } >
30
- < Box is = 'input' componentClassName = 'rcx-check-box__input' ref = { mergedRef } type = 'checkbox' onChange = { handleChange } { ...props } />
39
+ return < Box is = { Label } componentClassName = 'rcx-check-box' { ...props } >
40
+ < Box
41
+ is = 'input'
42
+ componentClassName = 'rcx-check-box__input'
43
+ autoComplete = { autoComplete }
44
+ checked = { checked }
45
+ defaultChecked = { defaultChecked }
46
+ disabled = { disabled }
47
+ form = { form }
48
+ id = { id }
49
+ name = { name }
50
+ required = { required }
51
+ tabIndex = { tabIndex }
52
+ type = 'checkbox'
53
+ value = { value }
54
+ data-qa = { dataQa || qa }
55
+ ref = { mergedRef }
56
+ onChange = { handleChange }
57
+ onInput = { onInput }
58
+ onInvalid = { onInvalid }
59
+ />
31
60
< Box is = 'i' componentClassName = 'rcx-check-box__fake' aria-hidden = 'true' />
32
61
</ Box > ;
33
62
} ) ;
34
63
35
64
CheckBox . propTypes = {
65
+ autoComplete : PropTypes . string ,
66
+ checked : PropTypes . bool ,
67
+ defaultChecked : PropTypes . bool ,
68
+ disabled : PropTypes . bool ,
69
+ form : PropTypes . string ,
70
+ id : PropTypes . string ,
36
71
indeterminate : PropTypes . bool ,
72
+ name : PropTypes . string ,
73
+ required : PropTypes . bool ,
74
+ tabIndex : PropTypes . number ,
75
+ value : PropTypes . string ,
76
+ qa : PropTypes . string ,
77
+ 'data-qa' : PropTypes . string ,
78
+ onChange : PropTypes . func ,
79
+ onInput : PropTypes . func ,
80
+ onInvalid : PropTypes . func ,
37
81
} ;
0 commit comments