@atlaskit/range 5.0.11 → 5.1.0
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 -0
- package/dist/cjs/styled.js +11 -7
- package/dist/cjs/theme.js +12 -14
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/styled.js +10 -7
- package/dist/es2019/theme.js +11 -14
- package/dist/es2019/version.json +1 -1
- package/dist/esm/styled.js +10 -7
- package/dist/esm/theme.js +11 -14
- package/dist/esm/version.json +1 -1
- package/dist/types/theme.d.ts +11 -14
- package/package.json +8 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/range
|
|
2
2
|
|
|
3
|
+
## 5.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`21c178539a2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/21c178539a2) - [ux] Instrumented range with the new theming package, `@atlaskit/tokens`.
|
|
8
|
+
|
|
9
|
+
New tokens will be visible only in applications configured to use the new Tokens API (currently in alpha).
|
|
10
|
+
These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking changes.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 5.0.11
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/cjs/styled.js
CHANGED
|
@@ -17,9 +17,11 @@ var _react = require("react");
|
|
|
17
17
|
|
|
18
18
|
var _core = require("@emotion/core");
|
|
19
19
|
|
|
20
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
21
|
+
|
|
20
22
|
var _constants = require("@atlaskit/theme/constants");
|
|
21
23
|
|
|
22
|
-
var
|
|
24
|
+
var _tokens = require("@atlaskit/tokens");
|
|
23
25
|
|
|
24
26
|
var _templateObject;
|
|
25
27
|
|
|
@@ -35,27 +37,28 @@ var getBackgroundGradient = function getBackgroundGradient(_ref) {
|
|
|
35
37
|
var lower = _ref.lower,
|
|
36
38
|
upper = _ref.upper;
|
|
37
39
|
return "\n background: linear-gradient(".concat(lower, ", ").concat(lower, ") 0 / var(--range-inline-width) 100%\n no-repeat ").concat(upper, ";\n [dir='rtl'] & {\n background-position: right;\n }\n ");
|
|
38
|
-
};
|
|
40
|
+
};
|
|
39
41
|
|
|
42
|
+
var elevationStyle = (0, _tokens.token)('shadow.overlay', "0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A)); // Thumb style
|
|
40
43
|
|
|
41
44
|
var sliderThumbStyle = function sliderThumbStyle(_ref2) {
|
|
42
45
|
var thumb = _ref2.thumb;
|
|
43
|
-
return "\n background: ".concat(thumb.default.background, ";\n border: ").concat(sliderThumbBorderThickness, "px solid transparent;\n border-radius: 50%;\n height: ").concat(sliderThumbSize, "px;\n width: ").concat(sliderThumbSize, "px;\n box-sizing: border-box;\n transition: border-color ").concat(transitionDuration, " ease-in-out;\n ").concat(
|
|
46
|
+
return "\n background: ".concat(thumb.default.background, ";\n border: ").concat(sliderThumbBorderThickness, "px solid transparent;\n border-radius: 50%;\n height: ").concat(sliderThumbSize, "px;\n width: ").concat(sliderThumbSize, "px;\n box-sizing: border-box;\n transition: border-color ").concat(transitionDuration, " ease-in-out;\n box-shadow: ").concat(elevationStyle, "\n ");
|
|
44
47
|
}; // Track styles
|
|
45
48
|
|
|
46
49
|
|
|
47
50
|
var sliderTrackStyle = "\n border-radius: ".concat(sliderBorderRadius, "px;\n border: 0;\n cursor: pointer;\n height: ").concat(sliderLineThickness, "px;\n width: 100%;\n transition: background-color ").concat(transitionDuration, " ease-in-out;\n"); // Range input styles
|
|
48
51
|
|
|
49
52
|
var chromeRangeInputStyle = function chromeRangeInputStyle(tokens) {
|
|
50
|
-
return "\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n margin-top: -".concat((sliderThumbSize - sliderLineThickness) / 2, "px;\n ").concat(sliderThumbStyle(tokens), ";\n }\n\n &:focus::-webkit-slider-thumb {\n border-color: ").concat(tokens.thumb.focus.border, ";\n }\n\n &:disabled::-webkit-slider-thumb {\n cursor: not-allowed;\n box-shadow:
|
|
53
|
+
return "\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n margin-top: -".concat((sliderThumbSize - sliderLineThickness) / 2, "px;\n ").concat(sliderThumbStyle(tokens), ";\n }\n\n &:focus::-webkit-slider-thumb {\n border-color: ").concat(tokens.thumb.focus.border, ";\n }\n\n &:disabled::-webkit-slider-thumb {\n cursor: not-allowed;\n box-shadow: ").concat(tokens.thumb.disabled.boxShadow, ";\n }\n\n &::-webkit-slider-runnable-track {\n ").concat(sliderTrackStyle, ";\n ").concat(getBackgroundGradient(tokens.track.default), ";\n }\n\n &:focus::-webkit-slider-runnable-track {\n ").concat(getBackgroundGradient(tokens.track.default), ";\n }\n\n &:active::-webkit-slider-runnable-track,\n &:hover::-webkit-slider-runnable-track {\n ").concat(getBackgroundGradient(tokens.track.hover), ";\n }\n\n &:disabled::-webkit-slider-runnable-track {\n ").concat(getBackgroundGradient(tokens.track.disabled), "\n cursor: not-allowed;\n }\n ");
|
|
51
54
|
};
|
|
52
55
|
|
|
53
56
|
var firefoxRangeInputStyle = function firefoxRangeInputStyle(tokens) {
|
|
54
|
-
return "\n &::-moz-focus-outer {\n border: 0;\n }\n\n &::-moz-range-thumb {\n ".concat(sliderThumbStyle(tokens), ";\n }\n\n &:focus::-moz-range-thumb {\n border-color: ").concat(tokens.thumb.focus.border, ";\n }\n\n &:disabled::-moz-range-thumb {\n cursor: not-allowed;\n box-shadow:
|
|
57
|
+
return "\n &::-moz-focus-outer {\n border: 0;\n }\n\n &::-moz-range-thumb {\n ".concat(sliderThumbStyle(tokens), ";\n }\n\n &:focus::-moz-range-thumb {\n border-color: ").concat(tokens.thumb.focus.border, ";\n }\n\n &:disabled::-moz-range-thumb {\n cursor: not-allowed;\n box-shadow: ").concat(tokens.thumb.disabled.boxShadow, ";\n }\n\n &::-moz-range-progress {\n ").concat(sliderTrackStyle, ";\n background: ").concat(tokens.track.default.lower, ";\n }\n\n &::-moz-range-track {\n ").concat(sliderTrackStyle, ";\n background: ").concat(tokens.track.default.upper, ";\n }\n\n &:active::-moz-range-progress,\n &:hover::-moz-range-progress {\n background: ").concat(tokens.track.hover.lower, ";\n }\n\n &:active::-moz-range-track,\n &:hover::-moz-range-track {\n background: ").concat(tokens.track.hover.upper, ";\n }\n\n &:disabled::-moz-range-progress {\n background: ").concat(tokens.track.disabled.lower, ";\n cursor: not-allowed;\n }\n\n &:disabled::-moz-range-track {\n background: ").concat(tokens.track.disabled.upper, ";\n cursor: not-allowed;\n }\n");
|
|
55
58
|
};
|
|
56
59
|
|
|
57
60
|
var IERangeInputStyle = function IERangeInputStyle(tokens) {
|
|
58
|
-
return "\n &::-ms-thumb {\n margin-top: 0;\n ".concat(sliderThumbStyle(tokens), ";\n }\n\n &:focus::-ms-thumb {\n border-color: ").concat(tokens.thumb.focus.border, ";\n }\n\n &:disabled::-ms-thumb {\n cursor: not-allowed;\n box-shadow:
|
|
61
|
+
return "\n &::-ms-thumb {\n margin-top: 0;\n ".concat(sliderThumbStyle(tokens), ";\n }\n\n &:focus::-ms-thumb {\n border-color: ").concat(tokens.thumb.focus.border, ";\n }\n\n &:disabled::-ms-thumb {\n cursor: not-allowed;\n box-shadow: ").concat(tokens.thumb.disabled.boxShadow, ";\n }\n\n &::-ms-track {\n background: transparent;\n border-color: transparent;\n color: transparent;\n cursor: pointer;\n height: ").concat(sliderLineThickness, "px;\n transition: background-color ").concat(transitionDuration, " ease-in-out;\n width: 100%;\n }\n\n &::-ms-fill-lower {\n background: ").concat(tokens.track.default.lower, ";\n border-radius: ").concat(sliderBorderRadius, "px;\n border: 0;\n }\n\n &::-ms-fill-upper {\n background: ").concat(tokens.track.default.upper, ";\n border-radius: ").concat(sliderBorderRadius, "px;\n border: 0;\n }\n\n &:active::-ms-fill-lower,\n &:hover::-ms-fill-lower {\n background: ").concat(tokens.track.hover.lower, ";\n }\n\n &:active::-ms-fill-upper,\n &:hover::-ms-fill-upper {\n background: ").concat(tokens.track.hover.upper, ";\n }\n\n &:disabled::-ms-fill-lower {\n background: ").concat(tokens.track.disabled.lower, ";\n cursor: not-allowed;\n }\n\n &:disabled::-ms-fill-upper {\n background: ").concat(tokens.track.disabled.upper, ";\n cursor: not-allowed;\n }\n");
|
|
59
62
|
}; // Styles are split per browser as they are implemented differently
|
|
60
63
|
// Cannot consolidate as Chrome & Firefox don't recognise styles if they are grouped
|
|
61
64
|
// with CSS selectors they don't recognise, e.g. &::-ms-thumb
|
|
@@ -86,7 +89,8 @@ var Input = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
86
89
|
style: {
|
|
87
90
|
'--range-inline-width': "".concat(valuePercent, "%")
|
|
88
91
|
},
|
|
89
|
-
ref: ref
|
|
92
|
+
ref: ref // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
93
|
+
,
|
|
90
94
|
css: styles
|
|
91
95
|
}));
|
|
92
96
|
});
|
package/dist/cjs/theme.js
CHANGED
|
@@ -11,39 +11,37 @@ var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
|
11
11
|
|
|
12
12
|
var _components = require("@atlaskit/theme/components");
|
|
13
13
|
|
|
14
|
+
var _tokens = require("@atlaskit/tokens");
|
|
15
|
+
|
|
14
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
17
|
|
|
16
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
19
|
|
|
18
20
|
var thumb = {
|
|
19
21
|
default: {
|
|
20
|
-
background: colors.N0
|
|
21
|
-
// This border color is not being used - awaiting focus state lift to props
|
|
22
|
-
border: colors.N800
|
|
22
|
+
background: (0, _tokens.token)('color.background.card', colors.N0)
|
|
23
23
|
},
|
|
24
24
|
disabled: {
|
|
25
|
-
boxShadow: colors.N60A
|
|
25
|
+
boxShadow: (0, _tokens.token)('shadow.card', "0 0 1px ".concat(colors.N60A))
|
|
26
26
|
},
|
|
27
27
|
focus: {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
border: colors.B200
|
|
28
|
+
background: (0, _tokens.token)('color.background.boldNeutral.resting', colors.N0),
|
|
29
|
+
border: (0, _tokens.token)('color.border.focus', colors.B200)
|
|
31
30
|
}
|
|
32
31
|
};
|
|
33
32
|
exports.thumb = thumb;
|
|
34
33
|
var track = {
|
|
35
|
-
background: colors.N30A,
|
|
36
34
|
default: {
|
|
37
|
-
lower: colors.B400,
|
|
38
|
-
upper: colors.N30
|
|
35
|
+
lower: (0, _tokens.token)('color.background.boldBrand.resting', colors.B400),
|
|
36
|
+
upper: (0, _tokens.token)('color.background.subtleNeutral.resting', colors.N30)
|
|
39
37
|
},
|
|
40
38
|
disabled: {
|
|
41
|
-
lower: colors.N50,
|
|
42
|
-
upper: colors.N30
|
|
39
|
+
lower: (0, _tokens.token)('color.text.disabled', colors.N50),
|
|
40
|
+
upper: (0, _tokens.token)('color.background.disabled', colors.N30)
|
|
43
41
|
},
|
|
44
42
|
hover: {
|
|
45
|
-
lower: colors.B300,
|
|
46
|
-
upper: colors.N40
|
|
43
|
+
lower: (0, _tokens.token)('color.background.boldBrand.hover', colors.B300),
|
|
44
|
+
upper: (0, _tokens.token)('color.background.subtleNeutral.hover', colors.N40)
|
|
47
45
|
}
|
|
48
46
|
};
|
|
49
47
|
exports.track = track;
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/styled.js
CHANGED
|
@@ -5,8 +5,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
5
5
|
/* eslint-disable no-mixed-operators */
|
|
6
6
|
import { forwardRef, useMemo } from 'react';
|
|
7
7
|
import { css, jsx } from '@emotion/core';
|
|
8
|
+
import { N50A, N60A } from '@atlaskit/theme/colors';
|
|
8
9
|
import { fontFamily } from '@atlaskit/theme/constants';
|
|
9
|
-
import {
|
|
10
|
+
import { token } from '@atlaskit/tokens';
|
|
10
11
|
const sliderThumbSize = 16;
|
|
11
12
|
const sliderThumbBorderThickness = 2;
|
|
12
13
|
const sliderLineThickness = 4;
|
|
@@ -23,8 +24,9 @@ const getBackgroundGradient = ({
|
|
|
23
24
|
[dir='rtl'] & {
|
|
24
25
|
background-position: right;
|
|
25
26
|
}
|
|
26
|
-
`;
|
|
27
|
+
`;
|
|
27
28
|
|
|
29
|
+
const elevationStyle = token('shadow.overlay', `0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`); // Thumb style
|
|
28
30
|
|
|
29
31
|
const sliderThumbStyle = ({
|
|
30
32
|
thumb
|
|
@@ -37,7 +39,7 @@ const sliderThumbStyle = ({
|
|
|
37
39
|
width: ${sliderThumbSize}px;
|
|
38
40
|
box-sizing: border-box;
|
|
39
41
|
transition: border-color ${transitionDuration} ease-in-out;
|
|
40
|
-
${
|
|
42
|
+
box-shadow: ${elevationStyle}
|
|
41
43
|
`;
|
|
42
44
|
}; // Track styles
|
|
43
45
|
|
|
@@ -65,7 +67,7 @@ const chromeRangeInputStyle = tokens => {
|
|
|
65
67
|
|
|
66
68
|
&:disabled::-webkit-slider-thumb {
|
|
67
69
|
cursor: not-allowed;
|
|
68
|
-
box-shadow:
|
|
70
|
+
box-shadow: ${tokens.thumb.disabled.boxShadow};
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
&::-webkit-slider-runnable-track {
|
|
@@ -105,7 +107,7 @@ const firefoxRangeInputStyle = tokens => {
|
|
|
105
107
|
|
|
106
108
|
&:disabled::-moz-range-thumb {
|
|
107
109
|
cursor: not-allowed;
|
|
108
|
-
box-shadow:
|
|
110
|
+
box-shadow: ${tokens.thumb.disabled.boxShadow};
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
&::-moz-range-progress {
|
|
@@ -153,7 +155,7 @@ const IERangeInputStyle = tokens => {
|
|
|
153
155
|
|
|
154
156
|
&:disabled::-ms-thumb {
|
|
155
157
|
cursor: not-allowed;
|
|
156
|
-
box-shadow:
|
|
158
|
+
box-shadow: ${tokens.thumb.disabled.boxShadow};
|
|
157
159
|
}
|
|
158
160
|
|
|
159
161
|
&::-ms-track {
|
|
@@ -248,7 +250,8 @@ export const Input = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
248
250
|
style: {
|
|
249
251
|
'--range-inline-width': `${valuePercent}%`
|
|
250
252
|
},
|
|
251
|
-
ref: ref
|
|
253
|
+
ref: ref // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
254
|
+
,
|
|
252
255
|
css: styles
|
|
253
256
|
}));
|
|
254
257
|
});
|
package/dist/es2019/theme.js
CHANGED
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
import * as colors from '@atlaskit/theme/colors';
|
|
2
2
|
import { createTheme } from '@atlaskit/theme/components';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
3
4
|
export const thumb = {
|
|
4
5
|
default: {
|
|
5
|
-
background: colors.N0
|
|
6
|
-
// This border color is not being used - awaiting focus state lift to props
|
|
7
|
-
border: colors.N800
|
|
6
|
+
background: token('color.background.card', colors.N0)
|
|
8
7
|
},
|
|
9
8
|
disabled: {
|
|
10
|
-
boxShadow: colors.N60A
|
|
9
|
+
boxShadow: token('shadow.card', `0 0 1px ${colors.N60A}`)
|
|
11
10
|
},
|
|
12
11
|
focus: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
border: colors.B200
|
|
12
|
+
background: token('color.background.boldNeutral.resting', colors.N0),
|
|
13
|
+
border: token('color.border.focus', colors.B200)
|
|
16
14
|
}
|
|
17
15
|
};
|
|
18
16
|
export const track = {
|
|
19
|
-
background: colors.N30A,
|
|
20
17
|
default: {
|
|
21
|
-
lower: colors.B400,
|
|
22
|
-
upper: colors.N30
|
|
18
|
+
lower: token('color.background.boldBrand.resting', colors.B400),
|
|
19
|
+
upper: token('color.background.subtleNeutral.resting', colors.N30)
|
|
23
20
|
},
|
|
24
21
|
disabled: {
|
|
25
|
-
lower: colors.N50,
|
|
26
|
-
upper: colors.N30
|
|
22
|
+
lower: token('color.text.disabled', colors.N50),
|
|
23
|
+
upper: token('color.background.disabled', colors.N30)
|
|
27
24
|
},
|
|
28
25
|
hover: {
|
|
29
|
-
lower: colors.B300,
|
|
30
|
-
upper: colors.N40
|
|
26
|
+
lower: token('color.background.boldBrand.hover', colors.B300),
|
|
27
|
+
upper: token('color.background.subtleNeutral.hover', colors.N40)
|
|
31
28
|
}
|
|
32
29
|
};
|
|
33
30
|
export const Theme = createTheme(() => ({
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/styled.js
CHANGED
|
@@ -9,8 +9,9 @@ var _templateObject;
|
|
|
9
9
|
/* eslint-disable no-mixed-operators */
|
|
10
10
|
import { forwardRef, useMemo } from 'react';
|
|
11
11
|
import { css, jsx } from '@emotion/core';
|
|
12
|
+
import { N50A, N60A } from '@atlaskit/theme/colors';
|
|
12
13
|
import { fontFamily } from '@atlaskit/theme/constants';
|
|
13
|
-
import {
|
|
14
|
+
import { token } from '@atlaskit/tokens';
|
|
14
15
|
var sliderThumbSize = 16;
|
|
15
16
|
var sliderThumbBorderThickness = 2;
|
|
16
17
|
var sliderLineThickness = 4;
|
|
@@ -22,27 +23,28 @@ var getBackgroundGradient = function getBackgroundGradient(_ref) {
|
|
|
22
23
|
var lower = _ref.lower,
|
|
23
24
|
upper = _ref.upper;
|
|
24
25
|
return "\n background: linear-gradient(".concat(lower, ", ").concat(lower, ") 0 / var(--range-inline-width) 100%\n no-repeat ").concat(upper, ";\n [dir='rtl'] & {\n background-position: right;\n }\n ");
|
|
25
|
-
};
|
|
26
|
+
};
|
|
26
27
|
|
|
28
|
+
var elevationStyle = token('shadow.overlay', "0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A)); // Thumb style
|
|
27
29
|
|
|
28
30
|
var sliderThumbStyle = function sliderThumbStyle(_ref2) {
|
|
29
31
|
var thumb = _ref2.thumb;
|
|
30
|
-
return "\n background: ".concat(thumb.default.background, ";\n border: ").concat(sliderThumbBorderThickness, "px solid transparent;\n border-radius: 50%;\n height: ").concat(sliderThumbSize, "px;\n width: ").concat(sliderThumbSize, "px;\n box-sizing: border-box;\n transition: border-color ").concat(transitionDuration, " ease-in-out;\n ").concat(
|
|
32
|
+
return "\n background: ".concat(thumb.default.background, ";\n border: ").concat(sliderThumbBorderThickness, "px solid transparent;\n border-radius: 50%;\n height: ").concat(sliderThumbSize, "px;\n width: ").concat(sliderThumbSize, "px;\n box-sizing: border-box;\n transition: border-color ").concat(transitionDuration, " ease-in-out;\n box-shadow: ").concat(elevationStyle, "\n ");
|
|
31
33
|
}; // Track styles
|
|
32
34
|
|
|
33
35
|
|
|
34
36
|
var sliderTrackStyle = "\n border-radius: ".concat(sliderBorderRadius, "px;\n border: 0;\n cursor: pointer;\n height: ").concat(sliderLineThickness, "px;\n width: 100%;\n transition: background-color ").concat(transitionDuration, " ease-in-out;\n"); // Range input styles
|
|
35
37
|
|
|
36
38
|
var chromeRangeInputStyle = function chromeRangeInputStyle(tokens) {
|
|
37
|
-
return "\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n margin-top: -".concat((sliderThumbSize - sliderLineThickness) / 2, "px;\n ").concat(sliderThumbStyle(tokens), ";\n }\n\n &:focus::-webkit-slider-thumb {\n border-color: ").concat(tokens.thumb.focus.border, ";\n }\n\n &:disabled::-webkit-slider-thumb {\n cursor: not-allowed;\n box-shadow:
|
|
39
|
+
return "\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n margin-top: -".concat((sliderThumbSize - sliderLineThickness) / 2, "px;\n ").concat(sliderThumbStyle(tokens), ";\n }\n\n &:focus::-webkit-slider-thumb {\n border-color: ").concat(tokens.thumb.focus.border, ";\n }\n\n &:disabled::-webkit-slider-thumb {\n cursor: not-allowed;\n box-shadow: ").concat(tokens.thumb.disabled.boxShadow, ";\n }\n\n &::-webkit-slider-runnable-track {\n ").concat(sliderTrackStyle, ";\n ").concat(getBackgroundGradient(tokens.track.default), ";\n }\n\n &:focus::-webkit-slider-runnable-track {\n ").concat(getBackgroundGradient(tokens.track.default), ";\n }\n\n &:active::-webkit-slider-runnable-track,\n &:hover::-webkit-slider-runnable-track {\n ").concat(getBackgroundGradient(tokens.track.hover), ";\n }\n\n &:disabled::-webkit-slider-runnable-track {\n ").concat(getBackgroundGradient(tokens.track.disabled), "\n cursor: not-allowed;\n }\n ");
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
var firefoxRangeInputStyle = function firefoxRangeInputStyle(tokens) {
|
|
41
|
-
return "\n &::-moz-focus-outer {\n border: 0;\n }\n\n &::-moz-range-thumb {\n ".concat(sliderThumbStyle(tokens), ";\n }\n\n &:focus::-moz-range-thumb {\n border-color: ").concat(tokens.thumb.focus.border, ";\n }\n\n &:disabled::-moz-range-thumb {\n cursor: not-allowed;\n box-shadow:
|
|
43
|
+
return "\n &::-moz-focus-outer {\n border: 0;\n }\n\n &::-moz-range-thumb {\n ".concat(sliderThumbStyle(tokens), ";\n }\n\n &:focus::-moz-range-thumb {\n border-color: ").concat(tokens.thumb.focus.border, ";\n }\n\n &:disabled::-moz-range-thumb {\n cursor: not-allowed;\n box-shadow: ").concat(tokens.thumb.disabled.boxShadow, ";\n }\n\n &::-moz-range-progress {\n ").concat(sliderTrackStyle, ";\n background: ").concat(tokens.track.default.lower, ";\n }\n\n &::-moz-range-track {\n ").concat(sliderTrackStyle, ";\n background: ").concat(tokens.track.default.upper, ";\n }\n\n &:active::-moz-range-progress,\n &:hover::-moz-range-progress {\n background: ").concat(tokens.track.hover.lower, ";\n }\n\n &:active::-moz-range-track,\n &:hover::-moz-range-track {\n background: ").concat(tokens.track.hover.upper, ";\n }\n\n &:disabled::-moz-range-progress {\n background: ").concat(tokens.track.disabled.lower, ";\n cursor: not-allowed;\n }\n\n &:disabled::-moz-range-track {\n background: ").concat(tokens.track.disabled.upper, ";\n cursor: not-allowed;\n }\n");
|
|
42
44
|
};
|
|
43
45
|
|
|
44
46
|
var IERangeInputStyle = function IERangeInputStyle(tokens) {
|
|
45
|
-
return "\n &::-ms-thumb {\n margin-top: 0;\n ".concat(sliderThumbStyle(tokens), ";\n }\n\n &:focus::-ms-thumb {\n border-color: ").concat(tokens.thumb.focus.border, ";\n }\n\n &:disabled::-ms-thumb {\n cursor: not-allowed;\n box-shadow:
|
|
47
|
+
return "\n &::-ms-thumb {\n margin-top: 0;\n ".concat(sliderThumbStyle(tokens), ";\n }\n\n &:focus::-ms-thumb {\n border-color: ").concat(tokens.thumb.focus.border, ";\n }\n\n &:disabled::-ms-thumb {\n cursor: not-allowed;\n box-shadow: ").concat(tokens.thumb.disabled.boxShadow, ";\n }\n\n &::-ms-track {\n background: transparent;\n border-color: transparent;\n color: transparent;\n cursor: pointer;\n height: ").concat(sliderLineThickness, "px;\n transition: background-color ").concat(transitionDuration, " ease-in-out;\n width: 100%;\n }\n\n &::-ms-fill-lower {\n background: ").concat(tokens.track.default.lower, ";\n border-radius: ").concat(sliderBorderRadius, "px;\n border: 0;\n }\n\n &::-ms-fill-upper {\n background: ").concat(tokens.track.default.upper, ";\n border-radius: ").concat(sliderBorderRadius, "px;\n border: 0;\n }\n\n &:active::-ms-fill-lower,\n &:hover::-ms-fill-lower {\n background: ").concat(tokens.track.hover.lower, ";\n }\n\n &:active::-ms-fill-upper,\n &:hover::-ms-fill-upper {\n background: ").concat(tokens.track.hover.upper, ";\n }\n\n &:disabled::-ms-fill-lower {\n background: ").concat(tokens.track.disabled.lower, ";\n cursor: not-allowed;\n }\n\n &:disabled::-ms-fill-upper {\n background: ").concat(tokens.track.disabled.upper, ";\n cursor: not-allowed;\n }\n");
|
|
46
48
|
}; // Styles are split per browser as they are implemented differently
|
|
47
49
|
// Cannot consolidate as Chrome & Firefox don't recognise styles if they are grouped
|
|
48
50
|
// with CSS selectors they don't recognise, e.g. &::-ms-thumb
|
|
@@ -72,7 +74,8 @@ export var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
72
74
|
style: {
|
|
73
75
|
'--range-inline-width': "".concat(valuePercent, "%")
|
|
74
76
|
},
|
|
75
|
-
ref: ref
|
|
77
|
+
ref: ref // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
|
|
78
|
+
,
|
|
76
79
|
css: styles
|
|
77
80
|
}));
|
|
78
81
|
});
|
package/dist/esm/theme.js
CHANGED
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
import * as colors from '@atlaskit/theme/colors';
|
|
2
2
|
import { createTheme } from '@atlaskit/theme/components';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
3
4
|
export var thumb = {
|
|
4
5
|
default: {
|
|
5
|
-
background: colors.N0
|
|
6
|
-
// This border color is not being used - awaiting focus state lift to props
|
|
7
|
-
border: colors.N800
|
|
6
|
+
background: token('color.background.card', colors.N0)
|
|
8
7
|
},
|
|
9
8
|
disabled: {
|
|
10
|
-
boxShadow: colors.N60A
|
|
9
|
+
boxShadow: token('shadow.card', "0 0 1px ".concat(colors.N60A))
|
|
11
10
|
},
|
|
12
11
|
focus: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
border: colors.B200
|
|
12
|
+
background: token('color.background.boldNeutral.resting', colors.N0),
|
|
13
|
+
border: token('color.border.focus', colors.B200)
|
|
16
14
|
}
|
|
17
15
|
};
|
|
18
16
|
export var track = {
|
|
19
|
-
background: colors.N30A,
|
|
20
17
|
default: {
|
|
21
|
-
lower: colors.B400,
|
|
22
|
-
upper: colors.N30
|
|
18
|
+
lower: token('color.background.boldBrand.resting', colors.B400),
|
|
19
|
+
upper: token('color.background.subtleNeutral.resting', colors.N30)
|
|
23
20
|
},
|
|
24
21
|
disabled: {
|
|
25
|
-
lower: colors.N50,
|
|
26
|
-
upper: colors.N30
|
|
22
|
+
lower: token('color.text.disabled', colors.N50),
|
|
23
|
+
upper: token('color.background.disabled', colors.N30)
|
|
27
24
|
},
|
|
28
25
|
hover: {
|
|
29
|
-
lower: colors.B300,
|
|
30
|
-
upper: colors.N40
|
|
26
|
+
lower: token('color.background.boldBrand.hover', colors.B300),
|
|
27
|
+
upper: token('color.background.subtleNeutral.hover', colors.N40)
|
|
31
28
|
}
|
|
32
29
|
};
|
|
33
30
|
export var Theme = createTheme(function () {
|
package/dist/esm/version.json
CHANGED
package/dist/types/theme.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface ThemeTokensThumb {
|
|
3
3
|
background: string;
|
|
4
|
-
border
|
|
4
|
+
border?: string;
|
|
5
5
|
}
|
|
6
6
|
export interface ThemeTokensTrack {
|
|
7
7
|
lower: string;
|
|
@@ -16,7 +16,6 @@ export interface ThemeTokens {
|
|
|
16
16
|
focus: ThemeTokensThumb;
|
|
17
17
|
};
|
|
18
18
|
track: {
|
|
19
|
-
background: string;
|
|
20
19
|
default: ThemeTokensTrack;
|
|
21
20
|
disabled: ThemeTokensTrack;
|
|
22
21
|
hover: ThemeTokensTrack;
|
|
@@ -24,30 +23,28 @@ export interface ThemeTokens {
|
|
|
24
23
|
}
|
|
25
24
|
export declare const thumb: {
|
|
26
25
|
default: {
|
|
27
|
-
background:
|
|
28
|
-
border: string;
|
|
26
|
+
background: "var(--ds-background-card)";
|
|
29
27
|
};
|
|
30
28
|
disabled: {
|
|
31
|
-
boxShadow:
|
|
29
|
+
boxShadow: "var(--ds-card)";
|
|
32
30
|
};
|
|
33
31
|
focus: {
|
|
34
|
-
background:
|
|
35
|
-
border:
|
|
32
|
+
background: "var(--ds-background-boldNeutral-resting)";
|
|
33
|
+
border: "var(--ds-border-focus)";
|
|
36
34
|
};
|
|
37
35
|
};
|
|
38
36
|
export declare const track: {
|
|
39
|
-
background: string;
|
|
40
37
|
default: {
|
|
41
|
-
lower:
|
|
42
|
-
upper:
|
|
38
|
+
lower: "var(--ds-background-boldBrand-resting)";
|
|
39
|
+
upper: "var(--ds-background-subtleNeutral-resting)";
|
|
43
40
|
};
|
|
44
41
|
disabled: {
|
|
45
|
-
lower:
|
|
46
|
-
upper:
|
|
42
|
+
lower: "var(--ds-text-disabled)";
|
|
43
|
+
upper: "var(--ds-background-disabled)";
|
|
47
44
|
};
|
|
48
45
|
hover: {
|
|
49
|
-
lower:
|
|
50
|
-
upper:
|
|
46
|
+
lower: "var(--ds-background-boldBrand-hover)";
|
|
47
|
+
upper: "var(--ds-background-subtleNeutral-hover)";
|
|
51
48
|
};
|
|
52
49
|
};
|
|
53
50
|
export declare const Theme: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/range",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "A range lets users choose an approximate value on a slider.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@atlaskit/theme": "^12.0.0",
|
|
29
|
+
"@atlaskit/tokens": "^0.3.0",
|
|
29
30
|
"@babel/runtime": "^7.0.0",
|
|
30
31
|
"@emotion/core": "^10.0.9"
|
|
31
32
|
},
|
|
@@ -62,17 +63,12 @@
|
|
|
62
63
|
"import-structure": "atlassian-conventions"
|
|
63
64
|
},
|
|
64
65
|
"@repo/internal": {
|
|
65
|
-
"ui-components":
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"theming": [
|
|
72
|
-
"new-theming-api"
|
|
73
|
-
],
|
|
74
|
-
"deprecation": [
|
|
75
|
-
"no-deprecated-imports"
|
|
66
|
+
"ui-components": "lite-mode",
|
|
67
|
+
"analytics": "analytics-next",
|
|
68
|
+
"theming": "tokens",
|
|
69
|
+
"deprecation": "no-deprecated-imports",
|
|
70
|
+
"styling": [
|
|
71
|
+
"emotion"
|
|
76
72
|
]
|
|
77
73
|
}
|
|
78
74
|
},
|