@react-spectrum/slider 3.6.9-nightly.4624 → 3.6.10-nightly.4629
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/dist/RangeSlider.main.js +8 -8
- package/dist/RangeSlider.mjs +8 -8
- package/dist/RangeSlider.module.js +8 -8
- package/dist/Slider.main.js +11 -11
- package/dist/Slider.mjs +11 -11
- package/dist/Slider.module.js +11 -11
- package/dist/SliderBase.main.js +20 -20
- package/dist/SliderBase.mjs +20 -20
- package/dist/SliderBase.module.js +20 -20
- package/dist/SliderThumb.main.js +6 -6
- package/dist/SliderThumb.mjs +6 -6
- package/dist/SliderThumb.module.js +6 -6
- package/package.json +13 -13
package/dist/RangeSlider.main.js
CHANGED
|
@@ -67,42 +67,42 @@ function $f166b52c7f82645c$var$RangeSlider(props, ref) {
|
|
|
67
67
|
end: end
|
|
68
68
|
}) : undefined
|
|
69
69
|
};
|
|
70
|
-
let stringFormatter = (0, $5TzYf$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($a8b5f113a6a8e4d8$exports))),
|
|
70
|
+
let stringFormatter = (0, $5TzYf$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($a8b5f113a6a8e4d8$exports))), '@react-spectrum/slider');
|
|
71
71
|
let { direction: direction } = (0, $5TzYf$reactariai18n.useLocale)();
|
|
72
72
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($5TzYf$react))).createElement((0, $ec6ca573d82152ff$exports.SliderBase), {
|
|
73
73
|
...baseProps,
|
|
74
|
-
classes:
|
|
74
|
+
classes: 'spectrum-Slider--range',
|
|
75
75
|
ref: ref
|
|
76
76
|
}, ({ trackRef: trackRef, inputRef: inputRef, state: state })=>{
|
|
77
|
-
let cssDirection = direction ===
|
|
77
|
+
let cssDirection = direction === 'rtl' ? 'right' : 'left';
|
|
78
78
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($5TzYf$react))).createElement((0, ($parcel$interopDefault($5TzYf$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($5TzYf$react))).createElement("div", {
|
|
79
|
-
className: (0, $5TzYf$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
79
|
+
className: (0, $5TzYf$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-track'),
|
|
80
80
|
style: {
|
|
81
81
|
width: `${state.getThumbPercent(0) * 100}%`
|
|
82
82
|
}
|
|
83
83
|
}), /*#__PURE__*/ (0, ($parcel$interopDefault($5TzYf$react))).createElement((0, $77acc7fb8bfd13d6$exports.SliderThumb), {
|
|
84
84
|
index: 0,
|
|
85
|
-
"aria-label": stringFormatter.format(
|
|
85
|
+
"aria-label": stringFormatter.format('minimum'),
|
|
86
86
|
isDisabled: props.isDisabled,
|
|
87
87
|
trackRef: trackRef,
|
|
88
88
|
inputRef: inputRef,
|
|
89
89
|
state: state,
|
|
90
90
|
name: props.startName
|
|
91
91
|
}), /*#__PURE__*/ (0, ($parcel$interopDefault($5TzYf$react))).createElement("div", {
|
|
92
|
-
className: (0, $5TzYf$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
92
|
+
className: (0, $5TzYf$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-track'),
|
|
93
93
|
style: {
|
|
94
94
|
[cssDirection]: `${state.getThumbPercent(0) * 100}%`,
|
|
95
95
|
width: `${Math.abs(state.getThumbPercent(0) - state.getThumbPercent(1)) * 100}%`
|
|
96
96
|
}
|
|
97
97
|
}), /*#__PURE__*/ (0, ($parcel$interopDefault($5TzYf$react))).createElement((0, $77acc7fb8bfd13d6$exports.SliderThumb), {
|
|
98
98
|
index: 1,
|
|
99
|
-
"aria-label": stringFormatter.format(
|
|
99
|
+
"aria-label": stringFormatter.format('maximum'),
|
|
100
100
|
isDisabled: props.isDisabled,
|
|
101
101
|
trackRef: trackRef,
|
|
102
102
|
state: state,
|
|
103
103
|
name: props.endName
|
|
104
104
|
}), /*#__PURE__*/ (0, ($parcel$interopDefault($5TzYf$react))).createElement("div", {
|
|
105
|
-
className: (0, $5TzYf$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
105
|
+
className: (0, $5TzYf$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-track'),
|
|
106
106
|
style: {
|
|
107
107
|
width: `${(1 - state.getThumbPercent(1)) * 100}%`
|
|
108
108
|
}
|
package/dist/RangeSlider.mjs
CHANGED
|
@@ -61,42 +61,42 @@ function $d42a197b273dc031$var$RangeSlider(props, ref) {
|
|
|
61
61
|
end: end
|
|
62
62
|
}) : undefined
|
|
63
63
|
};
|
|
64
|
-
let stringFormatter = (0, $bc8Se$useLocalizedStringFormatter)((0, ($parcel$interopDefault($bc8Se$intlStringsmodulejs))),
|
|
64
|
+
let stringFormatter = (0, $bc8Se$useLocalizedStringFormatter)((0, ($parcel$interopDefault($bc8Se$intlStringsmodulejs))), '@react-spectrum/slider');
|
|
65
65
|
let { direction: direction } = (0, $bc8Se$useLocale)();
|
|
66
66
|
return /*#__PURE__*/ (0, $bc8Se$react).createElement((0, $39572711324a3b8e$export$9418495bb635ebde), {
|
|
67
67
|
...baseProps,
|
|
68
|
-
classes:
|
|
68
|
+
classes: 'spectrum-Slider--range',
|
|
69
69
|
ref: ref
|
|
70
70
|
}, ({ trackRef: trackRef, inputRef: inputRef, state: state })=>{
|
|
71
|
-
let cssDirection = direction ===
|
|
71
|
+
let cssDirection = direction === 'rtl' ? 'right' : 'left';
|
|
72
72
|
return /*#__PURE__*/ (0, $bc8Se$react).createElement((0, $bc8Se$react).Fragment, null, /*#__PURE__*/ (0, $bc8Se$react).createElement("div", {
|
|
73
|
-
className: (0, $bc8Se$classNames)((0, ($parcel$interopDefault($bc8Se$slider_vars_cssmodulejs))),
|
|
73
|
+
className: (0, $bc8Se$classNames)((0, ($parcel$interopDefault($bc8Se$slider_vars_cssmodulejs))), 'spectrum-Slider-track'),
|
|
74
74
|
style: {
|
|
75
75
|
width: `${state.getThumbPercent(0) * 100}%`
|
|
76
76
|
}
|
|
77
77
|
}), /*#__PURE__*/ (0, $bc8Se$react).createElement((0, $9058ca69d66a724f$export$2c1b491743890dec), {
|
|
78
78
|
index: 0,
|
|
79
|
-
"aria-label": stringFormatter.format(
|
|
79
|
+
"aria-label": stringFormatter.format('minimum'),
|
|
80
80
|
isDisabled: props.isDisabled,
|
|
81
81
|
trackRef: trackRef,
|
|
82
82
|
inputRef: inputRef,
|
|
83
83
|
state: state,
|
|
84
84
|
name: props.startName
|
|
85
85
|
}), /*#__PURE__*/ (0, $bc8Se$react).createElement("div", {
|
|
86
|
-
className: (0, $bc8Se$classNames)((0, ($parcel$interopDefault($bc8Se$slider_vars_cssmodulejs))),
|
|
86
|
+
className: (0, $bc8Se$classNames)((0, ($parcel$interopDefault($bc8Se$slider_vars_cssmodulejs))), 'spectrum-Slider-track'),
|
|
87
87
|
style: {
|
|
88
88
|
[cssDirection]: `${state.getThumbPercent(0) * 100}%`,
|
|
89
89
|
width: `${Math.abs(state.getThumbPercent(0) - state.getThumbPercent(1)) * 100}%`
|
|
90
90
|
}
|
|
91
91
|
}), /*#__PURE__*/ (0, $bc8Se$react).createElement((0, $9058ca69d66a724f$export$2c1b491743890dec), {
|
|
92
92
|
index: 1,
|
|
93
|
-
"aria-label": stringFormatter.format(
|
|
93
|
+
"aria-label": stringFormatter.format('maximum'),
|
|
94
94
|
isDisabled: props.isDisabled,
|
|
95
95
|
trackRef: trackRef,
|
|
96
96
|
state: state,
|
|
97
97
|
name: props.endName
|
|
98
98
|
}), /*#__PURE__*/ (0, $bc8Se$react).createElement("div", {
|
|
99
|
-
className: (0, $bc8Se$classNames)((0, ($parcel$interopDefault($bc8Se$slider_vars_cssmodulejs))),
|
|
99
|
+
className: (0, $bc8Se$classNames)((0, ($parcel$interopDefault($bc8Se$slider_vars_cssmodulejs))), 'spectrum-Slider-track'),
|
|
100
100
|
style: {
|
|
101
101
|
width: `${(1 - state.getThumbPercent(1)) * 100}%`
|
|
102
102
|
}
|
|
@@ -61,42 +61,42 @@ function $d42a197b273dc031$var$RangeSlider(props, ref) {
|
|
|
61
61
|
end: end
|
|
62
62
|
}) : undefined
|
|
63
63
|
};
|
|
64
|
-
let stringFormatter = (0, $bc8Se$useLocalizedStringFormatter)((0, ($parcel$interopDefault($bc8Se$intlStringsmodulejs))),
|
|
64
|
+
let stringFormatter = (0, $bc8Se$useLocalizedStringFormatter)((0, ($parcel$interopDefault($bc8Se$intlStringsmodulejs))), '@react-spectrum/slider');
|
|
65
65
|
let { direction: direction } = (0, $bc8Se$useLocale)();
|
|
66
66
|
return /*#__PURE__*/ (0, $bc8Se$react).createElement((0, $39572711324a3b8e$export$9418495bb635ebde), {
|
|
67
67
|
...baseProps,
|
|
68
|
-
classes:
|
|
68
|
+
classes: 'spectrum-Slider--range',
|
|
69
69
|
ref: ref
|
|
70
70
|
}, ({ trackRef: trackRef, inputRef: inputRef, state: state })=>{
|
|
71
|
-
let cssDirection = direction ===
|
|
71
|
+
let cssDirection = direction === 'rtl' ? 'right' : 'left';
|
|
72
72
|
return /*#__PURE__*/ (0, $bc8Se$react).createElement((0, $bc8Se$react).Fragment, null, /*#__PURE__*/ (0, $bc8Se$react).createElement("div", {
|
|
73
|
-
className: (0, $bc8Se$classNames)((0, ($parcel$interopDefault($bc8Se$slider_vars_cssmodulejs))),
|
|
73
|
+
className: (0, $bc8Se$classNames)((0, ($parcel$interopDefault($bc8Se$slider_vars_cssmodulejs))), 'spectrum-Slider-track'),
|
|
74
74
|
style: {
|
|
75
75
|
width: `${state.getThumbPercent(0) * 100}%`
|
|
76
76
|
}
|
|
77
77
|
}), /*#__PURE__*/ (0, $bc8Se$react).createElement((0, $9058ca69d66a724f$export$2c1b491743890dec), {
|
|
78
78
|
index: 0,
|
|
79
|
-
"aria-label": stringFormatter.format(
|
|
79
|
+
"aria-label": stringFormatter.format('minimum'),
|
|
80
80
|
isDisabled: props.isDisabled,
|
|
81
81
|
trackRef: trackRef,
|
|
82
82
|
inputRef: inputRef,
|
|
83
83
|
state: state,
|
|
84
84
|
name: props.startName
|
|
85
85
|
}), /*#__PURE__*/ (0, $bc8Se$react).createElement("div", {
|
|
86
|
-
className: (0, $bc8Se$classNames)((0, ($parcel$interopDefault($bc8Se$slider_vars_cssmodulejs))),
|
|
86
|
+
className: (0, $bc8Se$classNames)((0, ($parcel$interopDefault($bc8Se$slider_vars_cssmodulejs))), 'spectrum-Slider-track'),
|
|
87
87
|
style: {
|
|
88
88
|
[cssDirection]: `${state.getThumbPercent(0) * 100}%`,
|
|
89
89
|
width: `${Math.abs(state.getThumbPercent(0) - state.getThumbPercent(1)) * 100}%`
|
|
90
90
|
}
|
|
91
91
|
}), /*#__PURE__*/ (0, $bc8Se$react).createElement((0, $9058ca69d66a724f$export$2c1b491743890dec), {
|
|
92
92
|
index: 1,
|
|
93
|
-
"aria-label": stringFormatter.format(
|
|
93
|
+
"aria-label": stringFormatter.format('maximum'),
|
|
94
94
|
isDisabled: props.isDisabled,
|
|
95
95
|
trackRef: trackRef,
|
|
96
96
|
state: state,
|
|
97
97
|
name: props.endName
|
|
98
98
|
}), /*#__PURE__*/ (0, $bc8Se$react).createElement("div", {
|
|
99
|
-
className: (0, $bc8Se$classNames)((0, ($parcel$interopDefault($bc8Se$slider_vars_cssmodulejs))),
|
|
99
|
+
className: (0, $bc8Se$classNames)((0, ($parcel$interopDefault($bc8Se$slider_vars_cssmodulejs))), 'spectrum-Slider-track'),
|
|
100
100
|
style: {
|
|
101
101
|
width: `${(1 - state.getThumbPercent(1)) * 100}%`
|
|
102
102
|
}
|
package/dist/Slider.main.js
CHANGED
|
@@ -58,17 +58,17 @@ function $3a761bdd22d32681$var$Slider(props, ref) {
|
|
|
58
58
|
...baseProps,
|
|
59
59
|
ref: ref,
|
|
60
60
|
classes: {
|
|
61
|
-
|
|
61
|
+
'spectrum-Slider--filled': isFilled && fillOffset == null
|
|
62
62
|
},
|
|
63
63
|
style: // @ts-ignore
|
|
64
64
|
{
|
|
65
|
-
|
|
65
|
+
'--spectrum-slider-track-gradient': trackGradient && `linear-gradient(to ${direction === 'ltr' ? 'right' : 'left'}, ${trackGradient.join(', ')})`
|
|
66
66
|
}
|
|
67
67
|
}, ({ trackRef: trackRef, inputRef: inputRef, state: state })=>{
|
|
68
68
|
fillOffset = fillOffset != null ? (0, $h9MRe$reactariautils.clamp)(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : fillOffset;
|
|
69
|
-
let cssDirection = direction ===
|
|
69
|
+
let cssDirection = direction === 'rtl' ? 'right' : 'left';
|
|
70
70
|
let lowerTrack = /*#__PURE__*/ (0, ($parcel$interopDefault($h9MRe$react))).createElement("div", {
|
|
71
|
-
className: (0, $h9MRe$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
71
|
+
className: (0, $h9MRe$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-track'),
|
|
72
72
|
style: {
|
|
73
73
|
width: `${state.getThumbPercent(0) * 100}%`,
|
|
74
74
|
// TODO not sure if it has advantages, but this could also be implemented as CSS calc():
|
|
@@ -77,17 +77,17 @@ function $3a761bdd22d32681$var$Slider(props, ref) {
|
|
|
77
77
|
// width: calc(var(--width) * 1%)M
|
|
78
78
|
// }
|
|
79
79
|
// @ts-ignore
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
'--spectrum-track-background-size': `${1 / state.getThumbPercent(0) * 100}%`,
|
|
81
|
+
'--spectrum-track-background-position': direction === 'ltr' ? '0' : '100%'
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
84
|
let upperTrack = /*#__PURE__*/ (0, ($parcel$interopDefault($h9MRe$react))).createElement("div", {
|
|
85
|
-
className: (0, $h9MRe$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
85
|
+
className: (0, $h9MRe$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-track'),
|
|
86
86
|
style: {
|
|
87
87
|
width: `${(1 - state.getThumbPercent(0)) * 100}%`,
|
|
88
88
|
// @ts-ignore
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
'--spectrum-track-background-size': `${1 / (1 - state.getThumbPercent(0)) * 100}%`,
|
|
90
|
+
'--spectrum-track-background-position': direction === 'ltr' ? '100%' : '0'
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
let filledTrack = null;
|
|
@@ -96,8 +96,8 @@ function $3a761bdd22d32681$var$Slider(props, ref) {
|
|
|
96
96
|
let isRightOfOffset = width > 0;
|
|
97
97
|
let offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);
|
|
98
98
|
filledTrack = /*#__PURE__*/ (0, ($parcel$interopDefault($h9MRe$react))).createElement("div", {
|
|
99
|
-
className: (0, $h9MRe$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
100
|
-
|
|
99
|
+
className: (0, $h9MRe$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-fill', {
|
|
100
|
+
'spectrum-Slider-fill--right': isRightOfOffset
|
|
101
101
|
}),
|
|
102
102
|
style: {
|
|
103
103
|
[cssDirection]: `${offset * 100}%`,
|
package/dist/Slider.mjs
CHANGED
|
@@ -52,17 +52,17 @@ function $a1251704aa53e1a5$var$Slider(props, ref) {
|
|
|
52
52
|
...baseProps,
|
|
53
53
|
ref: ref,
|
|
54
54
|
classes: {
|
|
55
|
-
|
|
55
|
+
'spectrum-Slider--filled': isFilled && fillOffset == null
|
|
56
56
|
},
|
|
57
57
|
style: // @ts-ignore
|
|
58
58
|
{
|
|
59
|
-
|
|
59
|
+
'--spectrum-slider-track-gradient': trackGradient && `linear-gradient(to ${direction === 'ltr' ? 'right' : 'left'}, ${trackGradient.join(', ')})`
|
|
60
60
|
}
|
|
61
61
|
}, ({ trackRef: trackRef, inputRef: inputRef, state: state })=>{
|
|
62
62
|
fillOffset = fillOffset != null ? (0, $i1AIe$clamp)(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : fillOffset;
|
|
63
|
-
let cssDirection = direction ===
|
|
63
|
+
let cssDirection = direction === 'rtl' ? 'right' : 'left';
|
|
64
64
|
let lowerTrack = /*#__PURE__*/ (0, $i1AIe$react).createElement("div", {
|
|
65
|
-
className: (0, $i1AIe$classNames)((0, ($parcel$interopDefault($i1AIe$slider_vars_cssmodulejs))),
|
|
65
|
+
className: (0, $i1AIe$classNames)((0, ($parcel$interopDefault($i1AIe$slider_vars_cssmodulejs))), 'spectrum-Slider-track'),
|
|
66
66
|
style: {
|
|
67
67
|
width: `${state.getThumbPercent(0) * 100}%`,
|
|
68
68
|
// TODO not sure if it has advantages, but this could also be implemented as CSS calc():
|
|
@@ -71,17 +71,17 @@ function $a1251704aa53e1a5$var$Slider(props, ref) {
|
|
|
71
71
|
// width: calc(var(--width) * 1%)M
|
|
72
72
|
// }
|
|
73
73
|
// @ts-ignore
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
'--spectrum-track-background-size': `${1 / state.getThumbPercent(0) * 100}%`,
|
|
75
|
+
'--spectrum-track-background-position': direction === 'ltr' ? '0' : '100%'
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
let upperTrack = /*#__PURE__*/ (0, $i1AIe$react).createElement("div", {
|
|
79
|
-
className: (0, $i1AIe$classNames)((0, ($parcel$interopDefault($i1AIe$slider_vars_cssmodulejs))),
|
|
79
|
+
className: (0, $i1AIe$classNames)((0, ($parcel$interopDefault($i1AIe$slider_vars_cssmodulejs))), 'spectrum-Slider-track'),
|
|
80
80
|
style: {
|
|
81
81
|
width: `${(1 - state.getThumbPercent(0)) * 100}%`,
|
|
82
82
|
// @ts-ignore
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
'--spectrum-track-background-size': `${1 / (1 - state.getThumbPercent(0)) * 100}%`,
|
|
84
|
+
'--spectrum-track-background-position': direction === 'ltr' ? '100%' : '0'
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
let filledTrack = null;
|
|
@@ -90,8 +90,8 @@ function $a1251704aa53e1a5$var$Slider(props, ref) {
|
|
|
90
90
|
let isRightOfOffset = width > 0;
|
|
91
91
|
let offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);
|
|
92
92
|
filledTrack = /*#__PURE__*/ (0, $i1AIe$react).createElement("div", {
|
|
93
|
-
className: (0, $i1AIe$classNames)((0, ($parcel$interopDefault($i1AIe$slider_vars_cssmodulejs))),
|
|
94
|
-
|
|
93
|
+
className: (0, $i1AIe$classNames)((0, ($parcel$interopDefault($i1AIe$slider_vars_cssmodulejs))), 'spectrum-Slider-fill', {
|
|
94
|
+
'spectrum-Slider-fill--right': isRightOfOffset
|
|
95
95
|
}),
|
|
96
96
|
style: {
|
|
97
97
|
[cssDirection]: `${offset * 100}%`,
|
package/dist/Slider.module.js
CHANGED
|
@@ -52,17 +52,17 @@ function $a1251704aa53e1a5$var$Slider(props, ref) {
|
|
|
52
52
|
...baseProps,
|
|
53
53
|
ref: ref,
|
|
54
54
|
classes: {
|
|
55
|
-
|
|
55
|
+
'spectrum-Slider--filled': isFilled && fillOffset == null
|
|
56
56
|
},
|
|
57
57
|
style: // @ts-ignore
|
|
58
58
|
{
|
|
59
|
-
|
|
59
|
+
'--spectrum-slider-track-gradient': trackGradient && `linear-gradient(to ${direction === 'ltr' ? 'right' : 'left'}, ${trackGradient.join(', ')})`
|
|
60
60
|
}
|
|
61
61
|
}, ({ trackRef: trackRef, inputRef: inputRef, state: state })=>{
|
|
62
62
|
fillOffset = fillOffset != null ? (0, $i1AIe$clamp)(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : fillOffset;
|
|
63
|
-
let cssDirection = direction ===
|
|
63
|
+
let cssDirection = direction === 'rtl' ? 'right' : 'left';
|
|
64
64
|
let lowerTrack = /*#__PURE__*/ (0, $i1AIe$react).createElement("div", {
|
|
65
|
-
className: (0, $i1AIe$classNames)((0, ($parcel$interopDefault($i1AIe$slider_vars_cssmodulejs))),
|
|
65
|
+
className: (0, $i1AIe$classNames)((0, ($parcel$interopDefault($i1AIe$slider_vars_cssmodulejs))), 'spectrum-Slider-track'),
|
|
66
66
|
style: {
|
|
67
67
|
width: `${state.getThumbPercent(0) * 100}%`,
|
|
68
68
|
// TODO not sure if it has advantages, but this could also be implemented as CSS calc():
|
|
@@ -71,17 +71,17 @@ function $a1251704aa53e1a5$var$Slider(props, ref) {
|
|
|
71
71
|
// width: calc(var(--width) * 1%)M
|
|
72
72
|
// }
|
|
73
73
|
// @ts-ignore
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
'--spectrum-track-background-size': `${1 / state.getThumbPercent(0) * 100}%`,
|
|
75
|
+
'--spectrum-track-background-position': direction === 'ltr' ? '0' : '100%'
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
let upperTrack = /*#__PURE__*/ (0, $i1AIe$react).createElement("div", {
|
|
79
|
-
className: (0, $i1AIe$classNames)((0, ($parcel$interopDefault($i1AIe$slider_vars_cssmodulejs))),
|
|
79
|
+
className: (0, $i1AIe$classNames)((0, ($parcel$interopDefault($i1AIe$slider_vars_cssmodulejs))), 'spectrum-Slider-track'),
|
|
80
80
|
style: {
|
|
81
81
|
width: `${(1 - state.getThumbPercent(0)) * 100}%`,
|
|
82
82
|
// @ts-ignore
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
'--spectrum-track-background-size': `${1 / (1 - state.getThumbPercent(0)) * 100}%`,
|
|
84
|
+
'--spectrum-track-background-position': direction === 'ltr' ? '100%' : '0'
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
let filledTrack = null;
|
|
@@ -90,8 +90,8 @@ function $a1251704aa53e1a5$var$Slider(props, ref) {
|
|
|
90
90
|
let isRightOfOffset = width > 0;
|
|
91
91
|
let offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);
|
|
92
92
|
filledTrack = /*#__PURE__*/ (0, $i1AIe$react).createElement("div", {
|
|
93
|
-
className: (0, $i1AIe$classNames)((0, ($parcel$interopDefault($i1AIe$slider_vars_cssmodulejs))),
|
|
94
|
-
|
|
93
|
+
className: (0, $i1AIe$classNames)((0, ($parcel$interopDefault($i1AIe$slider_vars_cssmodulejs))), 'spectrum-Slider-fill', {
|
|
94
|
+
'spectrum-Slider-fill--right': isRightOfOffset
|
|
95
95
|
}),
|
|
96
96
|
style: {
|
|
97
97
|
[cssDirection]: `${offset * 100}%`,
|
package/dist/SliderBase.main.js
CHANGED
|
@@ -36,20 +36,20 @@ $parcel$export(module.exports, "SliderBase", () => $ec6ca573d82152ff$export$9418
|
|
|
36
36
|
|
|
37
37
|
function $ec6ca573d82152ff$var$SliderBase(props, ref) {
|
|
38
38
|
props = (0, $2j89m$reactspectrumprovider.useProviderProps)(props);
|
|
39
|
-
let { isDisabled: isDisabled, children: children, classes: classes, style: style, labelPosition: labelPosition =
|
|
39
|
+
let { isDisabled: isDisabled, children: children, classes: classes, style: style, labelPosition: labelPosition = 'top', getValueLabel: getValueLabel, showValueLabel: showValueLabel = !!props.label, formatOptions: formatOptions, minValue: minValue = 0, maxValue: maxValue = 100, ...otherProps } = props;
|
|
40
40
|
let { styleProps: styleProps } = (0, $2j89m$reactspectrumutils.useStyleProps)(otherProps);
|
|
41
41
|
// `Math.abs(Math.sign(a) - Math.sign(b)) === 2` is true if the values have a different sign.
|
|
42
42
|
let alwaysDisplaySign = Math.abs(Math.sign(minValue) - Math.sign(maxValue)) === 2;
|
|
43
43
|
if (alwaysDisplaySign) {
|
|
44
44
|
if (formatOptions != null) {
|
|
45
|
-
if (!(
|
|
45
|
+
if (!('signDisplay' in formatOptions)) formatOptions = {
|
|
46
46
|
...formatOptions,
|
|
47
47
|
// @ts-ignore
|
|
48
|
-
signDisplay:
|
|
48
|
+
signDisplay: 'exceptZero'
|
|
49
49
|
};
|
|
50
50
|
} else // @ts-ignore
|
|
51
51
|
formatOptions = {
|
|
52
|
-
signDisplay:
|
|
52
|
+
signDisplay: 'exceptZero'
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
const formatter = (0, $2j89m$reactariai18n.useNumberFormatter)(formatOptions);
|
|
@@ -63,9 +63,9 @@ function $ec6ca573d82152ff$var$SliderBase(props, ref) {
|
|
|
63
63
|
let { groupProps: groupProps, trackProps: trackProps, labelProps: labelProps, outputProps: outputProps } = (0, $2j89m$reactariaslider.useSlider)(props, state, trackRef);
|
|
64
64
|
let inputRef = (0, $2j89m$react.useRef)();
|
|
65
65
|
let domRef = (0, $2j89m$reactspectrumutils.useFocusableRef)(ref, inputRef);
|
|
66
|
-
let displayValue =
|
|
66
|
+
let displayValue = '';
|
|
67
67
|
let maxLabelLength = undefined;
|
|
68
|
-
if (typeof getValueLabel ===
|
|
68
|
+
if (typeof getValueLabel === 'function') {
|
|
69
69
|
displayValue = getValueLabel(state.values);
|
|
70
70
|
switch(state.values.length){
|
|
71
71
|
case 1:
|
|
@@ -92,7 +92,7 @@ function $ec6ca573d82152ff$var$SliderBase(props, ref) {
|
|
|
92
92
|
]).length);
|
|
93
93
|
break;
|
|
94
94
|
default:
|
|
95
|
-
throw new Error(
|
|
95
|
+
throw new Error('Only sliders with 1 or 2 handles are supported!');
|
|
96
96
|
}
|
|
97
97
|
} else {
|
|
98
98
|
maxLabelLength = Math.max([
|
|
@@ -116,16 +116,16 @@ function $ec6ca573d82152ff$var$SliderBase(props, ref) {
|
|
|
116
116
|
].length);
|
|
117
117
|
break;
|
|
118
118
|
default:
|
|
119
|
-
throw new Error(
|
|
119
|
+
throw new Error('Only sliders with 1 or 2 handles are supported!');
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
let labelNode = /*#__PURE__*/ (0, ($parcel$interopDefault($2j89m$react))).createElement("label", {
|
|
123
|
-
className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
123
|
+
className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-label'),
|
|
124
124
|
...labelProps
|
|
125
125
|
}, props.label);
|
|
126
126
|
let valueNode = /*#__PURE__*/ (0, ($parcel$interopDefault($2j89m$react))).createElement("output", {
|
|
127
127
|
...outputProps,
|
|
128
|
-
className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
128
|
+
className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-value'),
|
|
129
129
|
style: maxLabelLength && {
|
|
130
130
|
width: `${maxLabelLength}ch`,
|
|
131
131
|
minWidth: `${maxLabelLength}ch`
|
|
@@ -133,10 +133,10 @@ function $ec6ca573d82152ff$var$SliderBase(props, ref) {
|
|
|
133
133
|
}, displayValue);
|
|
134
134
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($2j89m$react))).createElement("div", {
|
|
135
135
|
ref: domRef,
|
|
136
|
-
className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider', {
|
|
137
|
+
'spectrum-Slider--positionTop': labelPosition === 'top',
|
|
138
|
+
'spectrum-Slider--positionSide': labelPosition === 'side',
|
|
139
|
+
'is-disabled': isDisabled
|
|
140
140
|
}, classes, styleProps.className),
|
|
141
141
|
style: {
|
|
142
142
|
...style,
|
|
@@ -144,16 +144,16 @@ function $ec6ca573d82152ff$var$SliderBase(props, ref) {
|
|
|
144
144
|
},
|
|
145
145
|
...groupProps
|
|
146
146
|
}, props.label && /*#__PURE__*/ (0, ($parcel$interopDefault($2j89m$react))).createElement("div", {
|
|
147
|
-
className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
147
|
+
className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-labelContainer'),
|
|
148
148
|
role: "presentation"
|
|
149
149
|
}, props.label && labelNode, props.contextualHelp && /*#__PURE__*/ (0, ($parcel$interopDefault($2j89m$react))).createElement((0, $2j89m$reactspectrumutils.SlotProvider), {
|
|
150
150
|
slots: {
|
|
151
151
|
actionButton: {
|
|
152
|
-
UNSAFE_className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
152
|
+
UNSAFE_className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-contextualHelp')
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
}, props.contextualHelp), labelPosition ===
|
|
156
|
-
className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
155
|
+
}, props.contextualHelp), labelPosition === 'top' && showValueLabel && valueNode), /*#__PURE__*/ (0, ($parcel$interopDefault($2j89m$react))).createElement("div", {
|
|
156
|
+
className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-controls'),
|
|
157
157
|
ref: trackRef,
|
|
158
158
|
...trackProps,
|
|
159
159
|
role: "presentation"
|
|
@@ -161,8 +161,8 @@ function $ec6ca573d82152ff$var$SliderBase(props, ref) {
|
|
|
161
161
|
trackRef: trackRef,
|
|
162
162
|
inputRef: inputRef,
|
|
163
163
|
state: state
|
|
164
|
-
})), labelPosition ===
|
|
165
|
-
className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
164
|
+
})), labelPosition === 'side' && /*#__PURE__*/ (0, ($parcel$interopDefault($2j89m$react))).createElement("div", {
|
|
165
|
+
className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-valueLabelContainer'),
|
|
166
166
|
role: "presentation"
|
|
167
167
|
}, showValueLabel && valueNode));
|
|
168
168
|
}
|
package/dist/SliderBase.mjs
CHANGED
|
@@ -30,20 +30,20 @@ function $parcel$interopDefault(a) {
|
|
|
30
30
|
|
|
31
31
|
function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
32
32
|
props = (0, $63Ecs$useProviderProps)(props);
|
|
33
|
-
let { isDisabled: isDisabled, children: children, classes: classes, style: style, labelPosition: labelPosition =
|
|
33
|
+
let { isDisabled: isDisabled, children: children, classes: classes, style: style, labelPosition: labelPosition = 'top', getValueLabel: getValueLabel, showValueLabel: showValueLabel = !!props.label, formatOptions: formatOptions, minValue: minValue = 0, maxValue: maxValue = 100, ...otherProps } = props;
|
|
34
34
|
let { styleProps: styleProps } = (0, $63Ecs$useStyleProps)(otherProps);
|
|
35
35
|
// `Math.abs(Math.sign(a) - Math.sign(b)) === 2` is true if the values have a different sign.
|
|
36
36
|
let alwaysDisplaySign = Math.abs(Math.sign(minValue) - Math.sign(maxValue)) === 2;
|
|
37
37
|
if (alwaysDisplaySign) {
|
|
38
38
|
if (formatOptions != null) {
|
|
39
|
-
if (!(
|
|
39
|
+
if (!('signDisplay' in formatOptions)) formatOptions = {
|
|
40
40
|
...formatOptions,
|
|
41
41
|
// @ts-ignore
|
|
42
|
-
signDisplay:
|
|
42
|
+
signDisplay: 'exceptZero'
|
|
43
43
|
};
|
|
44
44
|
} else // @ts-ignore
|
|
45
45
|
formatOptions = {
|
|
46
|
-
signDisplay:
|
|
46
|
+
signDisplay: 'exceptZero'
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
const formatter = (0, $63Ecs$useNumberFormatter)(formatOptions);
|
|
@@ -57,9 +57,9 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
57
57
|
let { groupProps: groupProps, trackProps: trackProps, labelProps: labelProps, outputProps: outputProps } = (0, $63Ecs$useSlider)(props, state, trackRef);
|
|
58
58
|
let inputRef = (0, $63Ecs$useRef)();
|
|
59
59
|
let domRef = (0, $63Ecs$useFocusableRef)(ref, inputRef);
|
|
60
|
-
let displayValue =
|
|
60
|
+
let displayValue = '';
|
|
61
61
|
let maxLabelLength = undefined;
|
|
62
|
-
if (typeof getValueLabel ===
|
|
62
|
+
if (typeof getValueLabel === 'function') {
|
|
63
63
|
displayValue = getValueLabel(state.values);
|
|
64
64
|
switch(state.values.length){
|
|
65
65
|
case 1:
|
|
@@ -86,7 +86,7 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
86
86
|
]).length);
|
|
87
87
|
break;
|
|
88
88
|
default:
|
|
89
|
-
throw new Error(
|
|
89
|
+
throw new Error('Only sliders with 1 or 2 handles are supported!');
|
|
90
90
|
}
|
|
91
91
|
} else {
|
|
92
92
|
maxLabelLength = Math.max([
|
|
@@ -110,16 +110,16 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
110
110
|
].length);
|
|
111
111
|
break;
|
|
112
112
|
default:
|
|
113
|
-
throw new Error(
|
|
113
|
+
throw new Error('Only sliders with 1 or 2 handles are supported!');
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
let labelNode = /*#__PURE__*/ (0, $63Ecs$react).createElement("label", {
|
|
117
|
-
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))),
|
|
117
|
+
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-label'),
|
|
118
118
|
...labelProps
|
|
119
119
|
}, props.label);
|
|
120
120
|
let valueNode = /*#__PURE__*/ (0, $63Ecs$react).createElement("output", {
|
|
121
121
|
...outputProps,
|
|
122
|
-
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))),
|
|
122
|
+
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-value'),
|
|
123
123
|
style: maxLabelLength && {
|
|
124
124
|
width: `${maxLabelLength}ch`,
|
|
125
125
|
minWidth: `${maxLabelLength}ch`
|
|
@@ -127,10 +127,10 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
127
127
|
}, displayValue);
|
|
128
128
|
return /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
|
|
129
129
|
ref: domRef,
|
|
130
|
-
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))),
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider', {
|
|
131
|
+
'spectrum-Slider--positionTop': labelPosition === 'top',
|
|
132
|
+
'spectrum-Slider--positionSide': labelPosition === 'side',
|
|
133
|
+
'is-disabled': isDisabled
|
|
134
134
|
}, classes, styleProps.className),
|
|
135
135
|
style: {
|
|
136
136
|
...style,
|
|
@@ -138,16 +138,16 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
138
138
|
},
|
|
139
139
|
...groupProps
|
|
140
140
|
}, props.label && /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
|
|
141
|
-
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))),
|
|
141
|
+
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-labelContainer'),
|
|
142
142
|
role: "presentation"
|
|
143
143
|
}, props.label && labelNode, props.contextualHelp && /*#__PURE__*/ (0, $63Ecs$react).createElement((0, $63Ecs$SlotProvider), {
|
|
144
144
|
slots: {
|
|
145
145
|
actionButton: {
|
|
146
|
-
UNSAFE_className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))),
|
|
146
|
+
UNSAFE_className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-contextualHelp')
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
}, props.contextualHelp), labelPosition ===
|
|
150
|
-
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))),
|
|
149
|
+
}, props.contextualHelp), labelPosition === 'top' && showValueLabel && valueNode), /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
|
|
150
|
+
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-controls'),
|
|
151
151
|
ref: trackRef,
|
|
152
152
|
...trackProps,
|
|
153
153
|
role: "presentation"
|
|
@@ -155,8 +155,8 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
155
155
|
trackRef: trackRef,
|
|
156
156
|
inputRef: inputRef,
|
|
157
157
|
state: state
|
|
158
|
-
})), labelPosition ===
|
|
159
|
-
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))),
|
|
158
|
+
})), labelPosition === 'side' && /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
|
|
159
|
+
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-valueLabelContainer'),
|
|
160
160
|
role: "presentation"
|
|
161
161
|
}, showValueLabel && valueNode));
|
|
162
162
|
}
|
|
@@ -30,20 +30,20 @@ function $parcel$interopDefault(a) {
|
|
|
30
30
|
|
|
31
31
|
function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
32
32
|
props = (0, $63Ecs$useProviderProps)(props);
|
|
33
|
-
let { isDisabled: isDisabled, children: children, classes: classes, style: style, labelPosition: labelPosition =
|
|
33
|
+
let { isDisabled: isDisabled, children: children, classes: classes, style: style, labelPosition: labelPosition = 'top', getValueLabel: getValueLabel, showValueLabel: showValueLabel = !!props.label, formatOptions: formatOptions, minValue: minValue = 0, maxValue: maxValue = 100, ...otherProps } = props;
|
|
34
34
|
let { styleProps: styleProps } = (0, $63Ecs$useStyleProps)(otherProps);
|
|
35
35
|
// `Math.abs(Math.sign(a) - Math.sign(b)) === 2` is true if the values have a different sign.
|
|
36
36
|
let alwaysDisplaySign = Math.abs(Math.sign(minValue) - Math.sign(maxValue)) === 2;
|
|
37
37
|
if (alwaysDisplaySign) {
|
|
38
38
|
if (formatOptions != null) {
|
|
39
|
-
if (!(
|
|
39
|
+
if (!('signDisplay' in formatOptions)) formatOptions = {
|
|
40
40
|
...formatOptions,
|
|
41
41
|
// @ts-ignore
|
|
42
|
-
signDisplay:
|
|
42
|
+
signDisplay: 'exceptZero'
|
|
43
43
|
};
|
|
44
44
|
} else // @ts-ignore
|
|
45
45
|
formatOptions = {
|
|
46
|
-
signDisplay:
|
|
46
|
+
signDisplay: 'exceptZero'
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
const formatter = (0, $63Ecs$useNumberFormatter)(formatOptions);
|
|
@@ -57,9 +57,9 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
57
57
|
let { groupProps: groupProps, trackProps: trackProps, labelProps: labelProps, outputProps: outputProps } = (0, $63Ecs$useSlider)(props, state, trackRef);
|
|
58
58
|
let inputRef = (0, $63Ecs$useRef)();
|
|
59
59
|
let domRef = (0, $63Ecs$useFocusableRef)(ref, inputRef);
|
|
60
|
-
let displayValue =
|
|
60
|
+
let displayValue = '';
|
|
61
61
|
let maxLabelLength = undefined;
|
|
62
|
-
if (typeof getValueLabel ===
|
|
62
|
+
if (typeof getValueLabel === 'function') {
|
|
63
63
|
displayValue = getValueLabel(state.values);
|
|
64
64
|
switch(state.values.length){
|
|
65
65
|
case 1:
|
|
@@ -86,7 +86,7 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
86
86
|
]).length);
|
|
87
87
|
break;
|
|
88
88
|
default:
|
|
89
|
-
throw new Error(
|
|
89
|
+
throw new Error('Only sliders with 1 or 2 handles are supported!');
|
|
90
90
|
}
|
|
91
91
|
} else {
|
|
92
92
|
maxLabelLength = Math.max([
|
|
@@ -110,16 +110,16 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
110
110
|
].length);
|
|
111
111
|
break;
|
|
112
112
|
default:
|
|
113
|
-
throw new Error(
|
|
113
|
+
throw new Error('Only sliders with 1 or 2 handles are supported!');
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
let labelNode = /*#__PURE__*/ (0, $63Ecs$react).createElement("label", {
|
|
117
|
-
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))),
|
|
117
|
+
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-label'),
|
|
118
118
|
...labelProps
|
|
119
119
|
}, props.label);
|
|
120
120
|
let valueNode = /*#__PURE__*/ (0, $63Ecs$react).createElement("output", {
|
|
121
121
|
...outputProps,
|
|
122
|
-
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))),
|
|
122
|
+
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-value'),
|
|
123
123
|
style: maxLabelLength && {
|
|
124
124
|
width: `${maxLabelLength}ch`,
|
|
125
125
|
minWidth: `${maxLabelLength}ch`
|
|
@@ -127,10 +127,10 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
127
127
|
}, displayValue);
|
|
128
128
|
return /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
|
|
129
129
|
ref: domRef,
|
|
130
|
-
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))),
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider', {
|
|
131
|
+
'spectrum-Slider--positionTop': labelPosition === 'top',
|
|
132
|
+
'spectrum-Slider--positionSide': labelPosition === 'side',
|
|
133
|
+
'is-disabled': isDisabled
|
|
134
134
|
}, classes, styleProps.className),
|
|
135
135
|
style: {
|
|
136
136
|
...style,
|
|
@@ -138,16 +138,16 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
138
138
|
},
|
|
139
139
|
...groupProps
|
|
140
140
|
}, props.label && /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
|
|
141
|
-
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))),
|
|
141
|
+
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-labelContainer'),
|
|
142
142
|
role: "presentation"
|
|
143
143
|
}, props.label && labelNode, props.contextualHelp && /*#__PURE__*/ (0, $63Ecs$react).createElement((0, $63Ecs$SlotProvider), {
|
|
144
144
|
slots: {
|
|
145
145
|
actionButton: {
|
|
146
|
-
UNSAFE_className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))),
|
|
146
|
+
UNSAFE_className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-contextualHelp')
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
}, props.contextualHelp), labelPosition ===
|
|
150
|
-
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))),
|
|
149
|
+
}, props.contextualHelp), labelPosition === 'top' && showValueLabel && valueNode), /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
|
|
150
|
+
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-controls'),
|
|
151
151
|
ref: trackRef,
|
|
152
152
|
...trackProps,
|
|
153
153
|
role: "presentation"
|
|
@@ -155,8 +155,8 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
|
|
|
155
155
|
trackRef: trackRef,
|
|
156
156
|
inputRef: inputRef,
|
|
157
157
|
state: state
|
|
158
|
-
})), labelPosition ===
|
|
159
|
-
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))),
|
|
158
|
+
})), labelPosition === 'side' && /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
|
|
159
|
+
className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-valueLabelContainer'),
|
|
160
160
|
role: "presentation"
|
|
161
161
|
}, showValueLabel && valueNode));
|
|
162
162
|
}
|
package/dist/SliderThumb.main.js
CHANGED
|
@@ -47,17 +47,17 @@ function $77acc7fb8bfd13d6$export$2c1b491743890dec(props) {
|
|
|
47
47
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $75NyJ$reactariainteractions.useHover)({});
|
|
48
48
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($75NyJ$react))).createElement((0, $75NyJ$reactariafocus.FocusRing), {
|
|
49
49
|
within: true,
|
|
50
|
-
focusRingClass: (0, $75NyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
50
|
+
focusRingClass: (0, $75NyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'is-focused')
|
|
51
51
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($75NyJ$react))).createElement("div", {
|
|
52
|
-
className: (0, $75NyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
className: (0, $75NyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-handle', {
|
|
53
|
+
'is-hovered': isHovered,
|
|
54
|
+
'is-dragged': isDragging,
|
|
55
|
+
'is-tophandle': isFocused
|
|
56
56
|
}),
|
|
57
57
|
...(0, $75NyJ$reactariautils.mergeProps)(thumbProps, hoverProps),
|
|
58
58
|
role: "presentation"
|
|
59
59
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($75NyJ$react))).createElement((0, $75NyJ$reactariavisuallyhidden.VisuallyHidden), null, /*#__PURE__*/ (0, ($parcel$interopDefault($75NyJ$react))).createElement("input", {
|
|
60
|
-
className: (0, $75NyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))),
|
|
60
|
+
className: (0, $75NyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-input'),
|
|
61
61
|
ref: inputRef,
|
|
62
62
|
...inputProps
|
|
63
63
|
}))));
|
package/dist/SliderThumb.mjs
CHANGED
|
@@ -41,17 +41,17 @@ function $9058ca69d66a724f$export$2c1b491743890dec(props) {
|
|
|
41
41
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $fQERx$useHover)({});
|
|
42
42
|
return /*#__PURE__*/ (0, $fQERx$react).createElement((0, $fQERx$FocusRing), {
|
|
43
43
|
within: true,
|
|
44
|
-
focusRingClass: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))),
|
|
44
|
+
focusRingClass: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))), 'is-focused')
|
|
45
45
|
}, /*#__PURE__*/ (0, $fQERx$react).createElement("div", {
|
|
46
|
-
className: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
className: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))), 'spectrum-Slider-handle', {
|
|
47
|
+
'is-hovered': isHovered,
|
|
48
|
+
'is-dragged': isDragging,
|
|
49
|
+
'is-tophandle': isFocused
|
|
50
50
|
}),
|
|
51
51
|
...(0, $fQERx$mergeProps)(thumbProps, hoverProps),
|
|
52
52
|
role: "presentation"
|
|
53
53
|
}, /*#__PURE__*/ (0, $fQERx$react).createElement((0, $fQERx$VisuallyHidden), null, /*#__PURE__*/ (0, $fQERx$react).createElement("input", {
|
|
54
|
-
className: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))),
|
|
54
|
+
className: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))), 'spectrum-Slider-input'),
|
|
55
55
|
ref: inputRef,
|
|
56
56
|
...inputProps
|
|
57
57
|
}))));
|
|
@@ -41,17 +41,17 @@ function $9058ca69d66a724f$export$2c1b491743890dec(props) {
|
|
|
41
41
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $fQERx$useHover)({});
|
|
42
42
|
return /*#__PURE__*/ (0, $fQERx$react).createElement((0, $fQERx$FocusRing), {
|
|
43
43
|
within: true,
|
|
44
|
-
focusRingClass: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))),
|
|
44
|
+
focusRingClass: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))), 'is-focused')
|
|
45
45
|
}, /*#__PURE__*/ (0, $fQERx$react).createElement("div", {
|
|
46
|
-
className: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
className: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))), 'spectrum-Slider-handle', {
|
|
47
|
+
'is-hovered': isHovered,
|
|
48
|
+
'is-dragged': isDragging,
|
|
49
|
+
'is-tophandle': isFocused
|
|
50
50
|
}),
|
|
51
51
|
...(0, $fQERx$mergeProps)(thumbProps, hoverProps),
|
|
52
52
|
role: "presentation"
|
|
53
53
|
}, /*#__PURE__*/ (0, $fQERx$react).createElement((0, $fQERx$VisuallyHidden), null, /*#__PURE__*/ (0, $fQERx$react).createElement("input", {
|
|
54
|
-
className: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))),
|
|
54
|
+
className: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))), 'spectrum-Slider-input'),
|
|
55
55
|
ref: inputRef,
|
|
56
56
|
...inputProps
|
|
57
57
|
}))));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/slider",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.10-nightly.4629+c34886769",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,20 +36,20 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/focus": "3.0.0-nightly.
|
|
40
|
-
"@react-aria/i18n": "3.0.0-nightly.
|
|
41
|
-
"@react-aria/interactions": "3.0.0-nightly.
|
|
42
|
-
"@react-aria/slider": "3.7.
|
|
43
|
-
"@react-aria/utils": "3.0.0-nightly.
|
|
44
|
-
"@react-aria/visually-hidden": "3.0.0-nightly.
|
|
45
|
-
"@react-spectrum/utils": "3.0.0-nightly.
|
|
46
|
-
"@react-stately/slider": "3.5.
|
|
47
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
48
|
-
"@react-types/slider": "3.7.
|
|
39
|
+
"@react-aria/focus": "3.0.0-nightly.2917+c34886769",
|
|
40
|
+
"@react-aria/i18n": "3.0.0-nightly.2917+c34886769",
|
|
41
|
+
"@react-aria/interactions": "3.0.0-nightly.2917+c34886769",
|
|
42
|
+
"@react-aria/slider": "3.7.9-nightly.4629+c34886769",
|
|
43
|
+
"@react-aria/utils": "3.0.0-nightly.2917+c34886769",
|
|
44
|
+
"@react-aria/visually-hidden": "3.0.0-nightly.2917+c34886769",
|
|
45
|
+
"@react-spectrum/utils": "3.0.0-nightly.2917+c34886769",
|
|
46
|
+
"@react-stately/slider": "3.5.5-nightly.4629+c34886769",
|
|
47
|
+
"@react-types/shared": "3.0.0-nightly.2917+c34886769",
|
|
48
|
+
"@react-types/slider": "3.7.4-nightly.4629+c34886769",
|
|
49
49
|
"@swc/helpers": "^0.5.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@adobe/spectrum-css-temp": "3.0.0-nightly.
|
|
52
|
+
"@adobe/spectrum-css-temp": "3.0.0-nightly.2917+c34886769"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@react-spectrum/provider": "^3.0.0",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "c34886769d3e69bb56553a02eead6a0fd877e754"
|
|
62
62
|
}
|