@@ -3,11 +3,7 @@ import PropTypes from 'prop-types';
3
3
import { forbidExtraProps } from 'airbnb-prop-types' ;
4
4
import { withStyles , withStylesPropTypes } from 'react-with-styles' ;
5
5
6
- import {
7
- DEFAULT_HANDLE_WIDTH_UNITS ,
8
- BACKGROUND_HEIGHT_UNITS ,
9
- VERTICAL ,
10
- } from './constants/SliderConstants' ;
6
+ import { VERTICAL } from './constants/SliderConstants' ;
11
7
12
8
import handlePropTypes , { handleDefaultProps } from './propTypes/HandlePropTypes' ;
13
9
@@ -52,10 +48,10 @@ DefaultHandle.propTypes = propTypes;
52
48
53
49
DefaultHandle . defaultProps = defaultProps ;
54
50
55
- export default withStyles ( ( { color, unit } ) => ( {
51
+ export default withStyles ( ( { color, unit, constants } ) => ( {
56
52
DefaultHandle_handle : {
57
- width : DEFAULT_HANDLE_WIDTH_UNITS * 3.8 * unit ,
58
- height : DEFAULT_HANDLE_WIDTH_UNITS * 3.8 * unit ,
53
+ width : 2 * constants . DEFAULT_HANDLE_WIDTH * unit ,
54
+ height : 2 * constants . DEFAULT_HANDLE_WIDTH * unit ,
59
55
borderWidth : 1 ,
60
56
borderStyle : 'solid' ,
61
57
borderColor : color . grey ,
@@ -65,7 +61,7 @@ export default withStyles(({ color, unit }) => ({
65
61
zIndex : 2 ,
66
62
boxShadow : `0 ${ unit / 4 } px ${ unit / 4 } px ${ color . textDisabled } ` ,
67
63
':focus' : {
68
- boxShadow : `${ color . focus } 0 0 2px 2px ` ,
64
+ boxShadow : `${ color . focus } 0 0 1px 1px ` ,
69
65
} ,
70
66
71
67
':after' : {
@@ -99,33 +95,21 @@ export default withStyles(({ color, unit }) => ({
99
95
width : 1 ,
100
96
left : 13 ,
101
97
} ,
102
-
103
- background : {
104
- borderRadius : 15 ,
105
- } ,
106
98
} ,
107
99
108
100
DefaultHandle_handle__vertical : {
109
- marginTop : - ( DEFAULT_HANDLE_WIDTH_UNITS * 1.9 ) * unit ,
110
- left : ( ( BACKGROUND_HEIGHT_UNITS * 1.9 ) - ( DEFAULT_HANDLE_WIDTH_UNITS * 1.9 ) ) * unit ,
111
- progress : {
112
- left : 2 ,
113
- width : 13 ,
114
- } ,
115
- handle : {
116
- left : - 5 ,
117
- marginTop : - 12 ,
101
+ marginTop : - ( constants . DEFAULT_HANDLE_WIDTH ) * unit ,
102
+ left : ( constants . BACKGROUND_HEIGHT - constants . DEFAULT_HANDLE_WIDTH ) * unit ,
118
103
119
- ':before' : {
120
- top : 10 ,
121
- } ,
104
+ ':before' : {
105
+ top : 10 ,
106
+ } ,
122
107
123
- ':after' : {
124
- top : 13 ,
125
- left : 8 ,
126
- height : 1 ,
127
- width : 10 ,
128
- } ,
108
+ ':after' : {
109
+ top : 13 ,
110
+ left : 8 ,
111
+ height : 1 ,
112
+ width : 10 ,
129
113
} ,
130
114
} ,
131
115
0 commit comments