@instructure/ui-range-input 11.7.3-snapshot-37 → 11.7.3-snapshot-39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/es/RangeInput/v2/index.js +1 -2
- package/es/RangeInput/v2/props.js +1 -1
- package/es/RangeInput/v2/styles.js +14 -37
- package/lib/RangeInput/v2/index.js +1 -2
- package/lib/RangeInput/v2/props.js +1 -1
- package/lib/RangeInput/v2/styles.js +14 -38
- package/package.json +15 -15
- package/src/RangeInput/v2/README.md +0 -16
- package/src/RangeInput/v2/index.tsx +1 -2
- package/src/RangeInput/v2/props.ts +0 -9
- package/src/RangeInput/v2/styles.ts +17 -45
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/RangeInput/v2/index.d.ts +0 -2
- package/types/RangeInput/v2/index.d.ts.map +1 -1
- package/types/RangeInput/v2/props.d.ts +0 -5
- package/types/RangeInput/v2/props.d.ts.map +1 -1
- package/types/RangeInput/v2/styles.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [11.7.3-snapshot-
|
|
6
|
+
## [11.7.3-snapshot-39](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-39) (2026-05-07)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
@@ -11,6 +11,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
* **many:** update dependencies, remove lots of Babel plugins, remove Webpack 4 support ([f916fca](https://github.com/instructure/instructure-ui/commit/f916fcafdddcb2d7de401f93e8ff92cfdfa47bba))
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **ui-range-input:** remove deprecated thumb variant ([ca4a3fb](https://github.com/instructure/instructure-ui/commit/ca4a3fb45885fbcc9807566dadd3d027a17b8f72))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### BREAKING CHANGES
|
|
20
|
+
|
|
21
|
+
* **ui-range-input:** `thumbVariant` prop removed from RangeInput
|
|
22
|
+
|
|
23
|
+
INSTUI-5016
|
|
24
|
+
|
|
25
|
+
|
|
14
26
|
|
|
15
27
|
|
|
16
28
|
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
const allowedProps = ['min', 'max', 'defaultValue', 'value', 'onChange', 'messages', 'size', 'layout', 'id', 'label', 'displayValue', 'step', 'formatValue', 'inline', 'disabled', 'readOnly', '
|
|
25
|
+
const allowedProps = ['min', 'max', 'defaultValue', 'value', 'onChange', 'messages', 'size', 'layout', 'id', 'label', 'displayValue', 'step', 'formatValue', 'inline', 'disabled', 'readOnly', 'inputRef'];
|
|
26
26
|
export { allowedProps };
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import { darken, alpha } from '@instructure/ui-color-utils';
|
|
26
25
|
import { boxShadowObjectsToCSSString } from '@instructure/ui-themes';
|
|
27
26
|
|
|
28
27
|
/**
|
|
@@ -37,8 +36,7 @@ import { boxShadowObjectsToCSSString } from '@instructure/ui-themes';
|
|
|
37
36
|
*/
|
|
38
37
|
const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
39
38
|
const {
|
|
40
|
-
size
|
|
41
|
-
thumbVariant
|
|
39
|
+
size
|
|
42
40
|
} = props;
|
|
43
41
|
const valueSizeVariants = {
|
|
44
42
|
small: {
|
|
@@ -69,29 +67,19 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
69
67
|
height: `calc(${componentTheme.handleSize} / 2)`
|
|
70
68
|
};
|
|
71
69
|
const borderedHandleSize = `calc(${componentTheme.handleSize} + (${componentTheme.handleBorderSize} * 2))`;
|
|
72
|
-
const thumbVariantStyle = {
|
|
73
|
-
deprecated: {
|
|
74
|
-
width: componentTheme.handleSize,
|
|
75
|
-
height: componentTheme.handleSize,
|
|
76
|
-
boxShadow: `0 0.0625rem 0 ${darken(componentTheme.handleShadowColor)}`
|
|
77
|
-
},
|
|
78
|
-
accessible: {
|
|
79
|
-
width: borderedHandleSize,
|
|
80
|
-
height: borderedHandleSize,
|
|
81
|
-
borderWidth: componentTheme.handleBorderSize,
|
|
82
|
-
borderColor: componentTheme.handleBorderColor,
|
|
83
|
-
borderStyle: 'solid',
|
|
84
|
-
boxSizing: 'border-box',
|
|
85
|
-
boxShadow: boxShadowObjectsToCSSString(componentTheme.boxShadow)
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
70
|
const thumbStyle = {
|
|
89
71
|
appearance: 'none',
|
|
90
72
|
borderRadius: '50%',
|
|
91
73
|
cursor: 'pointer',
|
|
92
74
|
transition: 'all 0.15s ease-in-out',
|
|
93
75
|
background: componentTheme.handleBackground,
|
|
94
|
-
|
|
76
|
+
width: borderedHandleSize,
|
|
77
|
+
height: borderedHandleSize,
|
|
78
|
+
borderWidth: componentTheme.handleBorderSize,
|
|
79
|
+
borderColor: componentTheme.handleBorderColor,
|
|
80
|
+
borderStyle: 'solid',
|
|
81
|
+
boxSizing: 'border-box',
|
|
82
|
+
boxShadow: boxShadowObjectsToCSSString(componentTheme.boxShadow),
|
|
95
83
|
'&:hover': {
|
|
96
84
|
background: componentTheme.handleHoverBackground
|
|
97
85
|
}
|
|
@@ -99,22 +87,11 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
99
87
|
|
|
100
88
|
// Center the thumb vertically on the track by accounting for the track borders
|
|
101
89
|
const thumbPosition = {
|
|
102
|
-
|
|
103
|
-
marginTop: `calc(-1 * ${componentTheme.handleSize} / 4 - ${trackBorderWidth})`
|
|
104
|
-
},
|
|
105
|
-
accessible: {
|
|
106
|
-
marginTop: `calc(-1 * ${borderedHandleSize} / 4 - ${trackBorderWidth})`
|
|
107
|
-
}
|
|
90
|
+
marginTop: `calc(-1 * ${borderedHandleSize} / 4 - ${trackBorderWidth})`
|
|
108
91
|
};
|
|
109
92
|
const thumbFocusActiveStyle = {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
boxShadow: `0 0.0625rem 0 ${darken(componentTheme.handleShadowColor)}, 0 0 0 ${componentTheme.handleFocusOutlineWidth} ${alpha(componentTheme.handleFocusOutlineColor, 40)}`
|
|
113
|
-
},
|
|
114
|
-
accessible: {
|
|
115
|
-
background: componentTheme.handleFocusBackground,
|
|
116
|
-
boxShadow: `${boxShadowObjectsToCSSString(componentTheme.boxShadow)}, ` + `inset 0 0 0 ${componentTheme.handleFocusInset} ${componentTheme.handleFocusBackground}, ` + `inset 0 0 0 calc(${componentTheme.handleFocusInset} + ${sharedTokens.focusOutline.width}) ${sharedTokens.focusOutline.onColor}`
|
|
117
|
-
}
|
|
93
|
+
background: componentTheme.handleFocusBackground,
|
|
94
|
+
boxShadow: `${boxShadowObjectsToCSSString(componentTheme.boxShadow)}, ` + `inset 0 0 0 ${componentTheme.handleFocusInset} ${componentTheme.handleFocusBackground}, ` + `inset 0 0 0 calc(${componentTheme.handleFocusInset} + ${sharedTokens.focusOutline.width}) ${sharedTokens.focusOutline.onColor}`
|
|
118
95
|
};
|
|
119
96
|
return {
|
|
120
97
|
rangeInput: {
|
|
@@ -136,13 +113,13 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
136
113
|
margin: 0,
|
|
137
114
|
'&::-webkit-slider-thumb': {
|
|
138
115
|
...thumbStyle,
|
|
139
|
-
...thumbPosition
|
|
116
|
+
...thumbPosition
|
|
140
117
|
},
|
|
141
118
|
'&::-moz-range-thumb': thumbStyle,
|
|
142
119
|
'&:focus, &:active': {
|
|
143
120
|
outline: 'none',
|
|
144
|
-
'&::-webkit-slider-thumb': thumbFocusActiveStyle
|
|
145
|
-
'&::-moz-range-thumb': thumbFocusActiveStyle
|
|
121
|
+
'&::-webkit-slider-thumb': thumbFocusActiveStyle,
|
|
122
|
+
'&::-moz-range-thumb': thumbFocusActiveStyle
|
|
146
123
|
},
|
|
147
124
|
// remove outline in FF
|
|
148
125
|
'&::-moz-focus-inner, &::-moz-focus-outer': {
|
|
@@ -28,4 +28,4 @@ exports.allowedProps = void 0;
|
|
|
28
28
|
* SOFTWARE.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
const allowedProps = exports.allowedProps = ['min', 'max', 'defaultValue', 'value', 'onChange', 'messages', 'size', 'layout', 'id', 'label', 'displayValue', 'step', 'formatValue', 'inline', 'disabled', 'readOnly', '
|
|
31
|
+
const allowedProps = exports.allowedProps = ['min', 'max', 'defaultValue', 'value', 'onChange', 'messages', 'size', 'layout', 'id', 'label', 'displayValue', 'step', 'formatValue', 'inline', 'disabled', 'readOnly', 'inputRef'];
|
|
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _darken = require("@instructure/ui-color-utils/lib/darken.js");
|
|
8
|
-
var _alpha = require("@instructure/ui-color-utils/lib/alpha.js");
|
|
9
7
|
var _uiThemes = require("@instructure/ui-themes");
|
|
10
8
|
/*
|
|
11
9
|
* The MIT License (MIT)
|
|
@@ -43,8 +41,7 @@ var _uiThemes = require("@instructure/ui-themes");
|
|
|
43
41
|
*/
|
|
44
42
|
const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
45
43
|
const {
|
|
46
|
-
size
|
|
47
|
-
thumbVariant
|
|
44
|
+
size
|
|
48
45
|
} = props;
|
|
49
46
|
const valueSizeVariants = {
|
|
50
47
|
small: {
|
|
@@ -75,29 +72,19 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
75
72
|
height: `calc(${componentTheme.handleSize} / 2)`
|
|
76
73
|
};
|
|
77
74
|
const borderedHandleSize = `calc(${componentTheme.handleSize} + (${componentTheme.handleBorderSize} * 2))`;
|
|
78
|
-
const thumbVariantStyle = {
|
|
79
|
-
deprecated: {
|
|
80
|
-
width: componentTheme.handleSize,
|
|
81
|
-
height: componentTheme.handleSize,
|
|
82
|
-
boxShadow: `0 0.0625rem 0 ${(0, _darken.darken)(componentTheme.handleShadowColor)}`
|
|
83
|
-
},
|
|
84
|
-
accessible: {
|
|
85
|
-
width: borderedHandleSize,
|
|
86
|
-
height: borderedHandleSize,
|
|
87
|
-
borderWidth: componentTheme.handleBorderSize,
|
|
88
|
-
borderColor: componentTheme.handleBorderColor,
|
|
89
|
-
borderStyle: 'solid',
|
|
90
|
-
boxSizing: 'border-box',
|
|
91
|
-
boxShadow: (0, _uiThemes.boxShadowObjectsToCSSString)(componentTheme.boxShadow)
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
75
|
const thumbStyle = {
|
|
95
76
|
appearance: 'none',
|
|
96
77
|
borderRadius: '50%',
|
|
97
78
|
cursor: 'pointer',
|
|
98
79
|
transition: 'all 0.15s ease-in-out',
|
|
99
80
|
background: componentTheme.handleBackground,
|
|
100
|
-
|
|
81
|
+
width: borderedHandleSize,
|
|
82
|
+
height: borderedHandleSize,
|
|
83
|
+
borderWidth: componentTheme.handleBorderSize,
|
|
84
|
+
borderColor: componentTheme.handleBorderColor,
|
|
85
|
+
borderStyle: 'solid',
|
|
86
|
+
boxSizing: 'border-box',
|
|
87
|
+
boxShadow: (0, _uiThemes.boxShadowObjectsToCSSString)(componentTheme.boxShadow),
|
|
101
88
|
'&:hover': {
|
|
102
89
|
background: componentTheme.handleHoverBackground
|
|
103
90
|
}
|
|
@@ -105,22 +92,11 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
105
92
|
|
|
106
93
|
// Center the thumb vertically on the track by accounting for the track borders
|
|
107
94
|
const thumbPosition = {
|
|
108
|
-
|
|
109
|
-
marginTop: `calc(-1 * ${componentTheme.handleSize} / 4 - ${trackBorderWidth})`
|
|
110
|
-
},
|
|
111
|
-
accessible: {
|
|
112
|
-
marginTop: `calc(-1 * ${borderedHandleSize} / 4 - ${trackBorderWidth})`
|
|
113
|
-
}
|
|
95
|
+
marginTop: `calc(-1 * ${borderedHandleSize} / 4 - ${trackBorderWidth})`
|
|
114
96
|
};
|
|
115
97
|
const thumbFocusActiveStyle = {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
boxShadow: `0 0.0625rem 0 ${(0, _darken.darken)(componentTheme.handleShadowColor)}, 0 0 0 ${componentTheme.handleFocusOutlineWidth} ${(0, _alpha.alpha)(componentTheme.handleFocusOutlineColor, 40)}`
|
|
119
|
-
},
|
|
120
|
-
accessible: {
|
|
121
|
-
background: componentTheme.handleFocusBackground,
|
|
122
|
-
boxShadow: `${(0, _uiThemes.boxShadowObjectsToCSSString)(componentTheme.boxShadow)}, ` + `inset 0 0 0 ${componentTheme.handleFocusInset} ${componentTheme.handleFocusBackground}, ` + `inset 0 0 0 calc(${componentTheme.handleFocusInset} + ${sharedTokens.focusOutline.width}) ${sharedTokens.focusOutline.onColor}`
|
|
123
|
-
}
|
|
98
|
+
background: componentTheme.handleFocusBackground,
|
|
99
|
+
boxShadow: `${(0, _uiThemes.boxShadowObjectsToCSSString)(componentTheme.boxShadow)}, ` + `inset 0 0 0 ${componentTheme.handleFocusInset} ${componentTheme.handleFocusBackground}, ` + `inset 0 0 0 calc(${componentTheme.handleFocusInset} + ${sharedTokens.focusOutline.width}) ${sharedTokens.focusOutline.onColor}`
|
|
124
100
|
};
|
|
125
101
|
return {
|
|
126
102
|
rangeInput: {
|
|
@@ -142,13 +118,13 @@ const generateStyle = (componentTheme, props, sharedTokens) => {
|
|
|
142
118
|
margin: 0,
|
|
143
119
|
'&::-webkit-slider-thumb': {
|
|
144
120
|
...thumbStyle,
|
|
145
|
-
...thumbPosition
|
|
121
|
+
...thumbPosition
|
|
146
122
|
},
|
|
147
123
|
'&::-moz-range-thumb': thumbStyle,
|
|
148
124
|
'&:focus, &:active': {
|
|
149
125
|
outline: 'none',
|
|
150
|
-
'&::-webkit-slider-thumb': thumbFocusActiveStyle
|
|
151
|
-
'&::-moz-range-thumb': thumbFocusActiveStyle
|
|
126
|
+
'&::-webkit-slider-thumb': thumbFocusActiveStyle,
|
|
127
|
+
'&::-moz-range-thumb': thumbFocusActiveStyle
|
|
152
128
|
},
|
|
153
129
|
// remove outline in FF
|
|
154
130
|
'&::-moz-focus-inner, &::-moz-focus-outer': {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-range-input",
|
|
3
|
-
"version": "11.7.3-snapshot-
|
|
3
|
+
"version": "11.7.3-snapshot-39",
|
|
4
4
|
"description": "A styled HTML range input",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -15,25 +15,25 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.29.2",
|
|
18
|
-
"@instructure/console": "11.7.3-snapshot-
|
|
19
|
-
"@instructure/
|
|
20
|
-
"@instructure/
|
|
21
|
-
"@instructure/ui-color-utils": "11.7.3-snapshot-
|
|
22
|
-
"@instructure/ui-dom-utils": "11.7.3-snapshot-
|
|
23
|
-
"@instructure/ui-form-field": "11.7.3-snapshot-
|
|
24
|
-
"@instructure/ui-
|
|
25
|
-
"@instructure/ui-
|
|
26
|
-
"@instructure/ui-
|
|
27
|
-
"@instructure/ui-
|
|
28
|
-
"@instructure/uid": "11.7.3-snapshot-
|
|
29
|
-
"@instructure/ui-
|
|
18
|
+
"@instructure/console": "11.7.3-snapshot-39",
|
|
19
|
+
"@instructure/shared-types": "11.7.3-snapshot-39",
|
|
20
|
+
"@instructure/emotion": "11.7.3-snapshot-39",
|
|
21
|
+
"@instructure/ui-color-utils": "11.7.3-snapshot-39",
|
|
22
|
+
"@instructure/ui-dom-utils": "11.7.3-snapshot-39",
|
|
23
|
+
"@instructure/ui-form-field": "11.7.3-snapshot-39",
|
|
24
|
+
"@instructure/ui-i18n": "11.7.3-snapshot-39",
|
|
25
|
+
"@instructure/ui-react-utils": "11.7.3-snapshot-39",
|
|
26
|
+
"@instructure/ui-themes": "11.7.3-snapshot-39",
|
|
27
|
+
"@instructure/ui-utils": "11.7.3-snapshot-39",
|
|
28
|
+
"@instructure/uid": "11.7.3-snapshot-39",
|
|
29
|
+
"@instructure/ui-view": "11.7.3-snapshot-39"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@testing-library/jest-dom": "^6.6.3",
|
|
33
33
|
"@testing-library/react": "15.0.7",
|
|
34
34
|
"vitest": "^3.2.2",
|
|
35
|
-
"@instructure/ui-axe-check": "11.7.3-snapshot-
|
|
36
|
-
"@instructure/ui-babel-preset": "11.7.3-snapshot-
|
|
35
|
+
"@instructure/ui-axe-check": "11.7.3-snapshot-39",
|
|
36
|
+
"@instructure/ui-babel-preset": "11.7.3-snapshot-39"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": ">=18 <=19"
|
|
@@ -10,16 +10,11 @@ type: example
|
|
|
10
10
|
---
|
|
11
11
|
const Example = () => {
|
|
12
12
|
const [size, setSize] = useState('small')
|
|
13
|
-
const [thumbVariant, setThumbVariant] = useState('accessible')
|
|
14
13
|
|
|
15
14
|
const handleSizeChange = (event, value) => {
|
|
16
15
|
setSize(value)
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
const handleThumbVariantChange = (event, value) => {
|
|
20
|
-
setThumbVariant(value)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
18
|
return (
|
|
24
19
|
<div>
|
|
25
20
|
<View as="div" padding="medium" background="primary">
|
|
@@ -29,7 +24,6 @@ const Example = () => {
|
|
|
29
24
|
max={100}
|
|
30
25
|
min={0}
|
|
31
26
|
size={size}
|
|
32
|
-
thumbVariant={thumbVariant}
|
|
33
27
|
/>
|
|
34
28
|
</View>
|
|
35
29
|
|
|
@@ -53,16 +47,6 @@ const Example = () => {
|
|
|
53
47
|
<RadioInput label="medium" value="medium" />
|
|
54
48
|
<RadioInput label="large" value="large" />
|
|
55
49
|
</RadioInputGroup>
|
|
56
|
-
|
|
57
|
-
<RadioInputGroup
|
|
58
|
-
onChange={handleThumbVariantChange}
|
|
59
|
-
name="thumbVariant"
|
|
60
|
-
value={thumbVariant}
|
|
61
|
-
description="Thumb variant"
|
|
62
|
-
>
|
|
63
|
-
<RadioInput label="accessible" value="accessible" />
|
|
64
|
-
<RadioInput label="deprecated" value="deprecated" />
|
|
65
|
-
</RadioInputGroup>
|
|
66
50
|
</FormFieldGroup>
|
|
67
51
|
</View>
|
|
68
52
|
</div>
|
|
@@ -88,14 +88,6 @@ type RangeInputOwnProps = {
|
|
|
88
88
|
|
|
89
89
|
readOnly?: boolean
|
|
90
90
|
|
|
91
|
-
/**
|
|
92
|
-
* The "deprecated" variant has an outer shadow on focus.
|
|
93
|
-
* The "accessible" variant has better color contrast, border and inset focus ring for better accessibility.
|
|
94
|
-
*/
|
|
95
|
-
thumbVariant?:
|
|
96
|
-
| 'deprecated' // TODO: deprecated, remove in V9.
|
|
97
|
-
| 'accessible'
|
|
98
|
-
|
|
99
91
|
/**
|
|
100
92
|
* A function that provides a reference to the actual underlying input element
|
|
101
93
|
*/
|
|
@@ -147,7 +139,6 @@ const allowedProps: AllowedPropKeys = [
|
|
|
147
139
|
'inline',
|
|
148
140
|
'disabled',
|
|
149
141
|
'readOnly',
|
|
150
|
-
'thumbVariant',
|
|
151
142
|
'inputRef'
|
|
152
143
|
]
|
|
153
144
|
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
|
|
25
25
|
import type { NewComponentTypes, SharedTokens } from '@instructure/ui-themes'
|
|
26
26
|
import type { RangeInputProps, RangeInputStyle } from './props'
|
|
27
|
-
import { darken, alpha } from '@instructure/ui-color-utils'
|
|
28
27
|
import { boxShadowObjectsToCSSString } from '@instructure/ui-themes'
|
|
29
28
|
|
|
30
29
|
/**
|
|
@@ -42,7 +41,7 @@ const generateStyle = (
|
|
|
42
41
|
props: RangeInputProps,
|
|
43
42
|
sharedTokens: SharedTokens
|
|
44
43
|
): RangeInputStyle => {
|
|
45
|
-
const { size
|
|
44
|
+
const { size } = props
|
|
46
45
|
const valueSizeVariants = {
|
|
47
46
|
small: {
|
|
48
47
|
fontSize: componentTheme.valueSmallFontSize,
|
|
@@ -76,30 +75,19 @@ const generateStyle = (
|
|
|
76
75
|
|
|
77
76
|
const borderedHandleSize = `calc(${componentTheme.handleSize} + (${componentTheme.handleBorderSize} * 2))`
|
|
78
77
|
|
|
79
|
-
const thumbVariantStyle = {
|
|
80
|
-
deprecated: {
|
|
81
|
-
width: componentTheme.handleSize,
|
|
82
|
-
height: componentTheme.handleSize,
|
|
83
|
-
boxShadow: `0 0.0625rem 0 ${darken(componentTheme.handleShadowColor)}`
|
|
84
|
-
},
|
|
85
|
-
accessible: {
|
|
86
|
-
width: borderedHandleSize,
|
|
87
|
-
height: borderedHandleSize,
|
|
88
|
-
borderWidth: componentTheme.handleBorderSize,
|
|
89
|
-
borderColor: componentTheme.handleBorderColor,
|
|
90
|
-
borderStyle: 'solid',
|
|
91
|
-
boxSizing: 'border-box',
|
|
92
|
-
boxShadow: boxShadowObjectsToCSSString(componentTheme.boxShadow)
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
78
|
const thumbStyle = {
|
|
97
79
|
appearance: 'none',
|
|
98
80
|
borderRadius: '50%',
|
|
99
81
|
cursor: 'pointer',
|
|
100
82
|
transition: 'all 0.15s ease-in-out',
|
|
101
83
|
background: componentTheme.handleBackground,
|
|
102
|
-
|
|
84
|
+
width: borderedHandleSize,
|
|
85
|
+
height: borderedHandleSize,
|
|
86
|
+
borderWidth: componentTheme.handleBorderSize,
|
|
87
|
+
borderColor: componentTheme.handleBorderColor,
|
|
88
|
+
borderStyle: 'solid',
|
|
89
|
+
boxSizing: 'border-box',
|
|
90
|
+
boxShadow: boxShadowObjectsToCSSString(componentTheme.boxShadow),
|
|
103
91
|
|
|
104
92
|
'&:hover': {
|
|
105
93
|
background: componentTheme.handleHoverBackground
|
|
@@ -108,31 +96,15 @@ const generateStyle = (
|
|
|
108
96
|
|
|
109
97
|
// Center the thumb vertically on the track by accounting for the track borders
|
|
110
98
|
const thumbPosition = {
|
|
111
|
-
|
|
112
|
-
marginTop: `calc(-1 * ${componentTheme.handleSize} / 4 - ${trackBorderWidth})`
|
|
113
|
-
},
|
|
114
|
-
accessible: {
|
|
115
|
-
marginTop: `calc(-1 * ${borderedHandleSize} / 4 - ${trackBorderWidth})`
|
|
116
|
-
}
|
|
99
|
+
marginTop: `calc(-1 * ${borderedHandleSize} / 4 - ${trackBorderWidth})`
|
|
117
100
|
}
|
|
118
101
|
|
|
119
102
|
const thumbFocusActiveStyle = {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
boxShadow
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
componentTheme.handleFocusOutlineColor,
|
|
126
|
-
40
|
|
127
|
-
)}`
|
|
128
|
-
},
|
|
129
|
-
accessible: {
|
|
130
|
-
background: componentTheme.handleFocusBackground,
|
|
131
|
-
boxShadow:
|
|
132
|
-
`${boxShadowObjectsToCSSString(componentTheme.boxShadow)}, ` +
|
|
133
|
-
`inset 0 0 0 ${componentTheme.handleFocusInset} ${componentTheme.handleFocusBackground}, ` +
|
|
134
|
-
`inset 0 0 0 calc(${componentTheme.handleFocusInset} + ${sharedTokens.focusOutline.width}) ${sharedTokens.focusOutline.onColor}`
|
|
135
|
-
}
|
|
103
|
+
background: componentTheme.handleFocusBackground,
|
|
104
|
+
boxShadow:
|
|
105
|
+
`${boxShadowObjectsToCSSString(componentTheme.boxShadow)}, ` +
|
|
106
|
+
`inset 0 0 0 ${componentTheme.handleFocusInset} ${componentTheme.handleFocusBackground}, ` +
|
|
107
|
+
`inset 0 0 0 calc(${componentTheme.handleFocusInset} + ${sharedTokens.focusOutline.width}) ${sharedTokens.focusOutline.onColor}`
|
|
136
108
|
}
|
|
137
109
|
|
|
138
110
|
return {
|
|
@@ -155,13 +127,13 @@ const generateStyle = (
|
|
|
155
127
|
|
|
156
128
|
'&::-webkit-slider-thumb': {
|
|
157
129
|
...thumbStyle,
|
|
158
|
-
...thumbPosition
|
|
130
|
+
...thumbPosition
|
|
159
131
|
},
|
|
160
132
|
'&::-moz-range-thumb': thumbStyle,
|
|
161
133
|
'&:focus, &:active': {
|
|
162
134
|
outline: 'none',
|
|
163
|
-
'&::-webkit-slider-thumb': thumbFocusActiveStyle
|
|
164
|
-
'&::-moz-range-thumb': thumbFocusActiveStyle
|
|
135
|
+
'&::-webkit-slider-thumb': thumbFocusActiveStyle,
|
|
136
|
+
'&::-moz-range-thumb': thumbFocusActiveStyle
|
|
165
137
|
},
|
|
166
138
|
// remove outline in FF
|
|
167
139
|
'&::-moz-focus-inner, &::-moz-focus-outer': {
|