@@ -22,48 +22,41 @@ const Checkbox: React.FC<IProps> = ({
22
22
callback ( )
23
23
}
24
24
}
25
-
26
- const checkboxContainerAttributes = {
27
- display : "inline-block" ,
28
- verticalAlign : "middle" ,
29
- className : className ,
30
- onClick : handleClick ,
31
- }
32
-
33
- const hiddenCheckboxAttributes = {
34
- type : "checkbox" ,
35
- checked : checked ,
36
- readOnly : true ,
37
- ...rest ,
38
- }
39
-
40
- const styledCheckboxAttributes = {
41
- "aria-hidden" : true ,
42
- className : "styled-checkbox" ,
43
- display : "inline-block" ,
44
- w : `${ size } rem` ,
45
- h : `${ size } rem` ,
46
- minW : `${ size } rem` ,
47
- bg : `${ checked ? "primary400" : "background" } ` ,
48
- border : "1px" ,
49
- borderStyle : "solid" ,
50
- borderColor : "black50" ,
51
- borderRadius : "3px" ,
52
- transition : "all 150ms" ,
53
- _hover : {
54
- boxShadow : "tableItemBoxShadow" ,
55
- border : "1px" ,
56
- borderStyle : "solid" ,
57
- borderColor : "primary600" ,
58
- transition : "transform 0.1s" ,
59
- transform : "scale(1.02)" ,
60
- } ,
61
- }
62
-
63
25
return (
64
- < Box { ...checkboxContainerAttributes } >
65
- < VisuallyHiddenInput { ...hiddenCheckboxAttributes } />
66
- < Box { ...styledCheckboxAttributes } >
26
+ < Box
27
+ display = "inline-block"
28
+ verticalAlign = "middle"
29
+ className = { className }
30
+ onClick = { handleClick }
31
+ >
32
+ < VisuallyHiddenInput
33
+ type = "checkbox"
34
+ checked = { checked }
35
+ readOnly
36
+ { ...rest }
37
+ />
38
+ < Box
39
+ aria-hidden = { true }
40
+ className = "styled-checkbox"
41
+ display = "inline-block"
42
+ w = { `${ size } rem` }
43
+ h = { `${ size } rem` }
44
+ minW = { `${ size } rem` }
45
+ bg = { `${ checked ? "primary400" : "background" } ` }
46
+ border = "1px"
47
+ borderStyle = "solid"
48
+ borderColor = "black50"
49
+ borderRadius = "3px"
50
+ transition = "all 150ms"
51
+ _hover = { {
52
+ boxShadow : "tableItemBoxShadow" ,
53
+ border : "1px" ,
54
+ borderStyle : "solid" ,
55
+ borderColor : "primary600" ,
56
+ transition : "transform 0.1s" ,
57
+ transform : "scale(1.02)" ,
58
+ } }
59
+ >
67
60
< svg
68
61
viewBox = "0 0 24 24"
69
62
fill = "none"
0 commit comments