@react-spectrum/slider
Advanced tools
Comparing version 3.0.0-nightly.2507 to 3.0.0-nightly.2508
@@ -31,4 +31,2 @@ var _babelRuntimeHelpersInteropRequireDefault = $parcel$interopDefault(require("@babel/runtime/helpers/interopRequireDefault")); | ||
var { | ||
DEFAULT_MAX_VALUE, | ||
DEFAULT_MIN_VALUE, | ||
useSliderState | ||
@@ -121,4 +119,4 @@ } = require("@react-stately/slider"); | ||
formatOptions, | ||
minValue = DEFAULT_MIN_VALUE, | ||
maxValue = DEFAULT_MAX_VALUE | ||
minValue = 0, | ||
maxValue = 100 | ||
} = props, | ||
@@ -151,7 +149,9 @@ otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["isDisabled", "children", "classes", "style", "labelPosition", "getValueLabel", "showValueLabel", "formatOptions", "minValue", "maxValue"]); | ||
const state = useSliderState(_babelRuntimeHelpersExtends({}, props, { | ||
numberFormatter: formatter | ||
numberFormatter: formatter, | ||
minValue, | ||
maxValue | ||
})); | ||
let trackRef = useRef(); | ||
let { | ||
containerProps, | ||
groupProps, | ||
trackProps, | ||
@@ -223,3 +223,3 @@ labelProps, | ||
style: _babelRuntimeHelpersExtends({}, style, styleProps.style) | ||
}, containerProps), props.label && /*#__PURE__*/_react.createElement("div", { | ||
}, groupProps), props.label && /*#__PURE__*/_react.createElement("div", { | ||
className: classNames($c8f0b01c76499f8ceef39abc1b587900$$interop$default, 'spectrum-Slider-labelContainer'), | ||
@@ -288,3 +288,4 @@ role: "presentation" | ||
let { | ||
onChange, | ||
onChange: _onChange, | ||
onChangeEnd: _onChangeEnd, | ||
value, | ||
@@ -297,3 +298,3 @@ defaultValue, | ||
} = props, | ||
otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["onChange", "value", "defaultValue", "isFilled", "fillOffset", "trackGradient", "getValueLabel"]); | ||
otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["onChange", "onChangeEnd", "value", "defaultValue", "isFilled", "fillOffset", "trackGradient", "getValueLabel"]); | ||
@@ -304,7 +305,8 @@ let baseProps = _babelRuntimeHelpersExtends({}, otherProps, { | ||
defaultValue: defaultValue != null ? [defaultValue] : undefined, | ||
onChange(v) { | ||
onChange == null ? void 0 : onChange(v[0]); | ||
onChange: v => { | ||
_onChange == null ? void 0 : _onChange(v[0]); | ||
}, | ||
onChangeEnd: v => { | ||
_onChangeEnd == null ? void 0 : _onChangeEnd(v[0]); | ||
}, | ||
getValueLabel: getValueLabel ? (_ref) => { | ||
@@ -326,3 +328,3 @@ let [v] = _ref; | ||
{ | ||
'--spectrum-slider-track-color': trackGradient && "linear-gradient(to " + (direction === 'ltr' ? 'right' : 'left') + ", " + trackGradient.join(', ') + ")" | ||
'--spectrum-slider-track-gradient': trackGradient && "linear-gradient(to " + (direction === 'ltr' ? 'right' : 'left') + ", " + trackGradient.join(', ') + ")" | ||
} | ||
@@ -389,3 +391,7 @@ }), (_ref2) => { | ||
} | ||
/** | ||
* Sliders allow users to quickly select a value within a range. They should be used when the upper and lower bounds to the range are invariable. | ||
*/ | ||
const Slider = _react.forwardRef($de4e99e1d6ad6d61a9bc95d4631$var$Slider); | ||
@@ -531,2 +537,3 @@ | ||
onChange, | ||
onChangeEnd, | ||
value, | ||
@@ -536,3 +543,3 @@ defaultValue, | ||
} = props, | ||
otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["onChange", "value", "defaultValue", "getValueLabel"]); | ||
otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["onChange", "onChangeEnd", "value", "defaultValue", "getValueLabel"]); | ||
@@ -542,3 +549,3 @@ let baseProps = _babelRuntimeHelpersExtends({}, otherProps, { | ||
defaultValue: defaultValue != null ? [defaultValue.start, defaultValue.end] // make sure that useSliderState knows we have two handles | ||
: [(_props$minValue = props.minValue) != null ? _props$minValue : DEFAULT_MIN_VALUE, (_props$maxValue = props.maxValue) != null ? _props$maxValue : DEFAULT_MAX_VALUE], | ||
: [(_props$minValue = props.minValue) != null ? _props$minValue : 0, (_props$maxValue = props.maxValue) != null ? _props$maxValue : 100], | ||
@@ -552,2 +559,9 @@ onChange(v) { | ||
onChangeEnd(v) { | ||
onChangeEnd == null ? void 0 : onChangeEnd({ | ||
start: v[0], | ||
end: v[1] | ||
}); | ||
}, | ||
getValueLabel: getValueLabel ? (_ref) => { | ||
@@ -608,3 +622,7 @@ let [start, end] = _ref; | ||
} | ||
/** | ||
* RangeSliders allow users to quickly select a subset range. They should be used when the upper and lower bounds to the range are invariable. | ||
*/ | ||
const RangeSlider = _react.forwardRef($b7614884795b0b78874e0b09da85cc36$var$RangeSlider); | ||
@@ -611,0 +629,0 @@ |
@@ -8,3 +8,3 @@ import _babelRuntimeHelpersEsmInteropRequireDefault from "@babel/runtime/helpers/esm/interopRequireDefault"; | ||
import { useNumberFormatter, useLocale, useMessageFormatter } from "@react-aria/i18n"; | ||
import { DEFAULT_MAX_VALUE, DEFAULT_MIN_VALUE, useSliderState } from "@react-stately/slider"; | ||
import { useSliderState } from "@react-stately/slider"; | ||
import _react, { useRef } from "react"; | ||
@@ -76,4 +76,4 @@ import { classNames, useFocusableRef, useStyleProps } from "@react-spectrum/utils"; | ||
formatOptions, | ||
minValue = DEFAULT_MIN_VALUE, | ||
maxValue = DEFAULT_MAX_VALUE | ||
minValue = 0, | ||
maxValue = 100 | ||
} = props, | ||
@@ -106,7 +106,9 @@ otherProps = _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose(props, ["isDisabled", "children", "classes", "style", "labelPosition", "getValueLabel", "showValueLabel", "formatOptions", "minValue", "maxValue"]); | ||
const state = useSliderState(_babelRuntimeHelpersEsmExtends({}, props, { | ||
numberFormatter: formatter | ||
numberFormatter: formatter, | ||
minValue, | ||
maxValue | ||
})); | ||
let trackRef = useRef(); | ||
let { | ||
containerProps, | ||
groupProps, | ||
trackProps, | ||
@@ -178,3 +180,3 @@ labelProps, | ||
style: _babelRuntimeHelpersEsmExtends({}, style, styleProps.style) | ||
}, containerProps), props.label && /*#__PURE__*/_react.createElement("div", { | ||
}, groupProps), props.label && /*#__PURE__*/_react.createElement("div", { | ||
className: classNames($eba6840c1d0392d10739f5de841f2b2$$interop$default, 'spectrum-Slider-labelContainer'), | ||
@@ -243,3 +245,4 @@ role: "presentation" | ||
let { | ||
onChange, | ||
onChange: _onChange, | ||
onChangeEnd: _onChangeEnd, | ||
value, | ||
@@ -252,3 +255,3 @@ defaultValue, | ||
} = props, | ||
otherProps = _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose(props, ["onChange", "value", "defaultValue", "isFilled", "fillOffset", "trackGradient", "getValueLabel"]); | ||
otherProps = _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose(props, ["onChange", "onChangeEnd", "value", "defaultValue", "isFilled", "fillOffset", "trackGradient", "getValueLabel"]); | ||
@@ -259,7 +262,8 @@ let baseProps = _babelRuntimeHelpersEsmExtends({}, otherProps, { | ||
defaultValue: defaultValue != null ? [defaultValue] : undefined, | ||
onChange(v) { | ||
onChange == null ? void 0 : onChange(v[0]); | ||
onChange: v => { | ||
_onChange == null ? void 0 : _onChange(v[0]); | ||
}, | ||
onChangeEnd: v => { | ||
_onChangeEnd == null ? void 0 : _onChangeEnd(v[0]); | ||
}, | ||
getValueLabel: getValueLabel ? (_ref) => { | ||
@@ -281,3 +285,3 @@ let [v] = _ref; | ||
{ | ||
'--spectrum-slider-track-color': trackGradient && "linear-gradient(to " + (direction === 'ltr' ? 'right' : 'left') + ", " + trackGradient.join(', ') + ")" | ||
'--spectrum-slider-track-gradient': trackGradient && "linear-gradient(to " + (direction === 'ltr' ? 'right' : 'left') + ", " + trackGradient.join(', ') + ")" | ||
} | ||
@@ -344,3 +348,7 @@ }), (_ref2) => { | ||
} | ||
/** | ||
* Sliders allow users to quickly select a value within a range. They should be used when the upper and lower bounds to the range are invariable. | ||
*/ | ||
export const Slider = _react.forwardRef($d5011716cff08c69e3bb71328d5$var$Slider); | ||
@@ -484,2 +492,3 @@ // ASSET: /home/circleci/react-spectrum/packages/@react-spectrum/slider/intl/ar-AE.json | ||
onChange, | ||
onChangeEnd, | ||
value, | ||
@@ -489,3 +498,3 @@ defaultValue, | ||
} = props, | ||
otherProps = _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose(props, ["onChange", "value", "defaultValue", "getValueLabel"]); | ||
otherProps = _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose(props, ["onChange", "onChangeEnd", "value", "defaultValue", "getValueLabel"]); | ||
@@ -495,3 +504,3 @@ let baseProps = _babelRuntimeHelpersEsmExtends({}, otherProps, { | ||
defaultValue: defaultValue != null ? [defaultValue.start, defaultValue.end] // make sure that useSliderState knows we have two handles | ||
: [(_props$minValue = props.minValue) != null ? _props$minValue : DEFAULT_MIN_VALUE, (_props$maxValue = props.maxValue) != null ? _props$maxValue : DEFAULT_MAX_VALUE], | ||
: [(_props$minValue = props.minValue) != null ? _props$minValue : 0, (_props$maxValue = props.maxValue) != null ? _props$maxValue : 100], | ||
@@ -505,2 +514,9 @@ onChange(v) { | ||
onChangeEnd(v) { | ||
onChangeEnd == null ? void 0 : onChangeEnd({ | ||
start: v[0], | ||
end: v[1] | ||
}); | ||
}, | ||
getValueLabel: getValueLabel ? (_ref) => { | ||
@@ -561,4 +577,8 @@ let [start, end] = _ref; | ||
} | ||
/** | ||
* RangeSliders allow users to quickly select a subset range. They should be used when the upper and lower bounds to the range are invariable. | ||
*/ | ||
export const RangeSlider = _react.forwardRef($b5dd6507adf3d1434dcf5a8f595509$var$RangeSlider); | ||
//# sourceMappingURL=module.js.map |
import React from "react"; | ||
import { SpectrumSliderProps, SpectrumRangeSliderProps } from "@react-types/slider"; | ||
/** | ||
* Sliders allow users to quickly select a value within a range. They should be used when the upper and lower bounds to the range are invariable. | ||
*/ | ||
export const Slider: React.ForwardRefExoticComponent<SpectrumSliderProps & React.RefAttributes<import("@react-types/shared").FocusableRefValue<HTMLDivElement, HTMLDivElement>>>; | ||
/** | ||
* RangeSliders allow users to quickly select a subset range. They should be used when the upper and lower bounds to the range are invariable. | ||
*/ | ||
export const RangeSlider: React.ForwardRefExoticComponent<SpectrumRangeSliderProps & React.RefAttributes<import("@react-types/shared").FocusableRefValue<HTMLDivElement, HTMLDivElement>>>; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@react-spectrum/slider", | ||
"version": "3.0.0-nightly.2507+7e6b4464", | ||
"version": "3.0.0-nightly.2508+78347729", | ||
"description": "Spectrum UI components in React", | ||
@@ -35,15 +35,15 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-aria/focus": "3.0.0-nightly.829+7e6b4464", | ||
"@react-aria/i18n": "3.0.0-nightly.829+7e6b4464", | ||
"@react-aria/interactions": "3.0.0-nightly.829+7e6b4464", | ||
"@react-aria/slider": "3.0.0-nightly.2507+7e6b4464", | ||
"@react-aria/utils": "3.0.0-nightly.829+7e6b4464", | ||
"@react-aria/visually-hidden": "3.0.0-nightly.829+7e6b4464", | ||
"@react-spectrum/utils": "3.0.0-nightly.829+7e6b4464", | ||
"@react-stately/slider": "3.0.0-nightly.2507+7e6b4464", | ||
"@react-types/shared": "3.0.0-nightly.829+7e6b4464", | ||
"@react-types/slider": "3.0.0-nightly.2507+7e6b4464" | ||
"@react-aria/focus": "3.0.0-nightly.830+78347729", | ||
"@react-aria/i18n": "3.0.0-nightly.830+78347729", | ||
"@react-aria/interactions": "3.0.0-nightly.830+78347729", | ||
"@react-aria/slider": "3.0.0-nightly.2508+78347729", | ||
"@react-aria/utils": "3.0.0-nightly.830+78347729", | ||
"@react-aria/visually-hidden": "3.0.0-nightly.830+78347729", | ||
"@react-spectrum/utils": "3.0.0-nightly.830+78347729", | ||
"@react-stately/slider": "3.0.0-nightly.2508+78347729", | ||
"@react-types/shared": "3.0.0-nightly.830+78347729", | ||
"@react-types/slider": "3.0.0-nightly.2508+78347729" | ||
}, | ||
"devDependencies": { | ||
"@adobe/spectrum-css-temp": "3.0.0-nightly.829+7e6b4464" | ||
"@adobe/spectrum-css-temp": "3.0.0-nightly.830+78347729" | ||
}, | ||
@@ -57,3 +57,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "7e6b4464325888e177a56fff21b0a12dae673197" | ||
"gitHead": "78347729a1af5d16e7fa90120a258841d4cb55a7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
238933
1706