@salutejs/plasma-new-hope 0.174.0-dev.0 → 0.175.0-canary.1452.11541985977.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Slider/Slider.css +15 -13
- package/cjs/components/Slider/Slider.js +11 -2
- package/cjs/components/Slider/Slider.js.map +1 -1
- package/cjs/components/Slider/Slider.tokens.js +23 -17
- package/cjs/components/Slider/Slider.tokens.js.map +1 -1
- package/cjs/components/Slider/components/Double/Double.css +8 -8
- package/cjs/components/Slider/components/Double/Double.js +58 -23
- package/cjs/components/Slider/components/Double/Double.js.map +1 -1
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +98 -0
- package/cjs/components/Slider/components/Single/Single.css +14 -14
- package/cjs/components/Slider/components/Single/Single.js +64 -33
- package/cjs/components/Slider/components/Single/Single.js.map +1 -1
- package/cjs/components/Slider/components/Single/Single.styles.js +4 -4
- package/cjs/components/Slider/components/Single/Single.styles.js.map +1 -1
- package/cjs/components/Slider/components/Single/Single.styles_1h7n2s2.css +6 -0
- package/cjs/components/Slider/components/SliderBase/SliderBase.css +5 -5
- package/cjs/components/Slider/components/SliderBase/SliderBase.js +31 -12
- package/cjs/components/Slider/components/SliderBase/SliderBase.js.map +1 -1
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -1
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles_1qt1224.css +5 -0
- package/cjs/components/Slider/ui/Handler/Handler.css +3 -3
- package/cjs/components/Slider/ui/Handler/Handler.js +49 -88
- package/cjs/components/Slider/ui/Handler/Handler.js.map +1 -1
- package/cjs/components/Slider/ui/Handler/Handler.styles.js +17 -7
- package/cjs/components/Slider/ui/Handler/Handler.styles.js.map +1 -1
- package/cjs/components/Slider/ui/Handler/Handler.styles_irtcgm.css +2 -0
- package/cjs/components/Slider/ui/Handler/computeKeyPressData.js +122 -0
- package/cjs/components/Slider/ui/Handler/computeKeyPressData.js.map +1 -0
- package/cjs/components/Slider/ui/Thumb/Thumb.css +1 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.js +3 -2
- package/cjs/components/Slider/ui/Thumb/Thumb.js.map +1 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.styles.js +1 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.styles_uyn20e.css +1 -0
- package/cjs/components/Slider/utils/index.js +28 -10
- package/cjs/components/Slider/utils/index.js.map +1 -1
- package/cjs/components/Slider/variations/_view/base.js +1 -1
- package/cjs/components/Slider/variations/_view/base.js.map +1 -1
- package/cjs/components/Slider/variations/_view/base_1s3f6q8.css +1 -0
- package/cjs/index.css +15 -13
- package/cjs/utils/index.js.map +1 -1
- package/emotion/cjs/components/Slider/Slider.js +10 -2
- package/emotion/cjs/components/Slider/Slider.template-doc.mdx +26 -0
- package/emotion/cjs/components/Slider/Slider.tokens.js +23 -17
- package/emotion/cjs/components/Slider/components/Double/Double.js +54 -19
- package/emotion/cjs/components/Slider/components/Single/Single.js +64 -33
- package/emotion/cjs/components/Slider/components/Single/Single.styles.js +18 -9
- package/emotion/cjs/components/Slider/components/SliderBase/SliderBase.js +31 -12
- package/emotion/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +10 -10
- package/emotion/cjs/components/Slider/ui/Handler/Handler.js +52 -88
- package/emotion/cjs/components/Slider/ui/Handler/Handler.styles.js +9 -15
- package/emotion/cjs/components/Slider/ui/Handler/computeKeyPressData.js +121 -0
- package/emotion/cjs/components/Slider/ui/Thumb/Thumb.js +3 -2
- package/emotion/cjs/components/Slider/ui/Thumb/Thumb.styles.js +3 -3
- package/emotion/cjs/components/Slider/utils/index.js +28 -10
- package/emotion/cjs/components/Slider/variations/_view/base.js +2 -1
- package/emotion/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +7 -7
- package/emotion/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
- package/emotion/cjs/examples/plasma_web/components/Slider/Slider.config.js +7 -7
- package/emotion/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
- package/emotion/es/components/Slider/Slider.js +11 -2
- package/emotion/es/components/Slider/Slider.template-doc.mdx +26 -0
- package/emotion/es/components/Slider/Slider.tokens.js +23 -17
- package/emotion/es/components/Slider/components/Double/Double.js +54 -19
- package/emotion/es/components/Slider/components/Single/Single.js +65 -34
- package/emotion/es/components/Slider/components/Single/Single.styles.js +17 -8
- package/emotion/es/components/Slider/components/SliderBase/SliderBase.js +31 -12
- package/emotion/es/components/Slider/components/SliderBase/SliderBase.styles.js +11 -11
- package/emotion/es/components/Slider/ui/Handler/Handler.js +51 -86
- package/emotion/es/components/Slider/ui/Handler/Handler.styles.js +10 -16
- package/emotion/es/components/Slider/ui/Handler/computeKeyPressData.js +115 -0
- package/emotion/es/components/Slider/ui/Thumb/Thumb.js +3 -2
- package/emotion/es/components/Slider/ui/Thumb/Thumb.styles.js +3 -3
- package/emotion/es/components/Slider/utils/index.js +28 -10
- package/emotion/es/components/Slider/variations/_view/base.js +2 -1
- package/emotion/es/examples/plasma_b2c/components/Slider/Slider.config.js +7 -7
- package/emotion/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
- package/emotion/es/examples/plasma_web/components/Slider/Slider.config.js +7 -7
- package/emotion/es/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
- package/es/components/Slider/Slider.css +15 -13
- package/es/components/Slider/Slider.js +11 -2
- package/es/components/Slider/Slider.js.map +1 -1
- package/es/components/Slider/Slider.tokens.js +23 -17
- package/es/components/Slider/Slider.tokens.js.map +1 -1
- package/es/components/Slider/components/Double/Double.css +8 -8
- package/es/components/Slider/components/Double/Double.js +54 -19
- package/es/components/Slider/components/Double/Double.js.map +1 -1
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +98 -0
- package/es/components/Slider/components/Single/Single.css +14 -14
- package/es/components/Slider/components/Single/Single.js +65 -34
- package/es/components/Slider/components/Single/Single.js.map +1 -1
- package/es/components/Slider/components/Single/Single.styles.js +4 -4
- package/es/components/Slider/components/Single/Single.styles.js.map +1 -1
- package/es/components/Slider/components/Single/Single.styles_1h7n2s2.css +6 -0
- package/es/components/Slider/components/SliderBase/SliderBase.css +5 -5
- package/es/components/Slider/components/SliderBase/SliderBase.js +31 -12
- package/es/components/Slider/components/SliderBase/SliderBase.js.map +1 -1
- package/es/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
- package/es/components/Slider/components/SliderBase/SliderBase.styles.js.map +1 -1
- package/es/components/Slider/components/SliderBase/SliderBase.styles_1qt1224.css +5 -0
- package/es/components/Slider/ui/Handler/Handler.css +3 -3
- package/es/components/Slider/ui/Handler/Handler.js +48 -87
- package/es/components/Slider/ui/Handler/Handler.js.map +1 -1
- package/es/components/Slider/ui/Handler/Handler.styles.js +17 -7
- package/es/components/Slider/ui/Handler/Handler.styles.js.map +1 -1
- package/es/components/Slider/ui/Handler/Handler.styles_irtcgm.css +2 -0
- package/es/components/Slider/ui/Handler/computeKeyPressData.js +118 -0
- package/es/components/Slider/ui/Handler/computeKeyPressData.js.map +1 -0
- package/es/components/Slider/ui/Thumb/Thumb.css +1 -1
- package/es/components/Slider/ui/Thumb/Thumb.js +3 -2
- package/es/components/Slider/ui/Thumb/Thumb.js.map +1 -1
- package/es/components/Slider/ui/Thumb/Thumb.styles.js +1 -1
- package/es/components/Slider/ui/Thumb/Thumb.styles.js.map +1 -1
- package/es/components/Slider/ui/Thumb/Thumb.styles_uyn20e.css +1 -0
- package/es/components/Slider/utils/index.js +28 -10
- package/es/components/Slider/utils/index.js.map +1 -1
- package/es/components/Slider/variations/_view/base.js +1 -1
- package/es/components/Slider/variations/_view/base.js.map +1 -1
- package/es/components/Slider/variations/_view/base_1s3f6q8.css +1 -0
- package/es/index.css +15 -13
- package/es/utils/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Slider/Slider.js +10 -2
- package/styled-components/cjs/components/Slider/Slider.template-doc.mdx +26 -0
- package/styled-components/cjs/components/Slider/Slider.tokens.js +23 -17
- package/styled-components/cjs/components/Slider/components/Double/Double.js +54 -19
- package/styled-components/cjs/components/Slider/components/Single/Single.js +64 -33
- package/styled-components/cjs/components/Slider/components/Single/Single.styles.js +6 -6
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.js +31 -12
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +6 -6
- package/styled-components/cjs/components/Slider/ui/Handler/Handler.js +52 -88
- package/styled-components/cjs/components/Slider/ui/Handler/Handler.styles.js +7 -4
- package/styled-components/cjs/components/Slider/ui/Handler/computeKeyPressData.js +121 -0
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.js +3 -2
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.styles.js +2 -2
- package/styled-components/cjs/components/Slider/utils/index.js +28 -10
- package/styled-components/cjs/components/Slider/variations/_view/base.js +2 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +3 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.config.js +3 -3
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
- package/styled-components/es/components/Slider/Slider.js +11 -2
- package/styled-components/es/components/Slider/Slider.template-doc.mdx +26 -0
- package/styled-components/es/components/Slider/Slider.tokens.js +23 -17
- package/styled-components/es/components/Slider/components/Double/Double.js +54 -19
- package/styled-components/es/components/Slider/components/Single/Single.js +65 -34
- package/styled-components/es/components/Slider/components/Single/Single.styles.js +5 -5
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.js +31 -12
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.styles.js +7 -7
- package/styled-components/es/components/Slider/ui/Handler/Handler.js +51 -86
- package/styled-components/es/components/Slider/ui/Handler/Handler.styles.js +8 -5
- package/styled-components/es/components/Slider/ui/Handler/computeKeyPressData.js +115 -0
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.js +3 -2
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.styles.js +2 -2
- package/styled-components/es/components/Slider/utils/index.js +28 -10
- package/styled-components/es/components/Slider/variations/_view/base.js +2 -1
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.config.js +3 -3
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +98 -16
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.config.js +3 -3
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.stories.tsx +98 -15
- package/types/components/Slider/Slider.d.ts.map +1 -1
- package/types/components/Slider/Slider.tokens.d.ts +22 -16
- package/types/components/Slider/Slider.tokens.d.ts.map +1 -1
- package/types/components/Slider/components/Double/Double.d.ts.map +1 -1
- package/types/components/Slider/components/Double/Double.types.d.ts +1 -0
- package/types/components/Slider/components/Double/Double.types.d.ts.map +1 -1
- package/types/components/Slider/components/Single/Single.d.ts.map +1 -1
- package/types/components/Slider/components/Single/Single.styles.d.ts +1 -1
- package/types/components/Slider/components/Single/Single.styles.d.ts.map +1 -1
- package/types/components/Slider/components/Single/Single.types.d.ts +79 -7
- package/types/components/Slider/components/Single/Single.types.d.ts.map +1 -1
- package/types/components/Slider/components/SliderBase/SliderBase.d.ts.map +1 -1
- package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts +1 -1
- package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts.map +1 -1
- package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts +6 -0
- package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts.map +1 -1
- package/types/components/Slider/ui/Handler/Handler.d.ts.map +1 -1
- package/types/components/Slider/ui/Handler/Handler.styles.d.ts +6 -2
- package/types/components/Slider/ui/Handler/Handler.styles.d.ts.map +1 -1
- package/types/components/Slider/ui/Handler/Handler.types.d.ts +5 -1
- package/types/components/Slider/ui/Handler/Handler.types.d.ts.map +1 -1
- package/types/components/Slider/ui/Handler/computeKeyPressData.d.ts +12 -0
- package/types/components/Slider/ui/Handler/computeKeyPressData.d.ts.map +1 -0
- package/types/components/Slider/ui/Thumb/Thumb.d.ts +1 -1
- package/types/components/Slider/ui/Thumb/Thumb.d.ts.map +1 -1
- package/types/components/Slider/ui/Thumb/Thumb.styles.d.ts.map +1 -1
- package/types/components/Slider/ui/Thumb/Thumb.types.d.ts +1 -0
- package/types/components/Slider/ui/Thumb/Thumb.types.d.ts.map +1 -1
- package/types/components/Slider/utils/index.d.ts +26 -8
- package/types/components/Slider/utils/index.d.ts.map +1 -1
- package/types/components/Slider/variations/_view/base.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Slider/Slider.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Slider/Slider.d.ts +80 -2
- package/types/examples/plasma_b2c/components/Slider/Slider.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Slider/Slider.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Slider/Slider.d.ts +80 -2
- package/types/examples/plasma_web/components/Slider/Slider.d.ts.map +1 -1
- package/types/utils/index.d.ts +1 -1
- package/types/utils/index.d.ts.map +1 -1
- package/cjs/components/Slider/components/Single/Single.styles_1r9f1e0.css +0 -6
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles_9s4eb3.css +0 -5
- package/cjs/components/Slider/ui/Handler/Handler.styles_8crx5z.css +0 -2
- package/cjs/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +0 -1
- package/cjs/components/Slider/variations/_view/base_x642ct.css +0 -1
- package/es/components/Slider/components/Single/Single.styles_1r9f1e0.css +0 -6
- package/es/components/Slider/components/SliderBase/SliderBase.styles_9s4eb3.css +0 -5
- package/es/components/Slider/ui/Handler/Handler.styles_8crx5z.css +0 -2
- package/es/components/Slider/ui/Thumb/Thumb.styles_4w4gzn.css +0 -1
- package/es/components/Slider/variations/_view/base_x642ct.css +0 -1
@@ -0,0 +1,115 @@
|
|
1
|
+
var KeyboardSupport = {
|
2
|
+
PageUp: 33,
|
3
|
+
PageDown: 34,
|
4
|
+
End: 35,
|
5
|
+
Home: 36,
|
6
|
+
ArrowLeft: 37,
|
7
|
+
ArrowUp: 38,
|
8
|
+
ArrowRight: 39,
|
9
|
+
ArrowDown: 40
|
10
|
+
};
|
11
|
+
var ArrowUp = KeyboardSupport.ArrowUp,
|
12
|
+
ArrowRight = KeyboardSupport.ArrowRight,
|
13
|
+
ArrowDown = KeyboardSupport.ArrowDown,
|
14
|
+
ArrowLeft = KeyboardSupport.ArrowLeft,
|
15
|
+
Home = KeyboardSupport.Home,
|
16
|
+
End = KeyboardSupport.End,
|
17
|
+
PageDown = KeyboardSupport.PageDown,
|
18
|
+
PageUp = KeyboardSupport.PageUp;
|
19
|
+
var computeVerticalMovement = function computeVerticalMovement(event, _ref) {
|
20
|
+
var stepSize = _ref.stepSize,
|
21
|
+
position = _ref.position,
|
22
|
+
max = _ref.max,
|
23
|
+
computedMultipleSteps = _ref.computedMultipleSteps;
|
24
|
+
var keyCode = event.keyCode,
|
25
|
+
target = event.target;
|
26
|
+
var data = {
|
27
|
+
x: 0,
|
28
|
+
deltaX: 0,
|
29
|
+
lastX: 0,
|
30
|
+
y: 0,
|
31
|
+
deltaY: stepSize,
|
32
|
+
lastY: position,
|
33
|
+
node: target
|
34
|
+
};
|
35
|
+
switch (keyCode) {
|
36
|
+
case ArrowUp:
|
37
|
+
case ArrowRight:
|
38
|
+
data.y = position - stepSize;
|
39
|
+
data.deltaY = -stepSize;
|
40
|
+
break;
|
41
|
+
case ArrowDown:
|
42
|
+
case ArrowLeft:
|
43
|
+
data.y = position + stepSize;
|
44
|
+
break;
|
45
|
+
case PageUp:
|
46
|
+
data.y = position - computedMultipleSteps;
|
47
|
+
data.deltaY = -computedMultipleSteps;
|
48
|
+
break;
|
49
|
+
case PageDown:
|
50
|
+
data.y = position + computedMultipleSteps;
|
51
|
+
data.deltaY = computedMultipleSteps;
|
52
|
+
break;
|
53
|
+
case End:
|
54
|
+
data.y = max * stepSize;
|
55
|
+
break;
|
56
|
+
case Home:
|
57
|
+
data.y = 0;
|
58
|
+
break;
|
59
|
+
default:
|
60
|
+
data.y = 0;
|
61
|
+
}
|
62
|
+
return data;
|
63
|
+
};
|
64
|
+
var computeHorizontalMovement = function computeHorizontalMovement(event, _ref2) {
|
65
|
+
var stepSize = _ref2.stepSize,
|
66
|
+
position = _ref2.position,
|
67
|
+
max = _ref2.max,
|
68
|
+
computedMultipleSteps = _ref2.computedMultipleSteps;
|
69
|
+
var keyCode = event.keyCode,
|
70
|
+
target = event.target;
|
71
|
+
var data = {
|
72
|
+
x: 0,
|
73
|
+
deltaX: stepSize,
|
74
|
+
lastX: position,
|
75
|
+
y: 0,
|
76
|
+
deltaY: 0,
|
77
|
+
lastY: 0,
|
78
|
+
node: target
|
79
|
+
};
|
80
|
+
switch (keyCode) {
|
81
|
+
case ArrowUp:
|
82
|
+
case ArrowRight:
|
83
|
+
data.x = position + stepSize;
|
84
|
+
break;
|
85
|
+
case ArrowDown:
|
86
|
+
case ArrowLeft:
|
87
|
+
data.x = position - stepSize;
|
88
|
+
data.deltaX = -stepSize;
|
89
|
+
break;
|
90
|
+
case PageUp:
|
91
|
+
data.x = position + computedMultipleSteps;
|
92
|
+
data.deltaX = computedMultipleSteps;
|
93
|
+
break;
|
94
|
+
case PageDown:
|
95
|
+
data.x = position - computedMultipleSteps;
|
96
|
+
data.deltaX = -computedMultipleSteps;
|
97
|
+
break;
|
98
|
+
case End:
|
99
|
+
data.x = max * stepSize;
|
100
|
+
break;
|
101
|
+
case Home:
|
102
|
+
data.x = 0;
|
103
|
+
break;
|
104
|
+
default:
|
105
|
+
data.x = 0;
|
106
|
+
}
|
107
|
+
return data;
|
108
|
+
};
|
109
|
+
export var computeKeyPressData = function computeKeyPressData(event, params) {
|
110
|
+
var keyCode = event.keyCode;
|
111
|
+
if (!Object.values(KeyboardSupport).includes(keyCode)) {
|
112
|
+
return null;
|
113
|
+
}
|
114
|
+
return params.isVertical ? computeVerticalMovement(event, params) : computeHorizontalMovement(event, params);
|
115
|
+
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["min", "max", "value", "ariaValueMin", "ariaLabel", "disabled"];
|
1
|
+
var _excluded = ["min", "max", "value", "ariaValueMin", "ariaLabel", "disabled", "orientation"];
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
@@ -12,6 +12,7 @@ export var Thumb = function Thumb(_ref) {
|
|
12
12
|
ariaValueMin = _ref$ariaValueMin === void 0 ? min : _ref$ariaValueMin,
|
13
13
|
ariaLabel = _ref.ariaLabel,
|
14
14
|
disabled = _ref.disabled,
|
15
|
+
orientation = _ref.orientation,
|
15
16
|
rest = _objectWithoutProperties(_ref, _excluded);
|
16
17
|
return /*#__PURE__*/React.createElement(ThumbBase, _extends({
|
17
18
|
role: "slider",
|
@@ -20,6 +21,6 @@ export var Thumb = function Thumb(_ref) {
|
|
20
21
|
"aria-valuemax": max,
|
21
22
|
"aria-valuenow": value,
|
22
23
|
disabled: disabled,
|
23
|
-
"aria-orientation":
|
24
|
+
"aria-orientation": orientation
|
24
25
|
}, rest));
|
25
26
|
};
|
@@ -3,8 +3,8 @@ import { addFocus } from '../../../../mixins';
|
|
3
3
|
import { tokens } from '../../Slider.tokens';
|
4
4
|
export var ThumbBase = /*#__PURE__*/styled.div.withConfig({
|
5
5
|
componentId: "plasma-new-hope__sc-13botku-0"
|
6
|
-
})(["width:var(
|
7
|
-
outlineOffset: '0.
|
6
|
+
})(["width:var(--thumb-size);height:var(--thumb-size);min-width:var(--thumb-size);min-height:var(--thumb-size);position:relative;border-radius:50%;box-sizing:border-box;background:var(", ");margin:0.0625rem;transition:border-color 0.1s ease-in-out;&:after{background:var(", ");margin:-0.0625rem;content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;}&:not([disabled]):hover:after,&:not([disabled]):active:after{background:var(", ");}&[disabled]{cursor:not-allowed;}&:focus{outline:none;}", ""], tokens.thumbBackgroundColor, tokens.thumbBorderColor, tokens.thumbFocusBorderColor, /*#__PURE__*/addFocus({
|
7
|
+
outlineOffset: '0.0625rem',
|
8
8
|
outlineSize: '0.125rem',
|
9
9
|
outlineRadius: '50%',
|
10
10
|
outlineColor: /*#__PURE__*/"var(".concat(tokens.thumbFocusBorderColor, ")")
|
@@ -6,8 +6,8 @@
|
|
6
6
|
* @param {number} max
|
7
7
|
* @return {number}
|
8
8
|
*/
|
9
|
-
export function getSliderThumbValue(
|
10
|
-
var newValue = Math.round(
|
9
|
+
export function getSliderThumbValue(handleCenterPosRelative, stepSize, min, max) {
|
10
|
+
var newValue = Math.round(handleCenterPosRelative / stepSize) + min;
|
11
11
|
return Math.min(Math.max(newValue, min), max);
|
12
12
|
}
|
13
13
|
|
@@ -18,11 +18,11 @@ export function getSliderThumbValue(handleCenterXRelative, stepSize, min, max) {
|
|
18
18
|
* @param {'left' | 'right'} side
|
19
19
|
* @return Array<number>
|
20
20
|
*/
|
21
|
-
export function getOffsets(ref, side) {
|
21
|
+
export function getOffsets(ref, side, isVertical) {
|
22
22
|
if (!ref || !('current' in ref) || !ref.current || !side) {
|
23
23
|
return [0, 0];
|
24
24
|
}
|
25
|
-
var size = ref.current.clientWidth;
|
25
|
+
var size = isVertical ? ref.current.clientHeight : ref.current.clientWidth;
|
26
26
|
if (side === 'left') {
|
27
27
|
return [0, size];
|
28
28
|
}
|
@@ -33,15 +33,33 @@ export function getOffsets(ref, side) {
|
|
33
33
|
}
|
34
34
|
export var sizeData = {
|
35
35
|
s: {
|
36
|
-
|
37
|
-
|
36
|
+
small: {
|
37
|
+
indent: 0.5,
|
38
|
+
fontSizeMultiplier: 16
|
39
|
+
},
|
40
|
+
large: {
|
41
|
+
indent: 0.625,
|
42
|
+
fontSizeMultiplier: 16
|
43
|
+
}
|
38
44
|
},
|
39
45
|
m: {
|
40
|
-
|
41
|
-
|
46
|
+
small: {
|
47
|
+
indent: 0.5,
|
48
|
+
fontSizeMultiplier: 16
|
49
|
+
},
|
50
|
+
large: {
|
51
|
+
indent: 0.625,
|
52
|
+
fontSizeMultiplier: 16
|
53
|
+
}
|
42
54
|
},
|
43
55
|
l: {
|
44
|
-
|
45
|
-
|
56
|
+
small: {
|
57
|
+
indent: 0.5,
|
58
|
+
fontSizeMultiplier: 16
|
59
|
+
},
|
60
|
+
large: {
|
61
|
+
indent: 0.625,
|
62
|
+
fontSizeMultiplier: 16
|
63
|
+
}
|
46
64
|
}
|
47
65
|
};
|
@@ -12,9 +12,9 @@ export var config = {
|
|
12
12
|
gradient: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-solid-tertiary);", ":var(--on-light-surface-solid-card);", ":var(--surface-accent-gradient);", ":var(--surface-solid-tertiary);", ":var(--surface-accent-gradient);", ":var(--text-secondary);", ":var(--surface-transparent-primary);", ":var(--text-primary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--text-primary);"], sliderTokens.labelColor, sliderTokens.rangeValueColor, sliderTokens.thumbBorderColor, sliderTokens.thumbBackgroundColor, sliderTokens.thumbFocusBorderColor, sliderTokens.railBackgroundColor, sliderTokens.fillColor, sliderTokens.textFieldColor, sliderTokens.textFieldBackgroundColor, sliderTokens.textFieldCaretColor, sliderTokens.textFieldPlaceholderColor, sliderTokens.textFiledFocusColor, sliderTokens.textFieldActiveColor)
|
13
13
|
},
|
14
14
|
size: {
|
15
|
-
l: /*#__PURE__*/css(["", ":1.5rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":0.75rem;", ":0.
|
16
|
-
m: /*#__PURE__*/css(["", ":1.5rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":0.75rem;", ":0.75rem;", "
|
17
|
-
s: /*#__PURE__*/css(["", ":1rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":0.5rem;", ":0.
|
15
|
+
l: /*#__PURE__*/css(["", ":1.5rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":1rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":0.75rem;", ":0.875rem;", ":0.875rem;", ":0.75rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":1rem;", ":1.25rem;", ":0.0625rem solid;", ":1.625rem;", ":0.25rem;", ":0.125rem;", ":0.75rem;", ":0.125rem;", ":3.5rem;", ":1.25rem 1rem 1.25rem 1rem;", ":0.75rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);"], sliderTokens.size, sliderTokens.doubleWrapperGap, sliderTokens.labelWrapperGap, sliderTokens.labelWrapperMarginBottom, sliderTokens.labelWrapperMarginRight, sliderTokens.labelWrapperVerticalMargin, sliderTokens.labelFontFamily, sliderTokens.labelFontSize, sliderTokens.labelFontStyle, sliderTokens.labelFontWeight, sliderTokens.labelLetterSpacing, sliderTokens.labelLineHeight, sliderTokens.rangeValueHorizontalMargin, sliderTokens.rangeValueBottomOffset, sliderTokens.rangeValueHorizontalOffset, sliderTokens.rangeValueVerticalMargin, sliderTokens.valueFontFamily, sliderTokens.valueFontSize, sliderTokens.valueFontStyle, sliderTokens.valueFontWeight, sliderTokens.valueLetterSpacing, sliderTokens.valueLineHeight, sliderTokens.thumbSize, sliderTokens.thumbSizeLarge, sliderTokens.thumbBorder, sliderTokens.currentValueTopOffset, sliderTokens.railThickness, sliderTokens.railBorderRadius, sliderTokens.railIndent, sliderTokens.textFieldWrapperGap, sliderTokens.textFieldHeight, sliderTokens.textFieldPadding, sliderTokens.textFieldBorderRadius, sliderTokens.textFieldFontFamily, sliderTokens.textFieldFontSize, sliderTokens.textFieldFontStyle, sliderTokens.textFieldFontWeight, sliderTokens.textFieldLetterSpacing, sliderTokens.textFieldLineHeight),
|
16
|
+
m: /*#__PURE__*/css(["", ":1.5rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":0.75rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":0.75rem;", ":0.75rem;", ":0.875rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":1rem;", ":1.25rem;", ":0.0625rem solid;", ":1.75rem;", ":0.25rem;", ":0.125rem;", ":0.75rem;", ":0.125rem;", ":3rem;", ":0.875rem 1rem 0.875rem 1rem;", ":0.75rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);"], sliderTokens.size, sliderTokens.doubleWrapperGap, sliderTokens.labelWrapperGap, sliderTokens.labelWrapperMarginBottom, sliderTokens.labelWrapperMarginRight, sliderTokens.labelWrapperVerticalMargin, sliderTokens.labelFontFamily, sliderTokens.labelFontSize, sliderTokens.labelFontStyle, sliderTokens.labelFontWeight, sliderTokens.labelLetterSpacing, sliderTokens.labelLineHeight, sliderTokens.rangeValueHorizontalMargin, sliderTokens.rangeValueBottomOffset, sliderTokens.rangeValueHorizontalOffset, sliderTokens.rangeValueVerticalMargin, sliderTokens.valueFontFamily, sliderTokens.valueFontSize, sliderTokens.valueFontStyle, sliderTokens.valueFontWeight, sliderTokens.valueLetterSpacing, sliderTokens.valueLineHeight, sliderTokens.thumbSize, sliderTokens.thumbSizeLarge, sliderTokens.thumbBorder, sliderTokens.currentValueTopOffset, sliderTokens.railThickness, sliderTokens.railBorderRadius, sliderTokens.railIndent, sliderTokens.textFieldWrapperGap, sliderTokens.textFieldHeight, sliderTokens.textFieldPadding, sliderTokens.textFieldBorderRadius, sliderTokens.textFieldFontFamily, sliderTokens.textFieldFontSize, sliderTokens.textFieldFontStyle, sliderTokens.textFieldFontWeight, sliderTokens.textFieldLetterSpacing, sliderTokens.textFieldLineHeight),
|
17
|
+
s: /*#__PURE__*/css(["", ":1rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":0.5rem;", ":0.625rem;", ":0.625rem;", ":0.5rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":1rem;", ":1.25rem;", ":0.0625rem solid;", ":1.25rem;", ":0.25rem;", ":0.125rem;", ":0.75rem;", ":0.125rem;", ":2.5rem;", ":0.5rem 1rem 0.5rem 1rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);"], sliderTokens.size, sliderTokens.doubleWrapperGap, sliderTokens.labelWrapperGap, sliderTokens.labelWrapperMarginBottom, sliderTokens.labelWrapperMarginRight, sliderTokens.labelWrapperVerticalMargin, sliderTokens.labelFontFamily, sliderTokens.labelFontSize, sliderTokens.labelFontStyle, sliderTokens.labelFontWeight, sliderTokens.labelLetterSpacing, sliderTokens.labelLineHeight, sliderTokens.rangeValueHorizontalMargin, sliderTokens.rangeValueBottomOffset, sliderTokens.rangeValueHorizontalOffset, sliderTokens.rangeValueVerticalMargin, sliderTokens.valueFontFamily, sliderTokens.valueFontSize, sliderTokens.valueFontStyle, sliderTokens.valueFontWeight, sliderTokens.valueLetterSpacing, sliderTokens.valueLineHeight, sliderTokens.thumbSize, sliderTokens.thumbSizeLarge, sliderTokens.thumbBorder, sliderTokens.currentValueTopOffset, sliderTokens.railThickness, sliderTokens.railBorderRadius, sliderTokens.railIndent, sliderTokens.textFieldWrapperGap, sliderTokens.textFieldHeight, sliderTokens.textFieldPadding, sliderTokens.textFieldBorderRadius, sliderTokens.textFieldFontFamily, sliderTokens.textFieldFontSize, sliderTokens.textFieldFontStyle, sliderTokens.textFieldFontWeight, sliderTokens.textFieldLetterSpacing, sliderTokens.textFieldLineHeight)
|
18
18
|
},
|
19
19
|
disabled: {
|
20
20
|
"true": /*#__PURE__*/css(["", ":0.4;"], sliderTokens.disabledOpacity)
|
@@ -3,16 +3,19 @@ import type { ComponentProps } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
4
4
|
import { disableProps } from '@salutejs/plasma-sb-utils';
|
5
5
|
import type { StoryObj, Meta } from '@storybook/react';
|
6
|
-
import { action } from '@storybook/addon-actions';
|
7
6
|
|
7
|
+
import { IconMic } from '../../../../components/_Icon';
|
8
8
|
import { WithTheme } from '../../../_helpers';
|
9
9
|
|
10
10
|
import { Slider } from './Slider';
|
11
11
|
|
12
12
|
const sizes = ['l', 'm', 's'];
|
13
|
+
const pointerSizes = ['small', 'large', 'none'];
|
13
14
|
const views = ['default', 'accent', 'gradient'];
|
14
|
-
const
|
15
|
-
const
|
15
|
+
const sliderAligns = ['center', 'left', 'right', 'none'];
|
16
|
+
const labelPlacements = ['top', 'left'];
|
17
|
+
const scaleAligns = ['side', 'bottom'];
|
18
|
+
const orientations: Array<string> = ['vertical', 'horizontal'];
|
16
19
|
|
17
20
|
const meta: Meta<typeof Slider> = {
|
18
21
|
title: 'plasma_b2c/Slider',
|
@@ -31,9 +34,24 @@ const meta: Meta<typeof Slider> = {
|
|
31
34
|
type: 'inline-radio',
|
32
35
|
},
|
33
36
|
},
|
37
|
+
pointerSize: {
|
38
|
+
options: pointerSizes,
|
39
|
+
control: {
|
40
|
+
type: 'inline-radio',
|
41
|
+
},
|
42
|
+
},
|
43
|
+
orientation: {
|
44
|
+
options: orientations,
|
45
|
+
control: {
|
46
|
+
type: 'select',
|
47
|
+
},
|
48
|
+
},
|
34
49
|
...disableProps([
|
35
50
|
'value',
|
36
51
|
'onChangeCommitted',
|
52
|
+
'onChangeTextField',
|
53
|
+
'onBlurTextField',
|
54
|
+
'onKeyDownTextField',
|
37
55
|
'ariaLabel',
|
38
56
|
'onChange',
|
39
57
|
'fontSizeMultiplier',
|
@@ -41,6 +59,14 @@ const meta: Meta<typeof Slider> = {
|
|
41
59
|
'settings',
|
42
60
|
'hasHoverAnimation',
|
43
61
|
'type',
|
62
|
+
'labelContentLeft',
|
63
|
+
'rangeValuesPlacement',
|
64
|
+
'name',
|
65
|
+
'defaultValue',
|
66
|
+
'labelContent',
|
67
|
+
'showRangeValues',
|
68
|
+
'hideMinValueDiff',
|
69
|
+
'hideMaxValueDiff',
|
44
70
|
]),
|
45
71
|
},
|
46
72
|
};
|
@@ -53,8 +79,9 @@ type StorySingleProps = StoryProps;
|
|
53
79
|
type StorySingle = StoryObj<StorySingleProps>;
|
54
80
|
type StoryDouble = StoryObj<StoryProps>;
|
55
81
|
|
56
|
-
const SliderWrapper = styled.div
|
57
|
-
width: 25rem;
|
82
|
+
const SliderWrapper = styled.div<{ isVertical?: boolean }>`
|
83
|
+
width: ${({ isVertical }) => (isVertical ? 'auto' : '25rem')};
|
84
|
+
height: ${({ isVertical }) => (isVertical ? '25rem' : 'auto')};
|
58
85
|
`;
|
59
86
|
|
60
87
|
const StoryDefault = (args: StorySingleProps) => {
|
@@ -68,41 +95,86 @@ const StoryDefault = (args: StorySingleProps) => {
|
|
68
95
|
setValue(values);
|
69
96
|
};
|
70
97
|
|
98
|
+
const { hasIcon, showIcon, orientation, labelPlacement, labelVerticalPlacement, ...rest } = args;
|
99
|
+
const isVertical = orientation === 'vertical';
|
100
|
+
|
71
101
|
return (
|
72
|
-
<SliderWrapper>
|
73
|
-
<Slider
|
102
|
+
<SliderWrapper isVertical={isVertical}>
|
103
|
+
<Slider
|
104
|
+
value={value}
|
105
|
+
orientation={orientation}
|
106
|
+
labelPlacement={labelPlacement}
|
107
|
+
labelContent={showIcon ? <IconMic size={rest.size === 's' ? 'xs' : 's'} /> : null}
|
108
|
+
onChangeCommitted={onChangeCommittedHandle}
|
109
|
+
onChange={onChangeHandle}
|
110
|
+
{...rest}
|
111
|
+
/>
|
74
112
|
</SliderWrapper>
|
75
113
|
);
|
76
114
|
};
|
77
115
|
|
78
116
|
export const Default: StorySingle = {
|
79
117
|
argTypes: {
|
118
|
+
sliderAlign: {
|
119
|
+
options: sliderAligns,
|
120
|
+
control: {
|
121
|
+
type: 'inline-radio',
|
122
|
+
},
|
123
|
+
if: { arg: 'orientation', eq: 'vertical' },
|
124
|
+
},
|
80
125
|
labelPlacement: {
|
81
126
|
options: labelPlacements,
|
82
127
|
control: {
|
83
128
|
type: 'inline-radio',
|
84
129
|
},
|
130
|
+
if: { arg: 'orientation', eq: 'horizontal' },
|
131
|
+
},
|
132
|
+
labelReversed: {
|
133
|
+
control: {
|
134
|
+
type: 'boolean',
|
135
|
+
expanded: true,
|
136
|
+
},
|
137
|
+
if: { arg: 'orientation', eq: 'vertical' },
|
138
|
+
},
|
139
|
+
scaleAlign: {
|
140
|
+
options: scaleAligns,
|
141
|
+
control: {
|
142
|
+
type: 'inline-radio',
|
143
|
+
},
|
144
|
+
if: { arg: 'orientation', eq: 'horizontal' },
|
85
145
|
},
|
86
|
-
|
87
|
-
options:
|
146
|
+
orientation: {
|
147
|
+
options: orientations,
|
88
148
|
control: {
|
89
149
|
type: 'inline-radio',
|
90
150
|
},
|
91
151
|
},
|
152
|
+
reversed: {
|
153
|
+
control: {
|
154
|
+
type: 'boolean',
|
155
|
+
},
|
156
|
+
if: { arg: 'orientation', eq: 'vertical' },
|
157
|
+
},
|
92
158
|
},
|
93
159
|
args: {
|
94
160
|
view: 'default',
|
95
161
|
size: 'm',
|
162
|
+
pointerSize: 'small',
|
96
163
|
min: 0,
|
97
164
|
max: 100,
|
98
|
-
|
99
|
-
ariaLabel: 'Цена
|
165
|
+
orientation: 'horizontal',
|
166
|
+
ariaLabel: 'Цена микрофона',
|
100
167
|
multipleStepSize: 10,
|
101
|
-
label: 'Цена
|
102
|
-
labelPlacement: '
|
103
|
-
|
104
|
-
|
168
|
+
label: 'Цена микрофона',
|
169
|
+
labelPlacement: 'top',
|
170
|
+
sliderAlign: 'center',
|
171
|
+
scaleAlign: 'bottom',
|
172
|
+
showScale: true,
|
105
173
|
showCurrentValue: false,
|
174
|
+
showIcon: true,
|
175
|
+
reversed: false,
|
176
|
+
labelReversed: false,
|
177
|
+
disabled: false,
|
106
178
|
},
|
107
179
|
render: (args) => <StoryDefault {...args} />,
|
108
180
|
};
|
@@ -142,7 +214,7 @@ const StoryMultipleValues = (args: StoryProps) => {
|
|
142
214
|
};
|
143
215
|
|
144
216
|
return (
|
145
|
-
<SliderWrapper>
|
217
|
+
<SliderWrapper isVertical={args.orientation === 'vertical'}>
|
146
218
|
<Slider
|
147
219
|
value={value}
|
148
220
|
onKeyDownTextField={onKeyDownTextField}
|
@@ -159,6 +231,7 @@ export const MultipleValues: StoryDouble = {
|
|
159
231
|
args: {
|
160
232
|
view: 'default',
|
161
233
|
size: 'm',
|
234
|
+
pointerSize: 'small',
|
162
235
|
min: 0,
|
163
236
|
max: 100,
|
164
237
|
disabled: false,
|
@@ -166,5 +239,14 @@ export const MultipleValues: StoryDouble = {
|
|
166
239
|
ariaLabel: ['Минимальная цена товара', 'Максимальная цена товара'],
|
167
240
|
multipleStepSize: 10,
|
168
241
|
},
|
242
|
+
argTypes: {
|
243
|
+
pointerSize: {
|
244
|
+
options: ['small', 'large'],
|
245
|
+
control: {
|
246
|
+
type: 'inline-radio',
|
247
|
+
},
|
248
|
+
},
|
249
|
+
...disableProps(['orientation']),
|
250
|
+
},
|
169
251
|
render: (args) => <StoryMultipleValues {...args} />,
|
170
252
|
};
|
@@ -12,9 +12,9 @@ export var config = {
|
|
12
12
|
gradient: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-solid-tertiary);", ":var(--on-light-surface-solid-card);", ":var(--surface-accent-gradient);", ":var(--surface-solid-tertiary);", ":var(--surface-accent-gradient);", ":var(--text-secondary);", ":var(--surface-transparent-primary);", ":var(--text-primary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--text-primary);"], sliderTokens.labelColor, sliderTokens.rangeValueColor, sliderTokens.thumbBorderColor, sliderTokens.thumbBackgroundColor, sliderTokens.thumbFocusBorderColor, sliderTokens.railBackgroundColor, sliderTokens.fillColor, sliderTokens.textFieldColor, sliderTokens.textFieldBackgroundColor, sliderTokens.textFieldCaretColor, sliderTokens.textFieldPlaceholderColor, sliderTokens.textFiledFocusColor, sliderTokens.textFieldActiveColor)
|
13
13
|
},
|
14
14
|
size: {
|
15
|
-
l: /*#__PURE__*/css(["", ":1.5rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":0.75rem;", ":0.
|
16
|
-
m: /*#__PURE__*/css(["", ":1.5rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":0.75rem;", ":0.75rem;", "
|
17
|
-
s: /*#__PURE__*/css(["", ":1rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":0.5rem;", ":0.
|
15
|
+
l: /*#__PURE__*/css(["", ":1.5rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":1rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":0.75rem;", ":0.875rem;", ":0.875rem;", ":0.75rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":1rem;", ":1.25rem;", ":0.0625rem solid;", ":1.625rem;", ":0.25rem;", ":0.125rem;", ":0.75rem;", ":0.125rem;", ":3.5rem;", ":1.25rem 1rem 1.25rem 1rem;", ":0.75rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);"], sliderTokens.size, sliderTokens.doubleWrapperGap, sliderTokens.labelWrapperGap, sliderTokens.labelWrapperMarginBottom, sliderTokens.labelWrapperMarginRight, sliderTokens.labelWrapperVerticalMargin, sliderTokens.labelFontFamily, sliderTokens.labelFontSize, sliderTokens.labelFontStyle, sliderTokens.labelFontWeight, sliderTokens.labelLetterSpacing, sliderTokens.labelLineHeight, sliderTokens.rangeValueHorizontalMargin, sliderTokens.rangeValueBottomOffset, sliderTokens.rangeValueHorizontalOffset, sliderTokens.rangeValueVerticalMargin, sliderTokens.valueFontFamily, sliderTokens.valueFontSize, sliderTokens.valueFontStyle, sliderTokens.valueFontWeight, sliderTokens.valueLetterSpacing, sliderTokens.valueLineHeight, sliderTokens.thumbSize, sliderTokens.thumbSizeLarge, sliderTokens.thumbBorder, sliderTokens.currentValueTopOffset, sliderTokens.railThickness, sliderTokens.railBorderRadius, sliderTokens.railIndent, sliderTokens.textFieldWrapperGap, sliderTokens.textFieldHeight, sliderTokens.textFieldPadding, sliderTokens.textFieldBorderRadius, sliderTokens.textFieldFontFamily, sliderTokens.textFieldFontSize, sliderTokens.textFieldFontStyle, sliderTokens.textFieldFontWeight, sliderTokens.textFieldLetterSpacing, sliderTokens.textFieldLineHeight),
|
16
|
+
m: /*#__PURE__*/css(["", ":1.5rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":0.75rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":0.75rem;", ":0.75rem;", ":0.875rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":1rem;", ":1.25rem;", ":0.0625rem solid;", ":1.75rem;", ":0.25rem;", ":0.125rem;", ":0.75rem;", ":0.125rem;", ":3rem;", ":0.875rem 1rem 0.875rem 1rem;", ":0.75rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);"], sliderTokens.size, sliderTokens.doubleWrapperGap, sliderTokens.labelWrapperGap, sliderTokens.labelWrapperMarginBottom, sliderTokens.labelWrapperMarginRight, sliderTokens.labelWrapperVerticalMargin, sliderTokens.labelFontFamily, sliderTokens.labelFontSize, sliderTokens.labelFontStyle, sliderTokens.labelFontWeight, sliderTokens.labelLetterSpacing, sliderTokens.labelLineHeight, sliderTokens.rangeValueHorizontalMargin, sliderTokens.rangeValueBottomOffset, sliderTokens.rangeValueHorizontalOffset, sliderTokens.rangeValueVerticalMargin, sliderTokens.valueFontFamily, sliderTokens.valueFontSize, sliderTokens.valueFontStyle, sliderTokens.valueFontWeight, sliderTokens.valueLetterSpacing, sliderTokens.valueLineHeight, sliderTokens.thumbSize, sliderTokens.thumbSizeLarge, sliderTokens.thumbBorder, sliderTokens.currentValueTopOffset, sliderTokens.railThickness, sliderTokens.railBorderRadius, sliderTokens.railIndent, sliderTokens.textFieldWrapperGap, sliderTokens.textFieldHeight, sliderTokens.textFieldPadding, sliderTokens.textFieldBorderRadius, sliderTokens.textFieldFontFamily, sliderTokens.textFieldFontSize, sliderTokens.textFieldFontStyle, sliderTokens.textFieldFontWeight, sliderTokens.textFieldLetterSpacing, sliderTokens.textFieldLineHeight),
|
17
|
+
s: /*#__PURE__*/css(["", ":1rem;", ":0.375rem;", ":0.25rem;", ":0.25rem;", ":0.875rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":0.5rem;", ":0.625rem;", ":0.625rem;", ":0.5rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":1rem;", ":1.25rem;", ":0.0625rem solid;", ":1.25rem;", ":0.25rem;", ":0.125rem;", ":0.75rem;", ":0.125rem;", ":2.5rem;", ":0.5rem 1rem 0.5rem 1rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);"], sliderTokens.size, sliderTokens.doubleWrapperGap, sliderTokens.labelWrapperGap, sliderTokens.labelWrapperMarginBottom, sliderTokens.labelWrapperMarginRight, sliderTokens.labelWrapperVerticalMargin, sliderTokens.labelFontFamily, sliderTokens.labelFontSize, sliderTokens.labelFontStyle, sliderTokens.labelFontWeight, sliderTokens.labelLetterSpacing, sliderTokens.labelLineHeight, sliderTokens.rangeValueHorizontalMargin, sliderTokens.rangeValueBottomOffset, sliderTokens.rangeValueHorizontalOffset, sliderTokens.rangeValueVerticalMargin, sliderTokens.valueFontFamily, sliderTokens.valueFontSize, sliderTokens.valueFontStyle, sliderTokens.valueFontWeight, sliderTokens.valueLetterSpacing, sliderTokens.valueLineHeight, sliderTokens.thumbSize, sliderTokens.thumbSizeLarge, sliderTokens.thumbBorder, sliderTokens.currentValueTopOffset, sliderTokens.railThickness, sliderTokens.railBorderRadius, sliderTokens.railIndent, sliderTokens.textFieldWrapperGap, sliderTokens.textFieldHeight, sliderTokens.textFieldPadding, sliderTokens.textFieldBorderRadius, sliderTokens.textFieldFontFamily, sliderTokens.textFieldFontSize, sliderTokens.textFieldFontStyle, sliderTokens.textFieldFontWeight, sliderTokens.textFieldLetterSpacing, sliderTokens.textFieldLineHeight)
|
18
18
|
},
|
19
19
|
disabled: {
|
20
20
|
"true": /*#__PURE__*/css(["", ":0.4;"], sliderTokens.disabledOpacity)
|