@atlaskit/range 7.4.5 → 8.0.1
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 +23 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-jira/tsconfig.json +3 -0
- package/afm-post-office/tsconfig.json +3 -0
- package/dist/cjs/styled.compiled.css +72 -0
- package/dist/cjs/styled.js +32 -126
- package/dist/es2019/styled.compiled.css +72 -0
- package/dist/es2019/styled.js +16 -161
- package/dist/esm/styled.compiled.css +72 -0
- package/dist/esm/styled.js +30 -128
- package/dist/types/range.d.ts +1 -1
- package/dist/types/styled.d.ts +0 -4
- package/dist/types-ts4.5/range.d.ts +1 -1
- package/dist/types-ts4.5/styled.d.ts +0 -4
- package/package.json +9 -7
- package/tsconfig.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/range
|
|
2
2
|
|
|
3
|
+
## 8.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#100413](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100413)
|
|
8
|
+
[`e4d6f320b1650`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e4d6f320b1650) -
|
|
9
|
+
Fix styling of our @atlaskit/range component lost in v8.0.0 rendering the component invisible.
|
|
10
|
+
|
|
11
|
+
## 8.0.0
|
|
12
|
+
|
|
13
|
+
### Major Changes
|
|
14
|
+
|
|
15
|
+
- [#172418](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/172418)
|
|
16
|
+
[`8a5e8d3d28432`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8a5e8d3d28432) -
|
|
17
|
+
Migrated from `@emotion/react` to `@compiled/react` in order to improve performance, align with
|
|
18
|
+
the rest of the Atlaskit techstack, and support React 18 Streaming SSR. Please note, in order to
|
|
19
|
+
use this version of `@atlaskit/range`, you will need to ensure that your bundler is configured to
|
|
20
|
+
handle `.css` imports correctly. Most bundlers come with built-in support for `.css` imports, so
|
|
21
|
+
you may not need to do anything. If you are using a different bundler, please refer to the
|
|
22
|
+
documentation for that bundler to understand how to handle `.css` imports. For more information on
|
|
23
|
+
the migration, please refer to
|
|
24
|
+
[RFC-73 Migrating our components to Compiled CSS-in-JS](https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953).
|
|
25
|
+
|
|
3
26
|
## 7.4.5
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
package/afm-jira/tsconfig.json
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
._108m1q5u::-moz-range-thumb{border-radius:var(--ds-border-radius-circle,50%)}
|
|
2
|
+
._10lridpf::-webkit-slider-runnable-track{border:0}
|
|
3
|
+
._15raidpf::-moz-focus-outer{border:0}
|
|
4
|
+
._1gvoyh40::-moz-range-track{border-radius:2px}
|
|
5
|
+
._1kdl1q5u::-webkit-slider-thumb{border-radius:var(--ds-border-radius-circle,50%)}
|
|
6
|
+
._1nx42hjt::-moz-range-track{transition:background-color .2s ease-in-out;-moz-transition:background-color .2s ease-in-out}
|
|
7
|
+
._1rf3g56u::-moz-range-thumb{outline:solid 2px var(--thumb-border)}
|
|
8
|
+
._1tcb2hjt::-moz-range-progress{transition:background-color .2s ease-in-out;-moz-transition:background-color .2s ease-in-out}
|
|
9
|
+
._1yeu2hjt::-moz-range-thumb{transition:background-color .2s ease-in-out;-moz-transition:background-color .2s ease-in-out}
|
|
10
|
+
._1yq0glyw::-moz-range-thumb{border:none}
|
|
11
|
+
._1yz62hjt::-webkit-slider-thumb{transition:background-color .2s ease-in-out;-webkit-transition:background-color .2s ease-in-out}
|
|
12
|
+
._37ywyh40::-moz-range-progress{border-radius:2px}
|
|
13
|
+
._e8hnidpf::-moz-range-progress{border:0}
|
|
14
|
+
._g6tdyh40::-webkit-slider-runnable-track{border-radius:2px}
|
|
15
|
+
._h2ksglyw::-webkit-slider-thumb{border:none}
|
|
16
|
+
._m8f8g56u::-webkit-slider-thumb{outline:solid 2px var(--thumb-border)}
|
|
17
|
+
._ru37idpf::-moz-range-track{border:0}
|
|
18
|
+
._vi4t2hjt::-webkit-slider-runnable-track{transition:background-color .2s ease-in-out;-webkit-transition:background-color .2s ease-in-out}
|
|
19
|
+
._10o7tlke::-moz-range-thumb{cursor:pointer}
|
|
20
|
+
._12el4alp::-moz-range-thumb{background-color:var(--_171tp53)}
|
|
21
|
+
._142y1y44::-moz-range-track{height:4px}
|
|
22
|
+
._14h11gpr{--thumb-shadow:var(--_cghoza)}
|
|
23
|
+
._15dpptpz{--track-bg:var(--_19g1tth)}
|
|
24
|
+
._168l1y44::-webkit-slider-runnable-track{height:4px}
|
|
25
|
+
._18k7v77o::-webkit-slider-thumb{outline-offset:var(--ds-space-025,2px)}
|
|
26
|
+
._18lx1n8f{--track-fg:var(--_1eby16r)}
|
|
27
|
+
._18tdtlke::-webkit-slider-runnable-track{cursor:pointer}
|
|
28
|
+
._1bdkusvi::-webkit-slider-thumb{box-sizing:border-box}
|
|
29
|
+
._1bsb1osq{width:100%}
|
|
30
|
+
._1cdcglyw::-webkit-slider-thumb{-webkit-appearance:none}
|
|
31
|
+
._1d8tmgnk::-webkit-slider-runnable-track{background-repeat:no-repeat}
|
|
32
|
+
._1esf4alp::-webkit-slider-thumb{background-color:var(--_171tp53)}
|
|
33
|
+
._1f5t1osq::-moz-range-track{width:100%}
|
|
34
|
+
._1fov13gf:disabled::-moz-range-progress{cursor:not-allowed}
|
|
35
|
+
._1g2h1osq::-webkit-slider-runnable-track{width:100%}
|
|
36
|
+
._1g741hsc::-webkit-slider-runnable-track{background-image:linear-gradient(var(--track-fg),var(--track-fg))}
|
|
37
|
+
._1j552wxo:disabled{opacity:var(--ds-opacity-disabled,.4)}
|
|
38
|
+
._1j707vkz::-webkit-slider-thumb{height:1pc}
|
|
39
|
+
._1jhcjiw3:hover:not(:disabled){--track-fg:var(--_14t3dsg)}
|
|
40
|
+
._1kd21y44::-moz-range-progress{height:4px}
|
|
41
|
+
._1kzev77o::-moz-range-thumb{outline-offset:var(--ds-space-025,2px)}
|
|
42
|
+
._1mn57vkz::-moz-range-thumb{height:1pc}
|
|
43
|
+
._1oqe1ik2::-moz-range-thumb{box-shadow:var(--thumb-shadow)}
|
|
44
|
+
._1p201osq:dir(rtl)::-webkit-slider-runnable-track{background-position:100%}
|
|
45
|
+
._1rucy2jz:active:not(:disabled){--thumb-bg:var(--_1pam7of)}
|
|
46
|
+
._1sdc196n::-webkit-slider-thumb{margin-block-start:var(--ds-space-negative-075,-6px)}
|
|
47
|
+
._1ssqtlke::-moz-range-progress{cursor:pointer}
|
|
48
|
+
._1vq313gf:disabled::-moz-range-thumb{cursor:not-allowed}
|
|
49
|
+
._1yte13gf:disabled::-webkit-slider-thumb{cursor:not-allowed}
|
|
50
|
+
._34m613gf:disabled::-moz-range-track{cursor:not-allowed}
|
|
51
|
+
._4t3i1ylp{height:40px}
|
|
52
|
+
._4w431ik2::-webkit-slider-thumb{box-shadow:var(--thumb-shadow)}
|
|
53
|
+
._5i7a13gf:disabled::-webkit-slider-runnable-track{cursor:not-allowed}
|
|
54
|
+
._9u3f2hce::-webkit-slider-runnable-track{background-color:var(--track-bg)}
|
|
55
|
+
._aoww1osq::-moz-range-progress{width:100%}
|
|
56
|
+
._b3fmtlke::-moz-range-track{cursor:pointer}
|
|
57
|
+
._bfhk18uv{background-color:initial}
|
|
58
|
+
._d7w62hce::-moz-range-track{background-color:var(--track-bg)}
|
|
59
|
+
._g4ppusvi::-moz-range-thumb{box-sizing:border-box}
|
|
60
|
+
._j5dh13gf:disabled{cursor:not-allowed}
|
|
61
|
+
._jxarjiw3:hover:not(:disabled){--thumb-bg:var(--_14t3dsg)}
|
|
62
|
+
._np53xlkz::-webkit-slider-runnable-track{background-size:var(--track-fg-width) 100%}
|
|
63
|
+
._r7637vkz::-moz-range-thumb{width:1pc}
|
|
64
|
+
._u98z7vkz::-webkit-slider-thumb{width:1pc}
|
|
65
|
+
._vt2s1w6o::-moz-range-progress{background-color:var(--track-fg)}
|
|
66
|
+
._wstuglyw{-webkit-appearance:none}
|
|
67
|
+
._ydqg1xpu:hover:not(:disabled){--track-bg:var(--_rf9ekb)}
|
|
68
|
+
._yfyntlke::-webkit-slider-thumb{cursor:pointer}
|
|
69
|
+
._1hvw1o36:focus{outline-width:medium}
|
|
70
|
+
._49pcglyw:focus{outline-style:none}
|
|
71
|
+
._nt751r31:focus{outline-color:currentColor}
|
|
72
|
+
._164c3zdg:focus-visible{--thumb-border:var(--_xjqa3d)}
|
package/dist/cjs/styled.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* styled.tsx generated by @compiled/babel-plugin v0.33.0 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -6,134 +7,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
7
|
value: true
|
|
7
8
|
});
|
|
8
9
|
exports.Input = void 0;
|
|
10
|
+
require("./styled.compiled.css");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
13
|
+
var _runtime = require("@compiled/react/runtime");
|
|
9
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var theme = _interopRequireWildcard(require("./theme"));
|
|
16
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
15
18
|
var _excluded = ["valuePercent", "style"];
|
|
16
|
-
var _hoverNotDisabled, _css;
|
|
17
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var VAR_TRACK_FOREGROUND_WIDTH = '--track-fg-width';
|
|
30
|
-
var sliderThumbStyles = {
|
|
31
|
-
boxSizing: 'border-box',
|
|
32
|
-
width: theme.thumb.size,
|
|
33
|
-
height: theme.thumb.size,
|
|
34
|
-
border: 'none',
|
|
35
|
-
background: "var(".concat(VAR_THUMB_BACKGROUND_COLOR, ", ").concat(theme.thumb.background.default, ")"),
|
|
36
|
-
// adapted from @atlaskit/focus-ring
|
|
37
|
-
outline: "solid 2px var(".concat(VAR_THUMB_BORDER_COLOR, ")"),
|
|
38
|
-
outlineOffset: '2px',
|
|
39
|
-
borderRadius: "var(--ds-border-radius-circle, 50%)",
|
|
40
|
-
boxShadow: "var(".concat(VAR_THUMB_SHADOW, ")"),
|
|
41
|
-
cursor: 'pointer',
|
|
42
|
-
// Different implicit behavior across browsers -> making it explicit.
|
|
43
|
-
transition: "background-color ".concat(theme.transitionDuration, " ease-in-out")
|
|
44
|
-
};
|
|
45
|
-
var sliderTrackStyles = {
|
|
46
|
-
borderRadius: theme.track.borderRadius,
|
|
47
|
-
border: 0,
|
|
48
|
-
cursor: 'pointer',
|
|
49
|
-
height: theme.track.height,
|
|
50
|
-
width: '100%',
|
|
51
|
-
transition: "background-color ".concat(theme.transitionDuration, " ease-in-out")
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// Styles are split per browser as they are implemented differently
|
|
55
|
-
// Cannot consolidate as Chrome & Firefox don't recognise styles if they are grouped
|
|
56
|
-
// with CSS selectors they don't recognise, e.g. &::-ms-thumb
|
|
57
|
-
var browserStyles = {
|
|
58
|
-
webkit: (0, _react2.css)({
|
|
59
|
-
WebkitAppearance: 'none',
|
|
60
|
-
// Hides the slider so that custom slider can be made
|
|
61
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
62
|
-
'::-webkit-slider-thumb': _objectSpread(_objectSpread({}, sliderThumbStyles), {}, {
|
|
63
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
64
|
-
marginBlockStart: -(theme.thumb.size - theme.track.height) / 2,
|
|
65
|
-
WebkitAppearance: 'none'
|
|
66
|
-
}),
|
|
67
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
68
|
-
'::-webkit-slider-runnable-track': _objectSpread(_objectSpread({}, sliderTrackStyles), {}, {
|
|
69
|
-
/**
|
|
70
|
-
* Webkit does not have separate properties for the background/foreground like firefox.
|
|
71
|
-
* Instead we use background layering:
|
|
72
|
-
* - The gray background is a simple background color.
|
|
73
|
-
* - The blue foreground is a 'gradient' (to create a color block) that is sized to the progress.
|
|
74
|
-
*
|
|
75
|
-
* Individual properties have been used over the `background` shorthand for readability.
|
|
76
|
-
*/
|
|
77
|
-
backgroundColor: "var(".concat(VAR_TRACK_BACKGROUND_COLOR, ")"),
|
|
78
|
-
backgroundImage: "linear-gradient(var(".concat(VAR_TRACK_FOREGROUND_COLOR, "), var(").concat(VAR_TRACK_FOREGROUND_COLOR, "))"),
|
|
79
|
-
backgroundRepeat: 'no-repeat',
|
|
80
|
-
backgroundSize: "var(".concat(VAR_TRACK_FOREGROUND_WIDTH, ") 100%"),
|
|
81
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
82
|
-
'[dir="rtl"] &': {
|
|
83
|
-
backgroundPosition: 'right'
|
|
84
|
-
}
|
|
85
|
-
}),
|
|
86
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
87
|
-
':disabled': {
|
|
88
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
89
|
-
'::-webkit-slider-thumb, ::-webkit-slider-runnable-track': {
|
|
90
|
-
cursor: 'not-allowed'
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}),
|
|
94
|
-
firefox: (0, _react2.css)({
|
|
95
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
96
|
-
'::-moz-range-thumb': sliderThumbStyles,
|
|
97
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
98
|
-
'::-moz-focus-outer': {
|
|
99
|
-
border: 0
|
|
100
|
-
},
|
|
101
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
102
|
-
'::-moz-range-progress': _objectSpread(_objectSpread({}, sliderTrackStyles), {}, {
|
|
103
|
-
background: "var(".concat(VAR_TRACK_FOREGROUND_COLOR, ")")
|
|
104
|
-
}),
|
|
105
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
106
|
-
'::-moz-range-track': _objectSpread(_objectSpread({}, sliderTrackStyles), {}, {
|
|
107
|
-
background: "var(".concat(VAR_TRACK_BACKGROUND_COLOR, ")")
|
|
108
|
-
}),
|
|
109
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
110
|
-
':disabled': {
|
|
111
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
112
|
-
'::-moz-range-thumb, ::-moz-range-progress, ::-moz-range-track': {
|
|
113
|
-
cursor: 'not-allowed'
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
})
|
|
117
|
-
};
|
|
118
|
-
var baseStyles = (0, _react2.css)({
|
|
119
|
-
width: '100%',
|
|
120
|
-
// Has a fixed width by default
|
|
121
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
122
|
-
height: theme.input.height,
|
|
123
|
-
// Otherwise thumb will collide with previous box element
|
|
124
|
-
background: 'transparent',
|
|
125
|
-
// Otherwise white
|
|
126
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
127
|
-
':focus': {
|
|
128
|
-
outline: 'none'
|
|
129
|
-
},
|
|
130
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
131
|
-
':disabled': {
|
|
132
|
-
cursor: 'not-allowed',
|
|
133
|
-
opacity: "var(--ds-opacity-disabled, 0.4)"
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
var themeStyles = (0, _react2.css)((_css = {}, (0, _defineProperty2.default)(_css, VAR_THUMB_SHADOW, theme.thumb.boxShadow.default), (0, _defineProperty2.default)(_css, VAR_TRACK_BACKGROUND_COLOR, theme.track.background.default), (0, _defineProperty2.default)(_css, VAR_TRACK_FOREGROUND_COLOR, theme.track.foreground.default), (0, _defineProperty2.default)(_css, ':hover:not(:disabled)', (_hoverNotDisabled = {}, (0, _defineProperty2.default)(_hoverNotDisabled, VAR_THUMB_BACKGROUND_COLOR, theme.thumb.background.hovered), (0, _defineProperty2.default)(_hoverNotDisabled, VAR_TRACK_BACKGROUND_COLOR, theme.track.background.hovered), (0, _defineProperty2.default)(_hoverNotDisabled, VAR_TRACK_FOREGROUND_COLOR, theme.track.foreground.hovered), _hoverNotDisabled)), (0, _defineProperty2.default)(_css, ':active:not(:disabled)', (0, _defineProperty2.default)({}, VAR_THUMB_BACKGROUND_COLOR, theme.thumb.background.pressed)), (0, _defineProperty2.default)(_css, ':focus-visible', (0, _defineProperty2.default)({}, VAR_THUMB_BORDER_COLOR, theme.thumb.borderColor.focused)), _css));
|
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
|
+
// Styles are split up to avoid edge-cases with TS implementations between `css` and `cssMap` with some
|
|
24
|
+
// of these edge-case pseudo-selectors.
|
|
25
|
+
// Previously, in Emotion, these selectors weren't consolidated, eg. `&::webkit-thumb, &::moz-thumb`
|
|
26
|
+
// would not be parsed by either browser, but this may no longer be the case in Compiled
|
|
27
|
+
var webkitStyles = null;
|
|
28
|
+
var firefoxStyles = null;
|
|
29
|
+
var baseStyles = null;
|
|
30
|
+
var themeStyles = null;
|
|
137
31
|
|
|
138
32
|
/**
|
|
139
33
|
* __Input__
|
|
@@ -143,11 +37,23 @@ var Input = exports.Input = /*#__PURE__*/(0, _react.forwardRef)(function (props,
|
|
|
143
37
|
var valuePercent = props.valuePercent,
|
|
144
38
|
style = props.style,
|
|
145
39
|
strippedProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
146
|
-
return
|
|
147
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
148
|
-
style: (0, _defineProperty2.default)({}, VAR_TRACK_FOREGROUND_WIDTH, "".concat(valuePercent, "%")),
|
|
40
|
+
return /*#__PURE__*/React.createElement("input", (0, _extends2.default)({}, strippedProps, {
|
|
149
41
|
ref: ref,
|
|
150
|
-
|
|
42
|
+
className: (0, _runtime.ax)(["_1bsb1osq _4t3i1ylp _bfhk18uv _j5dh13gf _1j552wxo _nt751r31 _49pcglyw _1hvw1o36", "_wstuglyw _h2ksglyw _1kdl1q5u _m8f8g56u _1yz62hjt _1bdkusvi _u98z7vkz _1j707vkz _1esf4alp _4w431ik2 _yfyntlke _1sdc196n _18k7v77o _1cdcglyw _10lridpf _g6tdyh40 _vi4t2hjt _1g2h1osq _168l1y44 _9u3f2hce _1g741hsc _1d8tmgnk _np53xlkz _18tdtlke _1p201osq _1yte13gf _5i7a13gf", "_1yq0glyw _108m1q5u _1rf3g56u _1yeu2hjt _g4ppusvi _r7637vkz _1mn57vkz _12el4alp _1oqe1ik2 _10o7tlke _1kzev77o _15raidpf _e8hnidpf _37ywyh40 _1tcb2hjt _aoww1osq _1kd21y44 _vt2s1w6o _1ssqtlke _ru37idpf _1gvoyh40 _1nx42hjt _1f5t1osq _142y1y44 _d7w62hce _b3fmtlke _1vq313gf _1fov13gf _34m613gf", "_14h11gpr _15dpptpz _18lx1n8f _jxarjiw3 _ydqg1xpu _1jhcjiw3 _1rucy2jz _164c3zdg"]),
|
|
43
|
+
style: _objectSpread(_objectSpread({}, {
|
|
44
|
+
// We are creating a css variable to control the "progress" portion of the range input
|
|
45
|
+
// This avoids us needing to create a new css class for each new percentage value
|
|
46
|
+
'--track-fg-width': "".concat(valuePercent, "%")
|
|
47
|
+
}), {}, {
|
|
48
|
+
"--_171tp53": (0, _runtime.ix)("var(--thumb-bg, ".concat("var(--ds-background-neutral-bold, ".concat(_colors.B400, ")"), ")")),
|
|
49
|
+
"--_cghoza": (0, _runtime.ix)("var(--ds-UNSAFE-transparent, ".concat("0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A), ")")),
|
|
50
|
+
"--_19g1tth": (0, _runtime.ix)("var(--ds-background-neutral, ".concat(_colors.N30, ")")),
|
|
51
|
+
"--_1eby16r": (0, _runtime.ix)("var(--ds-background-neutral-bold, ".concat(_colors.B400, ")")),
|
|
52
|
+
"--_14t3dsg": (0, _runtime.ix)("var(--ds-background-neutral-bold-hovered, ".concat(_colors.B300, ")")),
|
|
53
|
+
"--_rf9ekb": (0, _runtime.ix)("var(--ds-background-neutral-hovered, ".concat(_colors.N40, ")")),
|
|
54
|
+
"--_1pam7of": (0, _runtime.ix)("var(--ds-background-neutral-bold-pressed, ".concat(_colors.B200, ")")),
|
|
55
|
+
"--_xjqa3d": (0, _runtime.ix)("var(--ds-border-focused, ".concat(_colors.B200, ")"))
|
|
56
|
+
})
|
|
151
57
|
}));
|
|
152
58
|
});
|
|
153
59
|
Input.displayName = 'InputRange';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
._108m1q5u::-moz-range-thumb{border-radius:var(--ds-border-radius-circle,50%)}
|
|
2
|
+
._10lridpf::-webkit-slider-runnable-track{border:0}
|
|
3
|
+
._15raidpf::-moz-focus-outer{border:0}
|
|
4
|
+
._1gvoyh40::-moz-range-track{border-radius:2px}
|
|
5
|
+
._1kdl1q5u::-webkit-slider-thumb{border-radius:var(--ds-border-radius-circle,50%)}
|
|
6
|
+
._1nx42hjt::-moz-range-track{transition:background-color .2s ease-in-out;-moz-transition:background-color .2s ease-in-out}
|
|
7
|
+
._1rf3g56u::-moz-range-thumb{outline:solid 2px var(--thumb-border)}
|
|
8
|
+
._1tcb2hjt::-moz-range-progress{transition:background-color .2s ease-in-out;-moz-transition:background-color .2s ease-in-out}
|
|
9
|
+
._1yeu2hjt::-moz-range-thumb{transition:background-color .2s ease-in-out;-moz-transition:background-color .2s ease-in-out}
|
|
10
|
+
._1yq0glyw::-moz-range-thumb{border:none}
|
|
11
|
+
._1yz62hjt::-webkit-slider-thumb{transition:background-color .2s ease-in-out;-webkit-transition:background-color .2s ease-in-out}
|
|
12
|
+
._37ywyh40::-moz-range-progress{border-radius:2px}
|
|
13
|
+
._e8hnidpf::-moz-range-progress{border:0}
|
|
14
|
+
._g6tdyh40::-webkit-slider-runnable-track{border-radius:2px}
|
|
15
|
+
._h2ksglyw::-webkit-slider-thumb{border:none}
|
|
16
|
+
._m8f8g56u::-webkit-slider-thumb{outline:solid 2px var(--thumb-border)}
|
|
17
|
+
._ru37idpf::-moz-range-track{border:0}
|
|
18
|
+
._vi4t2hjt::-webkit-slider-runnable-track{transition:background-color .2s ease-in-out;-webkit-transition:background-color .2s ease-in-out}
|
|
19
|
+
._10o7tlke::-moz-range-thumb{cursor:pointer}
|
|
20
|
+
._12el5udg::-moz-range-thumb{background-color:var(--thumb-bg,var(--ds-background-neutral-bold,#0052cc))}
|
|
21
|
+
._142y1y44::-moz-range-track{height:4px}
|
|
22
|
+
._14h11uvs{--thumb-shadow:var(--ds-UNSAFE-transparent,0 4px 8px -2px rgba(9,30,66,.25),0 0 1px rgba(9,30,66,.31))}
|
|
23
|
+
._15dp1yrq{--track-bg:var(--ds-background-neutral,#ebecf0)}
|
|
24
|
+
._168l1y44::-webkit-slider-runnable-track{height:4px}
|
|
25
|
+
._18k7v77o::-webkit-slider-thumb{outline-offset:var(--ds-space-025,2px)}
|
|
26
|
+
._18lxyvsn{--track-fg:var(--ds-background-neutral-bold,#0052cc)}
|
|
27
|
+
._18tdtlke::-webkit-slider-runnable-track{cursor:pointer}
|
|
28
|
+
._1bdkusvi::-webkit-slider-thumb{box-sizing:border-box}
|
|
29
|
+
._1bsb1osq{width:100%}
|
|
30
|
+
._1cdcglyw::-webkit-slider-thumb{-webkit-appearance:none}
|
|
31
|
+
._1d8tmgnk::-webkit-slider-runnable-track{background-repeat:no-repeat}
|
|
32
|
+
._1esf5udg::-webkit-slider-thumb{background-color:var(--thumb-bg,var(--ds-background-neutral-bold,#0052cc))}
|
|
33
|
+
._1f5t1osq::-moz-range-track{width:100%}
|
|
34
|
+
._1fov13gf:disabled::-moz-range-progress{cursor:not-allowed}
|
|
35
|
+
._1g2h1osq::-webkit-slider-runnable-track{width:100%}
|
|
36
|
+
._1g741hsc::-webkit-slider-runnable-track{background-image:linear-gradient(var(--track-fg),var(--track-fg))}
|
|
37
|
+
._1j552wxo:disabled{opacity:var(--ds-opacity-disabled,.4)}
|
|
38
|
+
._1j707vkz::-webkit-slider-thumb{height:1pc}
|
|
39
|
+
._1jhc1eo5:hover:not(:disabled){--track-fg:var(--ds-background-neutral-bold-hovered,#0065ff)}
|
|
40
|
+
._1kd21y44::-moz-range-progress{height:4px}
|
|
41
|
+
._1kzev77o::-moz-range-thumb{outline-offset:var(--ds-space-025,2px)}
|
|
42
|
+
._1mn57vkz::-moz-range-thumb{height:1pc}
|
|
43
|
+
._1oqe1ik2::-moz-range-thumb{box-shadow:var(--thumb-shadow)}
|
|
44
|
+
._1p201osq:dir(rtl)::-webkit-slider-runnable-track{background-position:100%}
|
|
45
|
+
._1ruc16ss:active:not(:disabled){--thumb-bg:var(--ds-background-neutral-bold-pressed,#2684ff)}
|
|
46
|
+
._1sdc196n::-webkit-slider-thumb{margin-block-start:var(--ds-space-negative-075,-6px)}
|
|
47
|
+
._1ssqtlke::-moz-range-progress{cursor:pointer}
|
|
48
|
+
._1vq313gf:disabled::-moz-range-thumb{cursor:not-allowed}
|
|
49
|
+
._1yte13gf:disabled::-webkit-slider-thumb{cursor:not-allowed}
|
|
50
|
+
._34m613gf:disabled::-moz-range-track{cursor:not-allowed}
|
|
51
|
+
._4t3i1ylp{height:40px}
|
|
52
|
+
._4w431ik2::-webkit-slider-thumb{box-shadow:var(--thumb-shadow)}
|
|
53
|
+
._5i7a13gf:disabled::-webkit-slider-runnable-track{cursor:not-allowed}
|
|
54
|
+
._9u3f2hce::-webkit-slider-runnable-track{background-color:var(--track-bg)}
|
|
55
|
+
._aoww1osq::-moz-range-progress{width:100%}
|
|
56
|
+
._b3fmtlke::-moz-range-track{cursor:pointer}
|
|
57
|
+
._bfhk18uv{background-color:initial}
|
|
58
|
+
._d7w62hce::-moz-range-track{background-color:var(--track-bg)}
|
|
59
|
+
._g4ppusvi::-moz-range-thumb{box-sizing:border-box}
|
|
60
|
+
._j5dh13gf:disabled{cursor:not-allowed}
|
|
61
|
+
._jxar1eo5:hover:not(:disabled){--thumb-bg:var(--ds-background-neutral-bold-hovered,#0065ff)}
|
|
62
|
+
._np53xlkz::-webkit-slider-runnable-track{background-size:var(--track-fg-width) 100%}
|
|
63
|
+
._r7637vkz::-moz-range-thumb{width:1pc}
|
|
64
|
+
._u98z7vkz::-webkit-slider-thumb{width:1pc}
|
|
65
|
+
._vt2s1w6o::-moz-range-progress{background-color:var(--track-fg)}
|
|
66
|
+
._wstuglyw{-webkit-appearance:none}
|
|
67
|
+
._ydqghkel:hover:not(:disabled){--track-bg:var(--ds-background-neutral-hovered,#dfe1e6)}
|
|
68
|
+
._yfyntlke::-webkit-slider-thumb{cursor:pointer}
|
|
69
|
+
._1hvw1o36:focus{outline-width:medium}
|
|
70
|
+
._49pcglyw:focus{outline-style:none}
|
|
71
|
+
._nt751r31:focus{outline-color:currentColor}
|
|
72
|
+
._164c194a:focus-visible{--thumb-border:var(--ds-border-focused,#2684ff)}
|
package/dist/es2019/styled.js
CHANGED
|
@@ -1,161 +1,18 @@
|
|
|
1
|
+
/* styled.tsx generated by @compiled/babel-plugin v0.33.0 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
|
|
3
|
+
import "./styled.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
6
|
import { forwardRef } from 'react';
|
|
8
|
-
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const VAR_TRACK_FOREGROUND_WIDTH = '--track-fg-width';
|
|
18
|
-
const sliderThumbStyles = {
|
|
19
|
-
boxSizing: 'border-box',
|
|
20
|
-
width: theme.thumb.size,
|
|
21
|
-
height: theme.thumb.size,
|
|
22
|
-
border: 'none',
|
|
23
|
-
background: `var(${VAR_THUMB_BACKGROUND_COLOR}, ${theme.thumb.background.default})`,
|
|
24
|
-
// adapted from @atlaskit/focus-ring
|
|
25
|
-
outline: `solid 2px var(${VAR_THUMB_BORDER_COLOR})`,
|
|
26
|
-
outlineOffset: '2px',
|
|
27
|
-
borderRadius: "var(--ds-border-radius-circle, 50%)",
|
|
28
|
-
boxShadow: `var(${VAR_THUMB_SHADOW})`,
|
|
29
|
-
cursor: 'pointer',
|
|
30
|
-
// Different implicit behavior across browsers -> making it explicit.
|
|
31
|
-
transition: `background-color ${theme.transitionDuration} ease-in-out`
|
|
32
|
-
};
|
|
33
|
-
const sliderTrackStyles = {
|
|
34
|
-
borderRadius: theme.track.borderRadius,
|
|
35
|
-
border: 0,
|
|
36
|
-
cursor: 'pointer',
|
|
37
|
-
height: theme.track.height,
|
|
38
|
-
width: '100%',
|
|
39
|
-
transition: `background-color ${theme.transitionDuration} ease-in-out`
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// Styles are split per browser as they are implemented differently
|
|
43
|
-
// Cannot consolidate as Chrome & Firefox don't recognise styles if they are grouped
|
|
44
|
-
// with CSS selectors they don't recognise, e.g. &::-ms-thumb
|
|
45
|
-
const browserStyles = {
|
|
46
|
-
webkit: css({
|
|
47
|
-
WebkitAppearance: 'none',
|
|
48
|
-
// Hides the slider so that custom slider can be made
|
|
49
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
50
|
-
'::-webkit-slider-thumb': {
|
|
51
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
52
|
-
...sliderThumbStyles,
|
|
53
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
54
|
-
marginBlockStart: -(theme.thumb.size - theme.track.height) / 2,
|
|
55
|
-
WebkitAppearance: 'none'
|
|
56
|
-
},
|
|
57
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
58
|
-
'::-webkit-slider-runnable-track': {
|
|
59
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
60
|
-
...sliderTrackStyles,
|
|
61
|
-
/**
|
|
62
|
-
* Webkit does not have separate properties for the background/foreground like firefox.
|
|
63
|
-
* Instead we use background layering:
|
|
64
|
-
* - The gray background is a simple background color.
|
|
65
|
-
* - The blue foreground is a 'gradient' (to create a color block) that is sized to the progress.
|
|
66
|
-
*
|
|
67
|
-
* Individual properties have been used over the `background` shorthand for readability.
|
|
68
|
-
*/
|
|
69
|
-
backgroundColor: `var(${VAR_TRACK_BACKGROUND_COLOR})`,
|
|
70
|
-
backgroundImage: `linear-gradient(var(${VAR_TRACK_FOREGROUND_COLOR}), var(${VAR_TRACK_FOREGROUND_COLOR}))`,
|
|
71
|
-
backgroundRepeat: 'no-repeat',
|
|
72
|
-
backgroundSize: `var(${VAR_TRACK_FOREGROUND_WIDTH}) 100%`,
|
|
73
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
74
|
-
'[dir="rtl"] &': {
|
|
75
|
-
backgroundPosition: 'right'
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
79
|
-
':disabled': {
|
|
80
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
81
|
-
'::-webkit-slider-thumb, ::-webkit-slider-runnable-track': {
|
|
82
|
-
cursor: 'not-allowed'
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}),
|
|
86
|
-
firefox: css({
|
|
87
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
88
|
-
'::-moz-range-thumb': sliderThumbStyles,
|
|
89
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
90
|
-
'::-moz-focus-outer': {
|
|
91
|
-
border: 0
|
|
92
|
-
},
|
|
93
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
94
|
-
'::-moz-range-progress': {
|
|
95
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
96
|
-
...sliderTrackStyles,
|
|
97
|
-
background: `var(${VAR_TRACK_FOREGROUND_COLOR})`
|
|
98
|
-
},
|
|
99
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
100
|
-
'::-moz-range-track': {
|
|
101
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
102
|
-
...sliderTrackStyles,
|
|
103
|
-
background: `var(${VAR_TRACK_BACKGROUND_COLOR})`
|
|
104
|
-
},
|
|
105
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
106
|
-
':disabled': {
|
|
107
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
108
|
-
'::-moz-range-thumb, ::-moz-range-progress, ::-moz-range-track': {
|
|
109
|
-
cursor: 'not-allowed'
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
})
|
|
113
|
-
};
|
|
114
|
-
const baseStyles = css({
|
|
115
|
-
width: '100%',
|
|
116
|
-
// Has a fixed width by default
|
|
117
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
118
|
-
height: theme.input.height,
|
|
119
|
-
// Otherwise thumb will collide with previous box element
|
|
120
|
-
background: 'transparent',
|
|
121
|
-
// Otherwise white
|
|
122
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
123
|
-
':focus': {
|
|
124
|
-
outline: 'none'
|
|
125
|
-
},
|
|
126
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
127
|
-
':disabled': {
|
|
128
|
-
cursor: 'not-allowed',
|
|
129
|
-
opacity: "var(--ds-opacity-disabled, 0.4)"
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
const themeStyles = css({
|
|
133
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
134
|
-
[VAR_THUMB_SHADOW]: theme.thumb.boxShadow.default,
|
|
135
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
136
|
-
[VAR_TRACK_BACKGROUND_COLOR]: theme.track.background.default,
|
|
137
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
138
|
-
[VAR_TRACK_FOREGROUND_COLOR]: theme.track.foreground.default,
|
|
139
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
140
|
-
':hover:not(:disabled)': {
|
|
141
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
142
|
-
[VAR_THUMB_BACKGROUND_COLOR]: theme.thumb.background.hovered,
|
|
143
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
144
|
-
[VAR_TRACK_BACKGROUND_COLOR]: theme.track.background.hovered,
|
|
145
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
146
|
-
[VAR_TRACK_FOREGROUND_COLOR]: theme.track.foreground.hovered
|
|
147
|
-
},
|
|
148
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
149
|
-
':active:not(:disabled)': {
|
|
150
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
151
|
-
[VAR_THUMB_BACKGROUND_COLOR]: theme.thumb.background.pressed
|
|
152
|
-
},
|
|
153
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
154
|
-
':focus-visible': {
|
|
155
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
156
|
-
[VAR_THUMB_BORDER_COLOR]: theme.thumb.borderColor.focused
|
|
157
|
-
}
|
|
158
|
-
});
|
|
7
|
+
import { B200, B300, B400, N30, N40, N50A, N60A } from '@atlaskit/theme/colors';
|
|
8
|
+
// Styles are split up to avoid edge-cases with TS implementations between `css` and `cssMap` with some
|
|
9
|
+
// of these edge-case pseudo-selectors.
|
|
10
|
+
// Previously, in Emotion, these selectors weren't consolidated, eg. `&::webkit-thumb, &::moz-thumb`
|
|
11
|
+
// would not be parsed by either browser, but this may no longer be the case in Compiled
|
|
12
|
+
const webkitStyles = null;
|
|
13
|
+
const firefoxStyles = null;
|
|
14
|
+
const baseStyles = null;
|
|
15
|
+
const themeStyles = null;
|
|
159
16
|
|
|
160
17
|
/**
|
|
161
18
|
* __Input__
|
|
@@ -167,16 +24,14 @@ export const Input = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
167
24
|
style,
|
|
168
25
|
...strippedProps
|
|
169
26
|
} = props;
|
|
170
|
-
return
|
|
171
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
27
|
+
return /*#__PURE__*/React.createElement("input", _extends({}, strippedProps, {
|
|
172
28
|
style: {
|
|
173
29
|
// We are creating a css variable to control the "progress" portion of the range input
|
|
174
30
|
// This avoids us needing to create a new css class for each new percentage value
|
|
175
|
-
|
|
176
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
31
|
+
'--track-fg-width': `${valuePercent}%`
|
|
177
32
|
},
|
|
178
33
|
ref: ref,
|
|
179
|
-
|
|
34
|
+
className: ax(["_1bsb1osq _4t3i1ylp _bfhk18uv _j5dh13gf _1j552wxo _nt751r31 _49pcglyw _1hvw1o36", "_wstuglyw _h2ksglyw _1kdl1q5u _m8f8g56u _1yz62hjt _1bdkusvi _u98z7vkz _1j707vkz _1esf5udg _4w431ik2 _yfyntlke _1sdc196n _18k7v77o _1cdcglyw _10lridpf _g6tdyh40 _vi4t2hjt _1g2h1osq _168l1y44 _9u3f2hce _1g741hsc _1d8tmgnk _np53xlkz _18tdtlke _1p201osq _1yte13gf _5i7a13gf", "_1yq0glyw _108m1q5u _1rf3g56u _1yeu2hjt _g4ppusvi _r7637vkz _1mn57vkz _12el5udg _1oqe1ik2 _10o7tlke _1kzev77o _15raidpf _e8hnidpf _37ywyh40 _1tcb2hjt _aoww1osq _1kd21y44 _vt2s1w6o _1ssqtlke _ru37idpf _1gvoyh40 _1nx42hjt _1f5t1osq _142y1y44 _d7w62hce _b3fmtlke _1vq313gf _1fov13gf _34m613gf", "_14h11uvs _15dp1yrq _18lxyvsn _jxar1eo5 _ydqghkel _1jhc1eo5 _1ruc16ss _164c194a"])
|
|
180
35
|
}));
|
|
181
36
|
});
|
|
182
37
|
Input.displayName = 'InputRange';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
._108m1q5u::-moz-range-thumb{border-radius:var(--ds-border-radius-circle,50%)}
|
|
2
|
+
._10lridpf::-webkit-slider-runnable-track{border:0}
|
|
3
|
+
._15raidpf::-moz-focus-outer{border:0}
|
|
4
|
+
._1gvoyh40::-moz-range-track{border-radius:2px}
|
|
5
|
+
._1kdl1q5u::-webkit-slider-thumb{border-radius:var(--ds-border-radius-circle,50%)}
|
|
6
|
+
._1nx42hjt::-moz-range-track{transition:background-color .2s ease-in-out;-moz-transition:background-color .2s ease-in-out}
|
|
7
|
+
._1rf3g56u::-moz-range-thumb{outline:solid 2px var(--thumb-border)}
|
|
8
|
+
._1tcb2hjt::-moz-range-progress{transition:background-color .2s ease-in-out;-moz-transition:background-color .2s ease-in-out}
|
|
9
|
+
._1yeu2hjt::-moz-range-thumb{transition:background-color .2s ease-in-out;-moz-transition:background-color .2s ease-in-out}
|
|
10
|
+
._1yq0glyw::-moz-range-thumb{border:none}
|
|
11
|
+
._1yz62hjt::-webkit-slider-thumb{transition:background-color .2s ease-in-out;-webkit-transition:background-color .2s ease-in-out}
|
|
12
|
+
._37ywyh40::-moz-range-progress{border-radius:2px}
|
|
13
|
+
._e8hnidpf::-moz-range-progress{border:0}
|
|
14
|
+
._g6tdyh40::-webkit-slider-runnable-track{border-radius:2px}
|
|
15
|
+
._h2ksglyw::-webkit-slider-thumb{border:none}
|
|
16
|
+
._m8f8g56u::-webkit-slider-thumb{outline:solid 2px var(--thumb-border)}
|
|
17
|
+
._ru37idpf::-moz-range-track{border:0}
|
|
18
|
+
._vi4t2hjt::-webkit-slider-runnable-track{transition:background-color .2s ease-in-out;-webkit-transition:background-color .2s ease-in-out}
|
|
19
|
+
._10o7tlke::-moz-range-thumb{cursor:pointer}
|
|
20
|
+
._12el4alp::-moz-range-thumb{background-color:var(--_171tp53)}
|
|
21
|
+
._142y1y44::-moz-range-track{height:4px}
|
|
22
|
+
._14h11gpr{--thumb-shadow:var(--_cghoza)}
|
|
23
|
+
._15dpptpz{--track-bg:var(--_19g1tth)}
|
|
24
|
+
._168l1y44::-webkit-slider-runnable-track{height:4px}
|
|
25
|
+
._18k7v77o::-webkit-slider-thumb{outline-offset:var(--ds-space-025,2px)}
|
|
26
|
+
._18lx1n8f{--track-fg:var(--_1eby16r)}
|
|
27
|
+
._18tdtlke::-webkit-slider-runnable-track{cursor:pointer}
|
|
28
|
+
._1bdkusvi::-webkit-slider-thumb{box-sizing:border-box}
|
|
29
|
+
._1bsb1osq{width:100%}
|
|
30
|
+
._1cdcglyw::-webkit-slider-thumb{-webkit-appearance:none}
|
|
31
|
+
._1d8tmgnk::-webkit-slider-runnable-track{background-repeat:no-repeat}
|
|
32
|
+
._1esf4alp::-webkit-slider-thumb{background-color:var(--_171tp53)}
|
|
33
|
+
._1f5t1osq::-moz-range-track{width:100%}
|
|
34
|
+
._1fov13gf:disabled::-moz-range-progress{cursor:not-allowed}
|
|
35
|
+
._1g2h1osq::-webkit-slider-runnable-track{width:100%}
|
|
36
|
+
._1g741hsc::-webkit-slider-runnable-track{background-image:linear-gradient(var(--track-fg),var(--track-fg))}
|
|
37
|
+
._1j552wxo:disabled{opacity:var(--ds-opacity-disabled,.4)}
|
|
38
|
+
._1j707vkz::-webkit-slider-thumb{height:1pc}
|
|
39
|
+
._1jhcjiw3:hover:not(:disabled){--track-fg:var(--_14t3dsg)}
|
|
40
|
+
._1kd21y44::-moz-range-progress{height:4px}
|
|
41
|
+
._1kzev77o::-moz-range-thumb{outline-offset:var(--ds-space-025,2px)}
|
|
42
|
+
._1mn57vkz::-moz-range-thumb{height:1pc}
|
|
43
|
+
._1oqe1ik2::-moz-range-thumb{box-shadow:var(--thumb-shadow)}
|
|
44
|
+
._1p201osq:dir(rtl)::-webkit-slider-runnable-track{background-position:100%}
|
|
45
|
+
._1rucy2jz:active:not(:disabled){--thumb-bg:var(--_1pam7of)}
|
|
46
|
+
._1sdc196n::-webkit-slider-thumb{margin-block-start:var(--ds-space-negative-075,-6px)}
|
|
47
|
+
._1ssqtlke::-moz-range-progress{cursor:pointer}
|
|
48
|
+
._1vq313gf:disabled::-moz-range-thumb{cursor:not-allowed}
|
|
49
|
+
._1yte13gf:disabled::-webkit-slider-thumb{cursor:not-allowed}
|
|
50
|
+
._34m613gf:disabled::-moz-range-track{cursor:not-allowed}
|
|
51
|
+
._4t3i1ylp{height:40px}
|
|
52
|
+
._4w431ik2::-webkit-slider-thumb{box-shadow:var(--thumb-shadow)}
|
|
53
|
+
._5i7a13gf:disabled::-webkit-slider-runnable-track{cursor:not-allowed}
|
|
54
|
+
._9u3f2hce::-webkit-slider-runnable-track{background-color:var(--track-bg)}
|
|
55
|
+
._aoww1osq::-moz-range-progress{width:100%}
|
|
56
|
+
._b3fmtlke::-moz-range-track{cursor:pointer}
|
|
57
|
+
._bfhk18uv{background-color:initial}
|
|
58
|
+
._d7w62hce::-moz-range-track{background-color:var(--track-bg)}
|
|
59
|
+
._g4ppusvi::-moz-range-thumb{box-sizing:border-box}
|
|
60
|
+
._j5dh13gf:disabled{cursor:not-allowed}
|
|
61
|
+
._jxarjiw3:hover:not(:disabled){--thumb-bg:var(--_14t3dsg)}
|
|
62
|
+
._np53xlkz::-webkit-slider-runnable-track{background-size:var(--track-fg-width) 100%}
|
|
63
|
+
._r7637vkz::-moz-range-thumb{width:1pc}
|
|
64
|
+
._u98z7vkz::-webkit-slider-thumb{width:1pc}
|
|
65
|
+
._vt2s1w6o::-moz-range-progress{background-color:var(--track-fg)}
|
|
66
|
+
._wstuglyw{-webkit-appearance:none}
|
|
67
|
+
._ydqg1xpu:hover:not(:disabled){--track-bg:var(--_rf9ekb)}
|
|
68
|
+
._yfyntlke::-webkit-slider-thumb{cursor:pointer}
|
|
69
|
+
._1hvw1o36:focus{outline-width:medium}
|
|
70
|
+
._49pcglyw:focus{outline-style:none}
|
|
71
|
+
._nt751r31:focus{outline-color:currentColor}
|
|
72
|
+
._164c3zdg:focus-visible{--thumb-border:var(--_xjqa3d)}
|
package/dist/esm/styled.js
CHANGED
|
@@ -1,133 +1,23 @@
|
|
|
1
|
+
/* styled.tsx generated by @compiled/babel-plugin v0.33.0 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
5
|
var _excluded = ["valuePercent", "style"];
|
|
5
|
-
|
|
6
|
+
import "./styled.compiled.css";
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
9
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
10
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
-
/**
|
|
9
|
-
* @jsxRuntime classic
|
|
10
|
-
* @jsx jsx
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
11
|
import { forwardRef } from 'react';
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var VAR_TRACK_FOREGROUND_WIDTH = '--track-fg-width';
|
|
24
|
-
var sliderThumbStyles = {
|
|
25
|
-
boxSizing: 'border-box',
|
|
26
|
-
width: theme.thumb.size,
|
|
27
|
-
height: theme.thumb.size,
|
|
28
|
-
border: 'none',
|
|
29
|
-
background: "var(".concat(VAR_THUMB_BACKGROUND_COLOR, ", ").concat(theme.thumb.background.default, ")"),
|
|
30
|
-
// adapted from @atlaskit/focus-ring
|
|
31
|
-
outline: "solid 2px var(".concat(VAR_THUMB_BORDER_COLOR, ")"),
|
|
32
|
-
outlineOffset: '2px',
|
|
33
|
-
borderRadius: "var(--ds-border-radius-circle, 50%)",
|
|
34
|
-
boxShadow: "var(".concat(VAR_THUMB_SHADOW, ")"),
|
|
35
|
-
cursor: 'pointer',
|
|
36
|
-
// Different implicit behavior across browsers -> making it explicit.
|
|
37
|
-
transition: "background-color ".concat(theme.transitionDuration, " ease-in-out")
|
|
38
|
-
};
|
|
39
|
-
var sliderTrackStyles = {
|
|
40
|
-
borderRadius: theme.track.borderRadius,
|
|
41
|
-
border: 0,
|
|
42
|
-
cursor: 'pointer',
|
|
43
|
-
height: theme.track.height,
|
|
44
|
-
width: '100%',
|
|
45
|
-
transition: "background-color ".concat(theme.transitionDuration, " ease-in-out")
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// Styles are split per browser as they are implemented differently
|
|
49
|
-
// Cannot consolidate as Chrome & Firefox don't recognise styles if they are grouped
|
|
50
|
-
// with CSS selectors they don't recognise, e.g. &::-ms-thumb
|
|
51
|
-
var browserStyles = {
|
|
52
|
-
webkit: css({
|
|
53
|
-
WebkitAppearance: 'none',
|
|
54
|
-
// Hides the slider so that custom slider can be made
|
|
55
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
56
|
-
'::-webkit-slider-thumb': _objectSpread(_objectSpread({}, sliderThumbStyles), {}, {
|
|
57
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
58
|
-
marginBlockStart: -(theme.thumb.size - theme.track.height) / 2,
|
|
59
|
-
WebkitAppearance: 'none'
|
|
60
|
-
}),
|
|
61
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
62
|
-
'::-webkit-slider-runnable-track': _objectSpread(_objectSpread({}, sliderTrackStyles), {}, {
|
|
63
|
-
/**
|
|
64
|
-
* Webkit does not have separate properties for the background/foreground like firefox.
|
|
65
|
-
* Instead we use background layering:
|
|
66
|
-
* - The gray background is a simple background color.
|
|
67
|
-
* - The blue foreground is a 'gradient' (to create a color block) that is sized to the progress.
|
|
68
|
-
*
|
|
69
|
-
* Individual properties have been used over the `background` shorthand for readability.
|
|
70
|
-
*/
|
|
71
|
-
backgroundColor: "var(".concat(VAR_TRACK_BACKGROUND_COLOR, ")"),
|
|
72
|
-
backgroundImage: "linear-gradient(var(".concat(VAR_TRACK_FOREGROUND_COLOR, "), var(").concat(VAR_TRACK_FOREGROUND_COLOR, "))"),
|
|
73
|
-
backgroundRepeat: 'no-repeat',
|
|
74
|
-
backgroundSize: "var(".concat(VAR_TRACK_FOREGROUND_WIDTH, ") 100%"),
|
|
75
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
76
|
-
'[dir="rtl"] &': {
|
|
77
|
-
backgroundPosition: 'right'
|
|
78
|
-
}
|
|
79
|
-
}),
|
|
80
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
81
|
-
':disabled': {
|
|
82
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
83
|
-
'::-webkit-slider-thumb, ::-webkit-slider-runnable-track': {
|
|
84
|
-
cursor: 'not-allowed'
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}),
|
|
88
|
-
firefox: css({
|
|
89
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
90
|
-
'::-moz-range-thumb': sliderThumbStyles,
|
|
91
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
92
|
-
'::-moz-focus-outer': {
|
|
93
|
-
border: 0
|
|
94
|
-
},
|
|
95
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
96
|
-
'::-moz-range-progress': _objectSpread(_objectSpread({}, sliderTrackStyles), {}, {
|
|
97
|
-
background: "var(".concat(VAR_TRACK_FOREGROUND_COLOR, ")")
|
|
98
|
-
}),
|
|
99
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
100
|
-
'::-moz-range-track': _objectSpread(_objectSpread({}, sliderTrackStyles), {}, {
|
|
101
|
-
background: "var(".concat(VAR_TRACK_BACKGROUND_COLOR, ")")
|
|
102
|
-
}),
|
|
103
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
104
|
-
':disabled': {
|
|
105
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
106
|
-
'::-moz-range-thumb, ::-moz-range-progress, ::-moz-range-track': {
|
|
107
|
-
cursor: 'not-allowed'
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
})
|
|
111
|
-
};
|
|
112
|
-
var baseStyles = css({
|
|
113
|
-
width: '100%',
|
|
114
|
-
// Has a fixed width by default
|
|
115
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
116
|
-
height: theme.input.height,
|
|
117
|
-
// Otherwise thumb will collide with previous box element
|
|
118
|
-
background: 'transparent',
|
|
119
|
-
// Otherwise white
|
|
120
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
121
|
-
':focus': {
|
|
122
|
-
outline: 'none'
|
|
123
|
-
},
|
|
124
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
125
|
-
':disabled': {
|
|
126
|
-
cursor: 'not-allowed',
|
|
127
|
-
opacity: "var(--ds-opacity-disabled, 0.4)"
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
var themeStyles = css((_css = {}, _defineProperty(_css, VAR_THUMB_SHADOW, theme.thumb.boxShadow.default), _defineProperty(_css, VAR_TRACK_BACKGROUND_COLOR, theme.track.background.default), _defineProperty(_css, VAR_TRACK_FOREGROUND_COLOR, theme.track.foreground.default), _defineProperty(_css, ':hover:not(:disabled)', (_hoverNotDisabled = {}, _defineProperty(_hoverNotDisabled, VAR_THUMB_BACKGROUND_COLOR, theme.thumb.background.hovered), _defineProperty(_hoverNotDisabled, VAR_TRACK_BACKGROUND_COLOR, theme.track.background.hovered), _defineProperty(_hoverNotDisabled, VAR_TRACK_FOREGROUND_COLOR, theme.track.foreground.hovered), _hoverNotDisabled)), _defineProperty(_css, ':active:not(:disabled)', _defineProperty({}, VAR_THUMB_BACKGROUND_COLOR, theme.thumb.background.pressed)), _defineProperty(_css, ':focus-visible', _defineProperty({}, VAR_THUMB_BORDER_COLOR, theme.thumb.borderColor.focused)), _css));
|
|
12
|
+
import { B200, B300, B400, N30, N40, N50A, N60A } from '@atlaskit/theme/colors';
|
|
13
|
+
// Styles are split up to avoid edge-cases with TS implementations between `css` and `cssMap` with some
|
|
14
|
+
// of these edge-case pseudo-selectors.
|
|
15
|
+
// Previously, in Emotion, these selectors weren't consolidated, eg. `&::webkit-thumb, &::moz-thumb`
|
|
16
|
+
// would not be parsed by either browser, but this may no longer be the case in Compiled
|
|
17
|
+
var webkitStyles = null;
|
|
18
|
+
var firefoxStyles = null;
|
|
19
|
+
var baseStyles = null;
|
|
20
|
+
var themeStyles = null;
|
|
131
21
|
|
|
132
22
|
/**
|
|
133
23
|
* __Input__
|
|
@@ -137,11 +27,23 @@ export var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
137
27
|
var valuePercent = props.valuePercent,
|
|
138
28
|
style = props.style,
|
|
139
29
|
strippedProps = _objectWithoutProperties(props, _excluded);
|
|
140
|
-
return
|
|
141
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
142
|
-
style: _defineProperty({}, VAR_TRACK_FOREGROUND_WIDTH, "".concat(valuePercent, "%")),
|
|
30
|
+
return /*#__PURE__*/React.createElement("input", _extends({}, strippedProps, {
|
|
143
31
|
ref: ref,
|
|
144
|
-
|
|
32
|
+
className: ax(["_1bsb1osq _4t3i1ylp _bfhk18uv _j5dh13gf _1j552wxo _nt751r31 _49pcglyw _1hvw1o36", "_wstuglyw _h2ksglyw _1kdl1q5u _m8f8g56u _1yz62hjt _1bdkusvi _u98z7vkz _1j707vkz _1esf4alp _4w431ik2 _yfyntlke _1sdc196n _18k7v77o _1cdcglyw _10lridpf _g6tdyh40 _vi4t2hjt _1g2h1osq _168l1y44 _9u3f2hce _1g741hsc _1d8tmgnk _np53xlkz _18tdtlke _1p201osq _1yte13gf _5i7a13gf", "_1yq0glyw _108m1q5u _1rf3g56u _1yeu2hjt _g4ppusvi _r7637vkz _1mn57vkz _12el4alp _1oqe1ik2 _10o7tlke _1kzev77o _15raidpf _e8hnidpf _37ywyh40 _1tcb2hjt _aoww1osq _1kd21y44 _vt2s1w6o _1ssqtlke _ru37idpf _1gvoyh40 _1nx42hjt _1f5t1osq _142y1y44 _d7w62hce _b3fmtlke _1vq313gf _1fov13gf _34m613gf", "_14h11gpr _15dpptpz _18lx1n8f _jxarjiw3 _ydqg1xpu _1jhcjiw3 _1rucy2jz _164c3zdg"]),
|
|
33
|
+
style: _objectSpread(_objectSpread({}, {
|
|
34
|
+
// We are creating a css variable to control the "progress" portion of the range input
|
|
35
|
+
// This avoids us needing to create a new css class for each new percentage value
|
|
36
|
+
'--track-fg-width': "".concat(valuePercent, "%")
|
|
37
|
+
}), {}, {
|
|
38
|
+
"--_171tp53": ix("var(--thumb-bg, ".concat("var(--ds-background-neutral-bold, ".concat(B400, ")"), ")")),
|
|
39
|
+
"--_cghoza": ix("var(--ds-UNSAFE-transparent, ".concat("0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")")),
|
|
40
|
+
"--_19g1tth": ix("var(--ds-background-neutral, ".concat(N30, ")")),
|
|
41
|
+
"--_1eby16r": ix("var(--ds-background-neutral-bold, ".concat(B400, ")")),
|
|
42
|
+
"--_14t3dsg": ix("var(--ds-background-neutral-bold-hovered, ".concat(B300, ")")),
|
|
43
|
+
"--_rf9ekb": ix("var(--ds-background-neutral-hovered, ".concat(N40, ")")),
|
|
44
|
+
"--_1pam7of": ix("var(--ds-background-neutral-bold-pressed, ".concat(B200, ")")),
|
|
45
|
+
"--_xjqa3d": ix("var(--ds-border-focused, ".concat(B200, ")"))
|
|
46
|
+
})
|
|
145
47
|
}));
|
|
146
48
|
});
|
|
147
49
|
Input.displayName = 'InputRange';
|
package/dist/types/range.d.ts
CHANGED
|
@@ -46,5 +46,5 @@ export type RangeProps = Combine<Omit<React.InputHTMLAttributes<HTMLInputElement
|
|
|
46
46
|
* - [Code](https://atlassian.design/components/range/code)
|
|
47
47
|
* - [Usage](https://atlassian.design/components/range/usage)
|
|
48
48
|
*/
|
|
49
|
-
declare const Range: React.ForwardRefExoticComponent<Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
49
|
+
declare const Range: React.ForwardRefExoticComponent<Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "disabled" | "checked" | "required">, keyof OwnProps> & OwnProps & React.RefAttributes<HTMLInputElement>>;
|
|
50
50
|
export default Range;
|
package/dist/types/styled.d.ts
CHANGED
|
@@ -46,5 +46,5 @@ export type RangeProps = Combine<Omit<React.InputHTMLAttributes<HTMLInputElement
|
|
|
46
46
|
* - [Code](https://atlassian.design/components/range/code)
|
|
47
47
|
* - [Usage](https://atlassian.design/components/range/usage)
|
|
48
48
|
*/
|
|
49
|
-
declare const Range: React.ForwardRefExoticComponent<Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
49
|
+
declare const Range: React.ForwardRefExoticComponent<Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "disabled" | "checked" | "required">, keyof OwnProps> & OwnProps & React.RefAttributes<HTMLInputElement>>;
|
|
50
50
|
export default Range;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/range",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"description": "A range lets users choose an approximate value on a slider.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -21,25 +21,27 @@
|
|
|
21
21
|
"runReact18": true,
|
|
22
22
|
"website": {
|
|
23
23
|
"name": "Range",
|
|
24
|
-
"category": "
|
|
24
|
+
"category": "Forms and input"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@atlaskit/
|
|
28
|
+
"@atlaskit/css": "^0.7.0",
|
|
29
|
+
"@atlaskit/ds-lib": "^3.3.0",
|
|
29
30
|
"@atlaskit/theme": "^14.0.0",
|
|
30
|
-
"@atlaskit/tokens": "^2.
|
|
31
|
+
"@atlaskit/tokens": "^2.5.0",
|
|
31
32
|
"@babel/runtime": "^7.0.0",
|
|
32
|
-
"@
|
|
33
|
+
"@compiled/react": "^0.18.1"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|
|
35
36
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@af/accessibility-testing": "*",
|
|
40
|
+
"@af/integration-testing": "*",
|
|
39
41
|
"@af/visual-regression": "*",
|
|
40
|
-
"@atlaskit/checkbox": "^15.
|
|
42
|
+
"@atlaskit/checkbox": "^15.2.0",
|
|
41
43
|
"@atlaskit/ssr": "*",
|
|
42
|
-
"@atlaskit/tooltip": "^
|
|
44
|
+
"@atlaskit/tooltip": "^19.0.0",
|
|
43
45
|
"@atlaskit/visual-regression": "*",
|
|
44
46
|
"@emotion/styled": "^11.0.0",
|
|
45
47
|
"@testing-library/react": "^12.1.5",
|