@react-spectrum/slider 3.6.10-nightly.4700 → 3.6.10-nightly.4704
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAwBD,SAAS,iCAAW,KAAsB,EAAE,GAAiC;IAC3E,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,cACF,UAAU,YACV,QAAQ,WACR,OAAO,SACP,KAAK,iBACL,gBAAgB,sBAChB,aAAa,kBACb,iBAAiB,CAAC,CAAC,MAAM,KAAK,iBAC9B,aAAa,YACb,WAAW,aACX,WAAW,KACX,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IAEjC,6FAA6F;IAC7F,IAAI,oBAAoB,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,eAAe;IAChF,IAAI,mBAAmB;QACrB,IAAI,iBAAiB,MACnB;YAAA,IAAI,CAAE,CAAA,iBAAiB,aAAY,GACjC,gBAAgB;gBACd,GAAG,aAAa;gBAChB,aAAa;gBACb,aAAa;YACf;QACF,OAEA,aAAa;QACb,gBAAgB;YAAC,aAAa;QAAY;IAE9C;IAEA,MAAM,YAAY,CAAA,GAAA,uCAAiB,EAAE;IACrC,MAAM,QAAQ,CAAA,GAAA,wCAAa,EAAE;QAC3B,GAAG,KAAK;QACR,iBAAiB;kBACjB;kBACA;IACF;IACA,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,cACF,UAAU,cACV,UAAU,cACV,UAAU,eACV,WAAW,EACZ,GAAG,CAAA,GAAA,gCAAQ,EAAE,OAAO,OAAO;IAE5B,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAA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served.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, SlotProvider, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport React, {CSSProperties, ReactNode,
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAwBD,SAAS,iCAAW,KAAsB,EAAE,GAAiC;IAC3E,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,cACF,UAAU,YACV,QAAQ,WACR,OAAO,SACP,KAAK,iBACL,gBAAgB,sBAChB,aAAa,kBACb,iBAAiB,CAAC,CAAC,MAAM,KAAK,iBAC9B,aAAa,YACb,WAAW,aACX,WAAW,KACX,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IAEjC,6FAA6F;IAC7F,IAAI,oBAAoB,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,eAAe;IAChF,IAAI,mBAAmB;QACrB,IAAI,iBAAiB,MACnB;YAAA,IAAI,CAAE,CAAA,iBAAiB,aAAY,GACjC,gBAAgB;gBACd,GAAG,aAAa;gBAChB,aAAa;gBACb,aAAa;YACf;QACF,OAEA,aAAa;QACb,gBAAgB;YAAC,aAAa;QAAY;IAE9C;IAEA,MAAM,YAAY,CAAA,GAAA,uCAAiB,EAAE;IACrC,MAAM,QAAQ,CAAA,GAAA,wCAAa,EAAE;QAC3B,GAAG,KAAK;QACR,iBAAiB;kBACjB;kBACA;IACF;IACA,IAAI,WAAW,CAAA,GA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A,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAAwC,MAAK;OAC7E,kBAAkB;AAK7B;AAEA,MAAM,0DAAc,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/slider/src/SliderBase.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, SlotProvider, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {FocusableRef, RefObject} from '@react-types/shared';\nimport React, {CSSProperties, ReactNode, useRef} from 'react';\nimport {SliderState, useSliderState} from '@react-stately/slider';\nimport {SpectrumBarSliderBase} from '@react-types/slider';\nimport styles from '@adobe/spectrum-css-temp/components/slider/vars.css';\nimport {useNumberFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useSlider} from '@react-aria/slider';\n\nexport interface SliderBaseChildArguments {\n inputRef: RefObject<HTMLInputElement | null>,\n trackRef: RefObject<HTMLElement | null>,\n state: SliderState\n}\n\nexport interface SliderBaseProps<T = number[]> extends SpectrumBarSliderBase<T> {\n children: (opts: SliderBaseChildArguments) => ReactNode,\n classes?: string[] | Object,\n style?: CSSProperties\n}\n\nfunction SliderBase(props: SliderBaseProps, ref: FocusableRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let {\n isDisabled,\n children,\n classes,\n style,\n labelPosition = 'top',\n getValueLabel,\n showValueLabel = !!props.label,\n formatOptions,\n minValue = 0,\n maxValue = 100,\n ...otherProps\n } = props;\n\n let {styleProps} = useStyleProps(otherProps);\n\n // `Math.abs(Math.sign(a) - Math.sign(b)) === 2` is true if the values have a different sign.\n let alwaysDisplaySign = Math.abs(Math.sign(minValue) - Math.sign(maxValue)) === 2;\n if (alwaysDisplaySign) {\n if (formatOptions != null) {\n if (!('signDisplay' in formatOptions)) {\n formatOptions = {\n ...formatOptions,\n // @ts-ignore\n signDisplay: 'exceptZero'\n };\n }\n } else {\n // @ts-ignore\n formatOptions = {signDisplay: 'exceptZero'};\n }\n }\n\n const formatter = useNumberFormatter(formatOptions);\n const state = useSliderState({\n ...props,\n numberFormatter: formatter,\n minValue,\n maxValue\n });\n let trackRef = useRef(undefined);\n let {\n groupProps,\n trackProps,\n labelProps,\n outputProps\n } = useSlider(props, state, trackRef);\n\n let inputRef = useRef(undefined);\n let domRef = useFocusableRef(ref, inputRef);\n\n let displayValue = '';\n let maxLabelLength = undefined;\n\n if (typeof getValueLabel === 'function') {\n displayValue = getValueLabel(state.values);\n switch (state.values.length) {\n case 1:\n maxLabelLength = Math.max(\n getValueLabel([minValue]).length,\n getValueLabel([maxValue]).length\n );\n break;\n case 2:\n // Try all possible combinations of min and max values.\n maxLabelLength = Math.max(\n getValueLabel([minValue, minValue]).length,\n getValueLabel([minValue, maxValue]).length,\n getValueLabel([maxValue, minValue]).length,\n getValueLabel([maxValue, maxValue]).length\n );\n break;\n default:\n throw new Error('Only sliders with 1 or 2 handles are supported!');\n }\n } else {\n maxLabelLength = Math.max([...formatter.format(minValue)].length, [...formatter.format(maxValue)].length);\n switch (state.values.length) {\n case 1:\n displayValue = state.getThumbValueLabel(0);\n break;\n case 2:\n // This should really use the NumberFormat#formatRange proposal...\n // https://github.com/tc39/ecma402/issues/393\n // https://github.com/tc39/proposal-intl-numberformat-v3#formatrange-ecma-402-393\n displayValue = `${state.getThumbValueLabel(0)} – ${state.getThumbValueLabel(1)}`;\n maxLabelLength = 3 + 2 * Math.max(\n maxLabelLength,\n [...formatter.format(minValue)].length, [...formatter.format(maxValue)].length\n );\n break;\n default:\n throw new Error('Only sliders with 1 or 2 handles are supported!');\n }\n }\n\n let labelNode = (\n <label\n className={classNames(styles, 'spectrum-Slider-label')}\n {...labelProps}>\n {props.label}\n </label>\n );\n\n let valueNode = (\n <output\n {...outputProps}\n className={classNames(styles, 'spectrum-Slider-value')}\n style={maxLabelLength && {width: `${maxLabelLength}ch`, minWidth: `${maxLabelLength}ch`}}>\n {displayValue}\n </output>\n );\n\n return (\n <div\n ref={domRef}\n className={classNames(styles,\n 'spectrum-Slider',\n {\n 'spectrum-Slider--positionTop': labelPosition === 'top',\n 'spectrum-Slider--positionSide': labelPosition === 'side',\n 'is-disabled': isDisabled\n },\n classes,\n styleProps.className)}\n style={{\n ...style,\n ...styleProps.style\n }}\n {...groupProps}>\n {(props.label) &&\n <div className={classNames(styles, 'spectrum-Slider-labelContainer')} role=\"presentation\">\n {props.label && labelNode}\n {props.contextualHelp &&\n <SlotProvider\n slots={{\n actionButton: {\n UNSAFE_className: classNames(styles, 'spectrum-Slider-contextualHelp')\n }\n }}>\n {props.contextualHelp}\n </SlotProvider>\n }\n {labelPosition === 'top' && showValueLabel && valueNode}\n </div>\n }\n <div className={classNames(styles, 'spectrum-Slider-controls')} ref={trackRef} {...trackProps} role=\"presentation\">\n {children({\n trackRef,\n inputRef,\n state\n })}\n </div>\n {labelPosition === 'side' &&\n <div className={classNames(styles, 'spectrum-Slider-valueLabelContainer')} role=\"presentation\">\n {showValueLabel && valueNode}\n </div>\n }\n </div>\n );\n}\n\nconst _SliderBase = React.forwardRef(SliderBase);\nexport {_SliderBase as SliderBase};\n"],"names":[],"version":3,"file":"SliderBase.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAwBD,SAAS,iCAAW,KAAsB,EAAE,GAAiC;IAC3E,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,IAAI,cACF,UAAU,YACV,QAAQ,WACR,OAAO,SACP,KAAK,iBACL,gBAAgB,sBAChB,aAAa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jB,GACA,SACA,WAAW,SAAS;QACtB,OAAO;YACL,GAAG,KAAK;YACR,GAAG,WAAW,KAAK;QACrB;QACC,GAAG,UAAU;OACb,AAAC,MAAM,KAAK,kBACX,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;QAAmC,MAAK;OACxE,MAAM,KAAK,IAAI,WACf,MAAM,cAAc,kBACnB,gCAAC,CAAA,GAAA,mBAAW;QACV,OAAO;YACL,cAAc;gBACZ,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;YACvC;QACF;OACC,MAAM,cAAc,GAGxB,kBAAkB,SAAS,kBAAkB,0BAGlD,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;QAA6B,KAAK;QAAW,GAAG,UAAU;QAAE,MAAK;OACjG,SAAS;kBACR;kBACA;eACA;IACF,KAED,kBAAkB,wBACjB,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;QAAwC,MAAK;OAC7E,kBAAkB;AAK7B;AAEA,MAAM,0DAAc,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/slider/src/SliderBase.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, SlotProvider, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport React, {CSSProperties, ReactNode,
|
|
1
|
+
{"mappings":";;;;;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AAU,CAAC,EAAE,eAAe,EAAE,CAAC;QAAA;OACtF;IAIL,qBACE,gCAAC;QACC,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GACzB,mBACA;YACE,gCAAgC,kBAAkB;YAClD,iCAAiC,kBAAkB;YACnD,eAAe;QACjB,GACA,SACA,WAAW,SAAS;QACtB,OAAO;YACL,GAAG,KAAK;YACR,GAAG,WAAW,KAAK;QACrB;QACC,GAAG,UAAU;OACb,AAAC,MAAM,KAAK,kBACX,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;QAAmC,MAAK;OACxE,MAAM,KAAK,IAAI,WACf,MAAM,cAAc,kBACnB,gCAAC,CAAA,GAAA,mBAAW;QACV,OAAO;YACL,cAAc;gBACZ,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;YACvC;QACF;OACC,MAAM,cAAc,GAGxB,kBAAkB,SAAS,kBAAkB,0BAGlD,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;QAA6B,KAAK;QAAW,GAAG,UAAU;QAAE,MAAK;OACjG,SAAS;kBACR;kBACA;eACA;IACF,KAED,kBAAkB,wBACjB,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;QAAwC,MAAK;OAC7E,kBAAkB;AAK7B;AAEA,MAAM,0DAAc,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/slider/src/SliderBase.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, SlotProvider, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {FocusableRef, RefObject} from '@react-types/shared';\nimport React, {CSSProperties, ReactNode, useRef} from 'react';\nimport {SliderState, useSliderState} from '@react-stately/slider';\nimport {SpectrumBarSliderBase} from '@react-types/slider';\nimport styles from '@adobe/spectrum-css-temp/components/slider/vars.css';\nimport {useNumberFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useSlider} from '@react-aria/slider';\n\nexport interface SliderBaseChildArguments {\n inputRef: RefObject<HTMLInputElement | null>,\n trackRef: RefObject<HTMLElement | null>,\n state: SliderState\n}\n\nexport interface SliderBaseProps<T = number[]> extends SpectrumBarSliderBase<T> {\n children: (opts: SliderBaseChildArguments) => ReactNode,\n classes?: string[] | Object,\n style?: CSSProperties\n}\n\nfunction SliderBase(props: SliderBaseProps, ref: FocusableRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let {\n isDisabled,\n children,\n classes,\n style,\n labelPosition = 'top',\n getValueLabel,\n showValueLabel = !!props.label,\n formatOptions,\n minValue = 0,\n maxValue = 100,\n ...otherProps\n } = props;\n\n let {styleProps} = useStyleProps(otherProps);\n\n // `Math.abs(Math.sign(a) - Math.sign(b)) === 2` is true if the values have a different sign.\n let alwaysDisplaySign = Math.abs(Math.sign(minValue) - Math.sign(maxValue)) === 2;\n if (alwaysDisplaySign) {\n if (formatOptions != null) {\n if (!('signDisplay' in formatOptions)) {\n formatOptions = {\n ...formatOptions,\n // @ts-ignore\n signDisplay: 'exceptZero'\n };\n }\n } else {\n // @ts-ignore\n formatOptions = {signDisplay: 'exceptZero'};\n }\n }\n\n const formatter = useNumberFormatter(formatOptions);\n const state = useSliderState({\n ...props,\n numberFormatter: formatter,\n minValue,\n maxValue\n });\n let trackRef = useRef(undefined);\n let {\n groupProps,\n trackProps,\n labelProps,\n outputProps\n } = useSlider(props, state, trackRef);\n\n let inputRef = useRef(undefined);\n let domRef = useFocusableRef(ref, inputRef);\n\n let displayValue = '';\n let maxLabelLength = undefined;\n\n if (typeof getValueLabel === 'function') {\n displayValue = getValueLabel(state.values);\n switch (state.values.length) {\n case 1:\n maxLabelLength = Math.max(\n getValueLabel([minValue]).length,\n getValueLabel([maxValue]).length\n );\n break;\n case 2:\n // Try all possible combinations of min and max values.\n maxLabelLength = Math.max(\n getValueLabel([minValue, minValue]).length,\n getValueLabel([minValue, maxValue]).length,\n getValueLabel([maxValue, minValue]).length,\n getValueLabel([maxValue, maxValue]).length\n );\n break;\n default:\n throw new Error('Only sliders with 1 or 2 handles are supported!');\n }\n } else {\n maxLabelLength = Math.max([...formatter.format(minValue)].length, [...formatter.format(maxValue)].length);\n switch (state.values.length) {\n case 1:\n displayValue = state.getThumbValueLabel(0);\n break;\n case 2:\n // This should really use the NumberFormat#formatRange proposal...\n // https://github.com/tc39/ecma402/issues/393\n // https://github.com/tc39/proposal-intl-numberformat-v3#formatrange-ecma-402-393\n displayValue = `${state.getThumbValueLabel(0)} – ${state.getThumbValueLabel(1)}`;\n maxLabelLength = 3 + 2 * Math.max(\n maxLabelLength,\n [...formatter.format(minValue)].length, [...formatter.format(maxValue)].length\n );\n break;\n default:\n throw new Error('Only sliders with 1 or 2 handles are supported!');\n }\n }\n\n let labelNode = (\n <label\n className={classNames(styles, 'spectrum-Slider-label')}\n {...labelProps}>\n {props.label}\n </label>\n );\n\n let valueNode = (\n <output\n {...outputProps}\n className={classNames(styles, 'spectrum-Slider-value')}\n style={maxLabelLength && {width: `${maxLabelLength}ch`, minWidth: `${maxLabelLength}ch`}}>\n {displayValue}\n </output>\n );\n\n return (\n <div\n ref={domRef}\n className={classNames(styles,\n 'spectrum-Slider',\n {\n 'spectrum-Slider--positionTop': labelPosition === 'top',\n 'spectrum-Slider--positionSide': labelPosition === 'side',\n 'is-disabled': isDisabled\n },\n classes,\n styleProps.className)}\n style={{\n ...style,\n ...styleProps.style\n }}\n {...groupProps}>\n {(props.label) &&\n <div className={classNames(styles, 'spectrum-Slider-labelContainer')} role=\"presentation\">\n {props.label && labelNode}\n {props.contextualHelp &&\n <SlotProvider\n slots={{\n actionButton: {\n UNSAFE_className: classNames(styles, 'spectrum-Slider-contextualHelp')\n }\n }}>\n {props.contextualHelp}\n </SlotProvider>\n }\n {labelPosition === 'top' && showValueLabel && valueNode}\n </div>\n }\n <div className={classNames(styles, 'spectrum-Slider-controls')} ref={trackRef} {...trackProps} role=\"presentation\">\n {children({\n trackRef,\n inputRef,\n state\n })}\n </div>\n {labelPosition === 'side' &&\n <div className={classNames(styles, 'spectrum-Slider-valueLabelContainer')} role=\"presentation\">\n {showValueLabel && valueNode}\n </div>\n }\n </div>\n );\n}\n\nconst _SliderBase = React.forwardRef(SliderBase);\nexport {_SliderBase as SliderBase};\n"],"names":[],"version":3,"file":"SliderBase.module.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAoBM,SAAS,0CAAY,KAAuB;IACjD,IAAI,YACF,QAAQ,SACR,KAAK,EACN,GAAG;IACJ,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAoB;IACzC,WAAW,YAAY;IAEvB,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAa,EAAE;QACnE,GAAG,KAAK;kBACR;IACF,GAAG;IAEH,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE,CAAC;IAExC,qBACE,0DAAC,CAAA,GAAA,+BAAQ;QAAE,QAAA;QAAO,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBACnD,0DAAC;QACC,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,0BACA;YACE,cAAc;YACd,cAAc;YACd,gBAAgB;QAClB;QAGH,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,WAAW;QACtC,MAAK;qBACL,0DAAC,CAAA,GAAA,6CAAa,uBACZ,0DAAC;QAAM,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAA0B,KAAK;QAAW,GAAG,UAAU;;AAKtG","sources":["packages/@react-spectrum/slider/src/SliderThumb.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaSliderThumbProps} from '@react-types/slider';\nimport {classNames} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useRef} from 'react';\nimport {RefObject} from '@react-types/shared';\nimport {SliderState} from '@react-stately/slider';\nimport styles from '@adobe/spectrum-css-temp/components/slider/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useSliderThumb} from '@react-aria/slider';\nimport {VisuallyHidden} from '@react-aria/visually-hidden';\n\ninterface SliderThumbProps extends AriaSliderThumbProps {\n trackRef: RefObject<HTMLElement | null>,\n inputRef?: RefObject<HTMLInputElement | null>,\n state: SliderState\n}\n\nexport function SliderThumb(props: SliderThumbProps) {\n let {\n inputRef,\n state\n } = props;\n let backupRef = useRef<HTMLInputElement>(undefined);\n inputRef = inputRef || backupRef;\n\n let {thumbProps, inputProps, isDragging, isFocused} = useSliderThumb({\n ...props,\n inputRef\n }, state);\n\n let {hoverProps, isHovered} = useHover({});\n\n return (\n <FocusRing within focusRingClass={classNames(styles, 'is-focused')}>\n <div\n className={\n classNames(\n styles,\n 'spectrum-Slider-handle',\n {\n 'is-hovered': isHovered,\n 'is-dragged': isDragging,\n 'is-tophandle': isFocused\n }\n )\n }\n {...mergeProps(thumbProps, hoverProps)}\n role=\"presentation\">\n <VisuallyHidden>\n <input className={classNames(styles, 'spectrum-Slider-input')} ref={inputRef} {...inputProps} />\n </VisuallyHidden>\n </div>\n </FocusRing>\n );\n}\n"],"names":[],"version":3,"file":"SliderThumb.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAoBM,SAAS,0CAAY,KAAuB;IACjD,IAAI,YACF,QAAQ,SACR,KAAK,EACN,GAAG;IACJ,IAAI,YAAY,CAAA,GAAA,aAAK,EAAoB;IACzC,WAAW,YAAY;IAEvB,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;QACnE,GAAG,KAAK;kBACR;IACF,GAAG;IAEH,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE,CAAC;IAExC,qBACE,gCAAC,CAAA,GAAA,gBAAQ;QAAE,QAAA;QAAO,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;qBACnD,gCAAC;QACC,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,wDAAK,GACL,0BACA;YACE,cAAc;YACd,cAAc;YACd,gBAAgB;QAClB;QAGH,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;QACtC,MAAK;qBACL,gCAAC,CAAA,GAAA,qBAAa,uBACZ,gCAAC;QAAM,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;QAA0B,KAAK;QAAW,GAAG,UAAU;;AAKtG","sources":["packages/@react-spectrum/slider/src/SliderThumb.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaSliderThumbProps} from '@react-types/slider';\nimport {classNames} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {useRef} from 'react';\nimport {RefObject} from '@react-types/shared';\nimport {SliderState} from '@react-stately/slider';\nimport styles from '@adobe/spectrum-css-temp/components/slider/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useSliderThumb} from '@react-aria/slider';\nimport {VisuallyHidden} from '@react-aria/visually-hidden';\n\ninterface SliderThumbProps extends AriaSliderThumbProps {\n trackRef: RefObject<HTMLElement | null>,\n inputRef?: RefObject<HTMLInputElement | null>,\n state: SliderState\n}\n\nexport function SliderThumb(props: SliderThumbProps) {\n let {\n inputRef,\n state\n } = props;\n let backupRef = useRef<HTMLInputElement>(undefined);\n inputRef = inputRef || backupRef;\n\n let {thumbProps, inputProps, isDragging, isFocused} = useSliderThumb({\n ...props,\n inputRef\n }, state);\n\n let {hoverProps, isHovered} = useHover({});\n\n return (\n <FocusRing within focusRingClass={classNames(styles, 'is-focused')}>\n <div\n className={\n classNames(\n styles,\n 'spectrum-Slider-handle',\n {\n 'is-hovered': isHovered,\n 'is-dragged': isDragging,\n 'is-tophandle': isFocused\n }\n )\n }\n {...mergeProps(thumbProps, hoverProps)}\n role=\"presentation\">\n <VisuallyHidden>\n <input className={classNames(styles, 'spectrum-Slider-input')} ref={inputRef} {...inputProps} />\n </VisuallyHidden>\n </div>\n </FocusRing>\n );\n}\n"],"names":[],"version":3,"file":"SliderThumb.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/slider",
|
|
3
|
-
"version": "3.6.10-nightly.
|
|
3
|
+
"version": "3.6.10-nightly.4704+546ffa41f",
|
|
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.9-nightly.
|
|
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.5-nightly.
|
|
47
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
48
|
-
"@react-types/slider": "3.7.4-nightly.
|
|
39
|
+
"@react-aria/focus": "3.0.0-nightly.2992+546ffa41f",
|
|
40
|
+
"@react-aria/i18n": "3.0.0-nightly.2992+546ffa41f",
|
|
41
|
+
"@react-aria/interactions": "3.0.0-nightly.2992+546ffa41f",
|
|
42
|
+
"@react-aria/slider": "3.7.9-nightly.4704+546ffa41f",
|
|
43
|
+
"@react-aria/utils": "3.0.0-nightly.2992+546ffa41f",
|
|
44
|
+
"@react-aria/visually-hidden": "3.0.0-nightly.2992+546ffa41f",
|
|
45
|
+
"@react-spectrum/utils": "3.0.0-nightly.2992+546ffa41f",
|
|
46
|
+
"@react-stately/slider": "3.5.5-nightly.4704+546ffa41f",
|
|
47
|
+
"@react-types/shared": "3.0.0-nightly.2992+546ffa41f",
|
|
48
|
+
"@react-types/slider": "3.7.4-nightly.4704+546ffa41f",
|
|
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.2992+546ffa41f"
|
|
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": "546ffa41f7d1d3a566950a14d8f46cf726891220"
|
|
62
62
|
}
|
package/src/SliderBase.tsx
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import {classNames, SlotProvider, useFocusableRef, useStyleProps} from '@react-spectrum/utils';
|
|
14
|
-
import {FocusableRef} from '@react-types/shared';
|
|
15
|
-
import React, {CSSProperties, ReactNode,
|
|
14
|
+
import {FocusableRef, RefObject} from '@react-types/shared';
|
|
15
|
+
import React, {CSSProperties, ReactNode, useRef} from 'react';
|
|
16
16
|
import {SliderState, useSliderState} from '@react-stately/slider';
|
|
17
17
|
import {SpectrumBarSliderBase} from '@react-types/slider';
|
|
18
18
|
import styles from '@adobe/spectrum-css-temp/components/slider/vars.css';
|
package/src/SliderThumb.tsx
CHANGED
|
@@ -14,7 +14,8 @@ import {AriaSliderThumbProps} from '@react-types/slider';
|
|
|
14
14
|
import {classNames} from '@react-spectrum/utils';
|
|
15
15
|
import {FocusRing} from '@react-aria/focus';
|
|
16
16
|
import {mergeProps} from '@react-aria/utils';
|
|
17
|
-
import React, {
|
|
17
|
+
import React, {useRef} from 'react';
|
|
18
|
+
import {RefObject} from '@react-types/shared';
|
|
18
19
|
import {SliderState} from '@react-stately/slider';
|
|
19
20
|
import styles from '@adobe/spectrum-css-temp/components/slider/vars.css';
|
|
20
21
|
import {useHover} from '@react-aria/interactions';
|