@react-spectrum/slider 3.6.12 → 3.7.0

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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2019 Adobe
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAaD,SAAS,kCAAY,KAA+B,EAAE,GAAiC;IACrF,IAAI,YAAC,QAAQ,eAAE,WAAW,SAAE,KAAK,gBAAE,YAAY,iBAAE,aAAa,EAAE,GAAG,YAAW,GAAG;QAQ1E,iBAAqB;IAN5B,IAAI,YAAyD;QAC3D,GAAG,UAAU;QACb,OAAO,SAAS,OAAO;YAAC,MAAM,KAAK;YAAE,MAAM,GAAG;SAAC,GAAG;QAClD,cAAc,gBAAgB,OAC1B;YAAC,aAAa,KAAK;YAAE,aAAa,GAAG;SAAC,GAEtC;YAAC,CAAA,kBAAA,MAAM,QAAQ,cAAd,6BAAA,kBAAkB;YAAG,CAAA,kBAAA,MAAM,QAAQ,cAAd,6BAAA,kBAAkB;SAAI;QAChD,UAAS,CAAC;YACR,qBAAA,+BAAA,SAAW;gBAAC,OAAO,CAAC,CAAC,EAAE;gBAAE,KAAK,CAAC,CAAC,EAAE;YAAA;QACpC;QACA,aAAY,CAAC;YACX,wBAAA,kCAAA,YAAc;gBAAC,OAAO,CAAC,CAAC,EAAE;gBAAE,KAAK,CAAC,CAAC,EAAE;YAAA;QACvC;QACA,eAAe,gBAAgB,CAAC,CAAC,OAAO,IAAI,GAAK,cAAc;uBAAC;qBAAO;YAAG,KAAK;IACjF;IAEA,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,8BAAQ;IAE1B,qBACE,0DAAC,CAAA,GAAA,oCAAS;QAAG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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} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React from 'react';\nimport {SliderBase, SliderBaseChildArguments, SliderBaseProps} from './SliderBase';\nimport {SliderThumb} from './SliderThumb';\nimport {SpectrumRangeSliderProps} from '@react-types/slider';\nimport styles from '@adobe/spectrum-css-temp/components/slider/vars.css';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\n\nfunction RangeSlider(props: SpectrumRangeSliderProps, ref: FocusableRef<HTMLDivElement>) {\n let {onChange, onChangeEnd, value, defaultValue, getValueLabel, ...otherProps} = props;\n\n let baseProps: Omit<SliderBaseProps<number[]>, 'children'> = {\n ...otherProps,\n value: value != null ? [value.start, value.end] : undefined,\n defaultValue: defaultValue != null\n ? [defaultValue.start, defaultValue.end]\n // make sure that useSliderState knows we have two handles\n : [props.minValue ?? 0, props.maxValue ?? 100],\n onChange(v) {\n onChange?.({start: v[0], end: v[1]});\n },\n onChangeEnd(v) {\n onChangeEnd?.({start: v[0], end: v[1]});\n },\n getValueLabel: getValueLabel ? ([start, end]) => getValueLabel({start, end}) : undefined\n };\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/slider');\n let {direction} = useLocale();\n\n return (\n <SliderBase {...baseProps} classes={'spectrum-Slider--range'} ref={ref}>\n {({trackRef, inputRef, state}: SliderBaseChildArguments) => {\n let cssDirection = direction === 'rtl' ? 'right' : 'left';\n return (\n <>\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{width: `${state.getThumbPercent(0) * 100}%`}} />\n <SliderThumb\n index={0}\n aria-label={stringFormatter.format('minimum')}\n isDisabled={props.isDisabled}\n trackRef={trackRef}\n inputRef={inputRef}\n state={state}\n name={props.startName} />\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n [cssDirection]: `${state.getThumbPercent(0) * 100}%`,\n width: `${Math.abs(state.getThumbPercent(0) - state.getThumbPercent(1)) * 100}%`\n }} />\n <SliderThumb\n index={1}\n aria-label={stringFormatter.format('maximum')}\n isDisabled={props.isDisabled}\n trackRef={trackRef}\n state={state}\n name={props.endName} />\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n width: `${(1 - state.getThumbPercent(1)) * 100}%`\n }} />\n </>\n );\n }}\n </SliderBase>\n );\n}\n\n/**\n * RangeSliders allow users to quickly select a subset range. They should be used when the upper and lower bounds to the range are invariable.\n */\nconst _RangeSlider = React.forwardRef(RangeSlider);\nexport {_RangeSlider as RangeSlider};\n"],"names":[],"version":3,"file":"RangeSlider.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAaD,SAAS,kCAAY,KAA+B,EAAE,GAAiC;IACrF,IAAI,YAAC,QAAQ,eAAE,WAAW,SAAE,KAAK,gBAAE,YAAY,iBAAE,aAAa,EAAE,GAAG,YAAW,GAAG;QAQ1E,iBAAqB;IAN5B,IAAI,YAAyD;QAC3D,GAAG,UAAU;QACb,OAAO,SAAS,OAAO;YAAC,MAAM,KAAK;YAAE,MAAM,GAAG;SAAC,GAAG;QAClD,cAAc,gBAAgB,OAC1B;YAAC,aAAa,KAAK;YAAE,aAAa,GAAG;SAAC,GAEtC;YAAC,CAAA,kBAAA,MAAM,QAAQ,cAAd,6BAAA,kBAAkB;YAAG,CAAA,kBAAA,MAAM,QAAQ,cAAd,6BAAA,kBAAkB;SAAI;QAChD,UAAS,CAAC;YACR,qBAAA,+BAAA,SAAW;gBAAC,OAAO,CAAC,CAA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;YACnC,YAAY,MAAM,UAAU;YAC5B,UAAU;YACV,OAAO;YACP,MAAM,MAAM,OAAO;0BACrB,0DAAC;YACC,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;YAC9B,OAAO;gBACL,OAAO,GAAG,AAAC,CAAA,IAAI,MAAM,eAAe,CAAC,EAAC,IAAK,IAAI,CAAC,CAAC;YACnD;;IAGR;AAGN;AAEA;;CAEC,GACD,MAAM,0DAAe,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/slider/src/RangeSlider.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} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React from 'react';\nimport {SliderBase, SliderBaseChildArguments, SliderBaseProps} from './SliderBase';\nimport {SliderThumb} from './SliderThumb';\nimport {SpectrumRangeSliderProps} from '@react-types/slider';\nimport styles from '@adobe/spectrum-css-temp/components/slider/vars.css';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\n\nfunction RangeSlider(props: SpectrumRangeSliderProps, ref: FocusableRef<HTMLDivElement>) {\n let {onChange, onChangeEnd, value, defaultValue, getValueLabel, ...otherProps} = props;\n\n let baseProps: Omit<SliderBaseProps<number[]>, 'children'> = {\n ...otherProps,\n value: value != null ? [value.start, value.end] : undefined,\n defaultValue: defaultValue != null\n ? [defaultValue.start, defaultValue.end]\n // make sure that useSliderState knows we have two handles\n : [props.minValue ?? 0, props.maxValue ?? 100],\n onChange(v) {\n onChange?.({start: v[0], end: v[1]});\n },\n onChangeEnd(v) {\n onChangeEnd?.({start: v[0], end: v[1]});\n },\n getValueLabel: getValueLabel ? ([start, end]) => getValueLabel({start, end}) : undefined\n };\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/slider');\n let {direction} = useLocale();\n\n return (\n <SliderBase {...baseProps} classes={'spectrum-Slider--range'} ref={ref}>\n {({trackRef, inputRef, state}: SliderBaseChildArguments) => {\n let cssDirection = direction === 'rtl' ? 'right' : 'left';\n return (\n <>\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{width: `${state.getThumbPercent(0) * 100}%`}} />\n <SliderThumb\n index={0}\n aria-label={stringFormatter.format('minimum')}\n isDisabled={props.isDisabled}\n trackRef={trackRef}\n inputRef={inputRef}\n state={state}\n name={props.startName} />\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n [cssDirection]: `${state.getThumbPercent(0) * 100}%`,\n width: `${Math.abs(state.getThumbPercent(0) - state.getThumbPercent(1)) * 100}%`\n }} />\n <SliderThumb\n index={1}\n aria-label={stringFormatter.format('maximum')}\n isDisabled={props.isDisabled}\n trackRef={trackRef}\n state={state}\n name={props.endName} />\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n width: `${(1 - state.getThumbPercent(1)) * 100}%`\n }} />\n </>\n );\n }}\n </SliderBase>\n );\n}\n\n/**\n * RangeSliders allow users to quickly select a subset range. They should be used when the upper and lower bounds to the range are invariable.\n */\nconst _RangeSlider = React.forwardRef(RangeSlider);\nexport {_RangeSlider as RangeSlider};\n"],"names":[],"version":3,"file":"RangeSlider.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAaD,SAAS,kCAAY,KAA+B,EAAE,GAAiC;IACrF,IAAI,YAAC,QAAQ,eAAE,WAAW,SAAE,KAAK,gBAAE,YAAY,iBAAE,aAA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AY,MAAM,UAAU;YAC5B,UAAU;YACV,UAAU;YACV,OAAO;YACP,MAAM,MAAM,SAAS;0BACvB,gCAAC;YACC,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;YAC9B,OAAO;gBACL,CAAC,aAAa,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC,KAAK,IAAI,CAAC,CAAC;gBACpD,OAAO,CAAC,EAAE,KAAK,GAAG,CAAC,MAAM,eAAe,CAAC,KAAK,MAAM,eAAe,CAAC,MAAM,IAAI,CAAC,CAAC;YAClF;0BACF,gCAAC,CAAA,GAAA,yCAAU;YACT,OAAO;YACP,cAAY,gBAAgB,MAAM,CAAC;YACnC,YAAY,MAAM,UAAU;YAC5B,UAAU;YACV,OAAO;YACP,MAAM,MAAM,OAAO;0BACrB,gCAAC;YACC,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG;YAC9B,OAAO;gBACL,OAAO,CAAC,EAAE,AAAC,CAAA,IAAI,MAAM,eAAe,CAAC,EAAC,IAAK,IAAI,CAAC,CAAC;YACnD;;IAGR;AAGN;AAEA;;CAEC,GACD,MAAM,0DAAe,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/slider/src/RangeSlider.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} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React from 'react';\nimport {SliderBase, SliderBaseChildArguments, SliderBaseProps} from './SliderBase';\nimport {SliderThumb} from './SliderThumb';\nimport {SpectrumRangeSliderProps} from '@react-types/slider';\nimport styles from '@adobe/spectrum-css-temp/components/slider/vars.css';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\n\nfunction RangeSlider(props: SpectrumRangeSliderProps, ref: FocusableRef<HTMLDivElement>) {\n let {onChange, onChangeEnd, value, defaultValue, getValueLabel, ...otherProps} = props;\n\n let baseProps: Omit<SliderBaseProps<number[]>, 'children'> = {\n ...otherProps,\n value: value != null ? [value.start, value.end] : undefined,\n defaultValue: defaultValue != null\n ? [defaultValue.start, defaultValue.end]\n // make sure that useSliderState knows we have two handles\n : [props.minValue ?? 0, props.maxValue ?? 100],\n onChange(v) {\n onChange?.({start: v[0], end: v[1]});\n },\n onChangeEnd(v) {\n onChangeEnd?.({start: v[0], end: v[1]});\n },\n getValueLabel: getValueLabel ? ([start, end]) => getValueLabel({start, end}) : undefined\n };\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/slider');\n let {direction} = useLocale();\n\n return (\n <SliderBase {...baseProps} classes={'spectrum-Slider--range'} ref={ref}>\n {({trackRef, inputRef, state}: SliderBaseChildArguments) => {\n let cssDirection = direction === 'rtl' ? 'right' : 'left';\n return (\n <>\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{width: `${state.getThumbPercent(0) * 100}%`}} />\n <SliderThumb\n index={0}\n aria-label={stringFormatter.format('minimum')}\n isDisabled={props.isDisabled}\n trackRef={trackRef}\n inputRef={inputRef}\n state={state}\n name={props.startName} />\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n [cssDirection]: `${state.getThumbPercent(0) * 100}%`,\n width: `${Math.abs(state.getThumbPercent(0) - state.getThumbPercent(1)) * 100}%`\n }} />\n <SliderThumb\n index={1}\n aria-label={stringFormatter.format('maximum')}\n isDisabled={props.isDisabled}\n trackRef={trackRef}\n state={state}\n name={props.endName} />\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n width: `${(1 - state.getThumbPercent(1)) * 100}%`\n }} />\n </>\n );\n }}\n </SliderBase>\n );\n}\n\n/**\n * RangeSliders allow users to quickly select a subset range. They should be used when the upper and lower bounds to the range are invariable.\n */\nconst _RangeSlider = React.forwardRef(RangeSlider);\nexport {_RangeSlider as RangeSlider};\n"],"names":[],"version":3,"file":"RangeSlider.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAaD,SAAS,kCAAY,KAA+B,EAAE,GAAiC;IACrF,IAAI,YAAC,QAAQ,eAAE,WAAW,SAAE,KAAK,gBAAE,YAAY,iBAAE,aAAa,EAAE,GAAG,YAAW,GAAG;QAQ1E,iBAAqB;IAN5B,IAAI,YAAyD;QAC3D,GAAG,UAAU;QACb,OAAO,SAAS,OAAO;YAAC,MAAM,KAAK;YAAE,MAAM,GAAG;SAAC,GAAG;QAClD,cAAc,gBAAgB,OAC1B;YAAC,aAAa,KAAK;YAAE,aAAa,GAAG;SAAC,GAEtC;YAAC,CAAA,kBAAA,MAAM,QAAQ,cAAd,6BAAA,kBAAkB;YAAG,CAAA,kBAAA,MAAM,QAAQ,cAAd,6BAAA,kBAAkB;SAAI;QAChD,UAAS,CAAC;YACR,qBAAA,+BAAA,SAAW;gBAAC,OAAO,CAAC,CAAC,EAAE;gBAAE,KAAK,CAAC,CAAC,EAAE;YAAA;QACpC;QACA,aAAY,CAAC;YACX,wBAAA,kCAAA,YAAc;gBAAC,OAAO,CAAC,CAAC,EAAE;gBAAE,KAAK,CAAC,CAAC,EAAE;YAAA;QACvC;QACA,eAAe,gBAAgB,CAAC,CAAC,OAAO,IAAI,GAAK,cAAc;uBAAC;qBAAO;YAAG,KAAK;IACjF;IAEA,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;IAE1B,qBACE,g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obe. 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} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport React from 'react';\nimport {SliderBase, SliderBaseChildArguments, SliderBaseProps} from './SliderBase';\nimport {SliderThumb} from './SliderThumb';\nimport {SpectrumRangeSliderProps} from '@react-types/slider';\nimport styles from '@adobe/spectrum-css-temp/components/slider/vars.css';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\n\nfunction RangeSlider(props: SpectrumRangeSliderProps, ref: FocusableRef<HTMLDivElement>) {\n let {onChange, onChangeEnd, value, defaultValue, getValueLabel, ...otherProps} = props;\n\n let baseProps: Omit<SliderBaseProps<number[]>, 'children'> = {\n ...otherProps,\n value: value != null ? [value.start, value.end] : undefined,\n defaultValue: defaultValue != null\n ? [defaultValue.start, defaultValue.end]\n // make sure that useSliderState knows we have two handles\n : [props.minValue ?? 0, props.maxValue ?? 100],\n onChange(v) {\n onChange?.({start: v[0], end: v[1]});\n },\n onChangeEnd(v) {\n onChangeEnd?.({start: v[0], end: v[1]});\n },\n getValueLabel: getValueLabel ? ([start, end]) => getValueLabel({start, end}) : undefined\n };\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/slider');\n let {direction} = useLocale();\n\n return (\n <SliderBase {...baseProps} classes={'spectrum-Slider--range'} ref={ref}>\n {({trackRef, inputRef, state}: SliderBaseChildArguments) => {\n let cssDirection = direction === 'rtl' ? 'right' : 'left';\n return (\n <>\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{width: `${state.getThumbPercent(0) * 100}%`}} />\n <SliderThumb\n index={0}\n aria-label={stringFormatter.format('minimum')}\n isDisabled={props.isDisabled}\n trackRef={trackRef}\n inputRef={inputRef}\n state={state}\n name={props.startName} />\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n [cssDirection]: `${state.getThumbPercent(0) * 100}%`,\n width: `${Math.abs(state.getThumbPercent(0) - state.getThumbPercent(1)) * 100}%`\n }} />\n <SliderThumb\n index={1}\n aria-label={stringFormatter.format('maximum')}\n isDisabled={props.isDisabled}\n trackRef={trackRef}\n state={state}\n name={props.endName} />\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n width: `${(1 - state.getThumbPercent(1)) * 100}%`\n }} />\n </>\n );\n }}\n </SliderBase>\n );\n}\n\n/**\n * RangeSliders allow users to quickly select a subset range. They should be used when the upper and lower bounds to the range are invariable.\n */\nconst _RangeSlider = React.forwardRef(RangeSlider);\nexport {_RangeSlider as RangeSlider};\n"],"names":[],"version":3,"file":"RangeSlider.module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAYD,SAAS,6BAAO,KAA0B,EAAE,GAAiC;IAC3E,IAAI,YAAC,QAAQ,eAAE,WAAW,SAAE,KAAK,gBAAE,YAAY,YAAE,QAAQ,cAAE,UAAU,iBAAE,aAAa,iBAAE,aAAa,EAAE,GAAG,YAAW,GAAG;IAEtH,IAAI,YAA+C;QACjD,GAAG,UAAU;QACb,iDAAiD;QACjD,OAAO,SAAS,OAAO;YAAC;SAAM,GAAG;QACjC,cAAc,gBAAgB,OAAO;YAAC;SAAa,GAAG;QACtD,UAAU,CAAC;YACT,qBAAA,+BAAA,SAAW,CAAC,CAAC,EAAE;QACjB;QACA,aAAa,CAAC;YACZ,wBAAA,kCAAA,YAAc,CAAC,CAAC,EAAE;QACpB;QACA,eAAe,gBAAgB,CAAC,CAAC,EAAE,GAAK,cAAc,KAAK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QAAQ,SAAS;YACzE;;QAGJ,IAAI,cAAc;QAClB,IAAI,YAAY,cAAc,MAAM;YAClC,IAAI,QAAQ,MAAM,eAAe,CAAC,KAAK,MAAM,eAAe,CAAC;YAC7D,IAAI,kBAAkB,QAAQ;YAC9B,IAAI,SAAS,kBAAkB,MAAM,eAAe,CAAC,cAAc,MAAM,eAAe,CAAC;YACzF,4BACE,0DAAC;gBACC,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,wBAAwB;oBAAC,+BAA+B;gBAAe;gBACrG,OAAO;oBACL,CAAC,aAAa,EAAE,CAAC,EAAE,SAAS,IAAI,CAAC,CAAC;oBAClC,OAAO,CAAC,EAAE,KAAK,GAAG,CAAC,SAAS,IAAI,CAAC,CAAC;gBACpC;;QAEN;QAEA,qBACE,sHACG,0BACD,0DAAC,CAAA,GAAA,qCAAU;YACT,OAAO;YACP,YAAY,MAAM,UAAU;YAC5B,UAAU;YACV,UAAU;YACV,OAAO;YACP,MAAM,MAAM,IAAI;YACjB,aACA;IAGP;AAGN;AAEA;;CAEC,GACD,MAAM,0DAAU,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/slider/src/Slider.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 {clamp} from '@react-aria/utils';\nimport {classNames} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport React from 'react';\nimport {SliderBase, SliderBaseChildArguments, SliderBaseProps} from './SliderBase';\nimport {SliderThumb} from './SliderThumb';\nimport {SpectrumSliderProps} from '@react-types/slider';\nimport styles from '@adobe/spectrum-css-temp/components/slider/vars.css';\nimport {useLocale} from '@react-aria/i18n';\n\nfunction Slider(props: SpectrumSliderProps, ref: FocusableRef<HTMLDivElement>) {\n let {onChange, onChangeEnd, value, defaultValue, isFilled, fillOffset, trackGradient, getValueLabel, ...otherProps} = props;\n\n let baseProps: Omit<SliderBaseProps, 'children'> = {\n ...otherProps,\n // Normalize `value: number[]` to `value: number`\n value: value != null ? [value] : undefined,\n defaultValue: defaultValue != null ? [defaultValue] : undefined,\n onChange: (v: number[]): void => {\n onChange?.(v[0]);\n },\n onChangeEnd: (v: number[]): void => {\n onChangeEnd?.(v[0]);\n },\n getValueLabel: getValueLabel ? ([v]) => getValueLabel(v) : undefined\n };\n\n let {direction} = useLocale();\n\n return (\n <SliderBase\n {...baseProps}\n ref={ref}\n classes={{\n 'spectrum-Slider--filled': isFilled && fillOffset == null\n }}\n style={\n // @ts-ignore\n {'--spectrum-slider-track-gradient': trackGradient && `linear-gradient(to ${direction === 'ltr' ? 'right' : 'left'}, ${trackGradient.join(', ')})`}\n }>\n {({trackRef, inputRef, state}: SliderBaseChildArguments) => {\n fillOffset = fillOffset != null ? clamp(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : fillOffset;\n let cssDirection = direction === 'rtl' ? 'right' : 'left';\n\n let lowerTrack = (\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n width: `${state.getThumbPercent(0) * 100}%`,\n // TODO not sure if it has advantages, but this could also be implemented as CSS calc():\n // .track::before {\n // background-size: calc((1/ (var(--width)/100)) * 100%);\n // width: calc(var(--width) * 1%)M\n // }\n // @ts-ignore\n '--spectrum-track-background-size': `${(1 / state.getThumbPercent(0)) * 100}%`,\n '--spectrum-track-background-position': direction === 'ltr' ? '0' : '100%'\n }} />\n );\n let upperTrack = (\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n width: `${(1 - state.getThumbPercent(0)) * 100}%`,\n // @ts-ignore\n '--spectrum-track-background-size': `${(1 / (1 - state.getThumbPercent(0))) * 100}%`,\n '--spectrum-track-background-position': direction === 'ltr' ? '100%' : '0'\n }} />\n );\n\n let filledTrack = null;\n if (isFilled && fillOffset != null) {\n let width = state.getThumbPercent(0) - state.getValuePercent(fillOffset);\n let isRightOfOffset = width > 0;\n let offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);\n filledTrack = (\n <div\n className={classNames(styles, 'spectrum-Slider-fill', {'spectrum-Slider-fill--right': isRightOfOffset})}\n style={{\n [cssDirection]: `${offset * 100}%`,\n width: `${Math.abs(width) * 100}%`\n }} />\n );\n }\n\n return (\n <>\n {lowerTrack}\n <SliderThumb\n index={0}\n isDisabled={props.isDisabled}\n trackRef={trackRef}\n inputRef={inputRef}\n state={state}\n name={props.name} />\n {filledTrack}\n {upperTrack}\n </>\n );\n }}\n </SliderBase>\n );\n}\n\n/**\n * 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.\n */\nconst _Slider = React.forwardRef(Slider);\nexport {_Slider as Slider};\n"],"names":[],"version":3,"file":"Slider.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAYD,SAAS,6BAAO,KAA0B,EAAE,GAAiC;IAC3E,IAAI,YAAC,QAAQ,eAAE,WAAW,SAAE,KAAK,gBAAE,YAAY,YAAE,QAAQ,cAAE,UAAU,iBAAE,aAAa,iBAAE,aAAa,EAAE,GAAG,YAAW,GAAG;IAEtH,IAAI,YAA+C;QACjD,GAAG,UAAU;QACb,iDAAiD;QACjD,OAAO,SAAS,OAAO;YAAC;SAAM,GAAG;QACjC,cAAc,gBAAgB,OAAO;YAAC;SAAa,GAAG;QACtD,UAAU,CAAC;YACT,qBAAA,+BAAA,SAAW,CAAC,CAAC,EAAE;QACjB;QACA,aAAa,CAAC;YACZ,wBAAA,kCAAA,YAAc,CAAC,CAAC,EAAE;QACpB;QACA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AAC;gBACpF,wCAAwC,cAAc,QAAQ,SAAS;YACzE;;QAGJ,IAAI,cAAyB;QAC7B,IAAI,YAAY,cAAc,MAAM;YAClC,IAAI,QAAQ,MAAM,eAAe,CAAC,KAAK,MAAM,eAAe,CAAC;YAC7D,IAAI,kBAAkB,QAAQ;YAC9B,IAAI,SAAS,kBAAkB,MAAM,eAAe,CAAC,cAAc,MAAM,eAAe,CAAC;YACzF,4BACE,0DAAC;gBACC,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,wBAAwB;oBAAC,+BAA+B;gBAAe;gBACrG,OAAO;oBACL,CAAC,aAAa,EAAE,GAAG,SAAS,IAAI,CAAC,CAAC;oBAClC,OAAO,GAAG,KAAK,GAAG,CAAC,SAAS,IAAI,CAAC,CAAC;gBACpC;;QAEN;QAEA,qBACE,sHACG,0BACD,0DAAC,CAAA,GAAA,qCAAU;YACT,OAAO;YACP,YAAY,MAAM,UAAU;YAC5B,UAAU;YACV,UAAU;YACV,OAAO;YACP,MAAM,MAAM,IAAI;YACjB,aACA;IAGP;AAGN;AAEA;;CAEC,GACD,MAAM,0DAAU,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/slider/src/Slider.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 {clamp} from '@react-aria/utils';\nimport {classNames} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport React, {ReactNode} from 'react';\nimport {SliderBase, SliderBaseChildArguments, SliderBaseProps} from './SliderBase';\nimport {SliderThumb} from './SliderThumb';\nimport {SpectrumSliderProps} from '@react-types/slider';\nimport styles from '@adobe/spectrum-css-temp/components/slider/vars.css';\nimport {useLocale} from '@react-aria/i18n';\n\nfunction Slider(props: SpectrumSliderProps, ref: FocusableRef<HTMLDivElement>) {\n let {onChange, onChangeEnd, value, defaultValue, isFilled, fillOffset, trackGradient, getValueLabel, ...otherProps} = props;\n\n let baseProps: Omit<SliderBaseProps, 'children'> = {\n ...otherProps,\n // Normalize `value: number[]` to `value: number`\n value: value != null ? [value] : undefined,\n defaultValue: defaultValue != null ? [defaultValue] : undefined,\n onChange: (v: number[]): void => {\n onChange?.(v[0]);\n },\n onChangeEnd: (v: number[]): void => {\n onChangeEnd?.(v[0]);\n },\n getValueLabel: getValueLabel ? ([v]) => getValueLabel(v) : undefined\n };\n\n let {direction} = useLocale();\n\n return (\n <SliderBase\n {...baseProps}\n ref={ref}\n classes={{\n 'spectrum-Slider--filled': isFilled && fillOffset == null\n }}\n style={\n // @ts-ignore\n {'--spectrum-slider-track-gradient': trackGradient && `linear-gradient(to ${direction === 'ltr' ? 'right' : 'left'}, ${trackGradient.join(', ')})`}\n }>\n {({trackRef, inputRef, state}: SliderBaseChildArguments) => {\n fillOffset = fillOffset != null ? clamp(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : fillOffset;\n let cssDirection = direction === 'rtl' ? 'right' : 'left';\n\n let lowerTrack = (\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n width: `${state.getThumbPercent(0) * 100}%`,\n // TODO not sure if it has advantages, but this could also be implemented as CSS calc():\n // .track::before {\n // background-size: calc((1/ (var(--width)/100)) * 100%);\n // width: calc(var(--width) * 1%)M\n // }\n // @ts-ignore\n '--spectrum-track-background-size': `${(1 / state.getThumbPercent(0)) * 100}%`,\n '--spectrum-track-background-position': direction === 'ltr' ? '0' : '100%'\n }} />\n );\n let upperTrack = (\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n width: `${(1 - state.getThumbPercent(0)) * 100}%`,\n // @ts-ignore\n '--spectrum-track-background-size': `${(1 / (1 - state.getThumbPercent(0))) * 100}%`,\n '--spectrum-track-background-position': direction === 'ltr' ? '100%' : '0'\n }} />\n );\n\n let filledTrack: ReactNode = null;\n if (isFilled && fillOffset != null) {\n let width = state.getThumbPercent(0) - state.getValuePercent(fillOffset);\n let isRightOfOffset = width > 0;\n let offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);\n filledTrack = (\n <div\n className={classNames(styles, 'spectrum-Slider-fill', {'spectrum-Slider-fill--right': isRightOfOffset})}\n style={{\n [cssDirection]: `${offset * 100}%`,\n width: `${Math.abs(width) * 100}%`\n }} />\n );\n }\n\n return (\n <>\n {lowerTrack}\n <SliderThumb\n index={0}\n isDisabled={props.isDisabled}\n trackRef={trackRef}\n inputRef={inputRef}\n state={state}\n name={props.name} />\n {filledTrack}\n {upperTrack}\n </>\n );\n }}\n </SliderBase>\n );\n}\n\n/**\n * 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.\n */\nconst _Slider = React.forwardRef(Slider);\nexport {_Slider as Slider};\n"],"names":[],"version":3,"file":"Slider.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAYD,SAAS,6BAAO,KAA0B,EAAE,GAAiC;IAC3E,IAAI,YAAC,QAAQ,eAAE,WAAW,SAAE,KAAK,gBAAE,YAAY,YAAE,QAAQ,cAAE,UAAU,iBAAE,aAAa,iBAAE,aAAa,EAAE,GAAG,YAAW,GAAG;IAEtH,IAAI,YAA+C;QACjD,GAAG,UAAU;QACb,iDAAiD;QACjD,OAAO,SAAS,OAAO;YAAC;SAAM,GAAG;QACjC,cAAc,gBAAgB,OAAO;YAAC;SAAa,GAAG;QACtD,UAAU,CAAC;YACT,qBAAA,+BAAA,SAAW,CAAC,CAAC,EAAE;QACjB;QACA,aAAa,CAAC;YACZ,wBAAA,k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,IAAK,CAAA,IAAI,MAAM,eAAe,CAAC,EAAC,IAAM,IAAI,CAAC,CAAC;gBACpF,wCAAwC,cAAc,QAAQ,SAAS;YACzE;;QAGJ,IAAI,cAAc;QAClB,IAAI,YAAY,cAAc,MAAM;YAClC,IAAI,QAAQ,MAAM,eAAe,CAAC,KAAK,MAAM,eAAe,CAAC;YAC7D,IAAI,kBAAkB,QAAQ;YAC9B,IAAI,SAAS,kBAAkB,MAAM,eAAe,CAAC,cAAc,MAAM,eAAe,CAAC;YACzF,4BACE,gCAAC;gBACC,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG,wBAAwB;oBAAC,+BAA+B;gBAAe;gBACrG,OAAO;oBACL,CAAC,aAAa,EAAE,CAAC,EAAE,SAAS,IAAI,CAAC,CAAC;oBAClC,OAAO,CAAC,EAAE,KAAK,GAAG,CAAC,SAAS,IAAI,CAAC,CAAC;gBACpC;;QAEN;QAEA,qBACE,kEACG,0BACD,gCAAC,CAAA,GAAA,yCAAU;YACT,OAAO;YACP,YAAY,MAAM,UAAU;YAC5B,UAAU;YACV,UAAU;YACV,OAAO;YACP,MAAM,MAAM,IAAI;YACjB,aACA;IAGP;AAGN;AAEA;;CAEC,GACD,MAAM,0DAAU,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/slider/src/Slider.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 {clamp} from '@react-aria/utils';\nimport {classNames} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport React from 'react';\nimport {SliderBase, SliderBaseChildArguments, SliderBaseProps} from './SliderBase';\nimport {SliderThumb} from './SliderThumb';\nimport {SpectrumSliderProps} from '@react-types/slider';\nimport styles from '@adobe/spectrum-css-temp/components/slider/vars.css';\nimport {useLocale} from '@react-aria/i18n';\n\nfunction Slider(props: SpectrumSliderProps, ref: FocusableRef<HTMLDivElement>) {\n let {onChange, onChangeEnd, value, defaultValue, isFilled, fillOffset, trackGradient, getValueLabel, ...otherProps} = props;\n\n let baseProps: Omit<SliderBaseProps, 'children'> = {\n ...otherProps,\n // Normalize `value: number[]` to `value: number`\n value: value != null ? [value] : undefined,\n defaultValue: defaultValue != null ? [defaultValue] : undefined,\n onChange: (v: number[]): void => {\n onChange?.(v[0]);\n },\n onChangeEnd: (v: number[]): void => {\n onChangeEnd?.(v[0]);\n },\n getValueLabel: getValueLabel ? ([v]) => getValueLabel(v) : undefined\n };\n\n let {direction} = useLocale();\n\n return (\n <SliderBase\n {...baseProps}\n ref={ref}\n classes={{\n 'spectrum-Slider--filled': isFilled && fillOffset == null\n }}\n style={\n // @ts-ignore\n {'--spectrum-slider-track-gradient': trackGradient && `linear-gradient(to ${direction === 'ltr' ? 'right' : 'left'}, ${trackGradient.join(', ')})`}\n }>\n {({trackRef, inputRef, state}: SliderBaseChildArguments) => {\n fillOffset = fillOffset != null ? clamp(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : fillOffset;\n let cssDirection = direction === 'rtl' ? 'right' : 'left';\n\n let lowerTrack = (\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n width: `${state.getThumbPercent(0) * 100}%`,\n // TODO not sure if it has advantages, but this could also be implemented as CSS calc():\n // .track::before {\n // background-size: calc((1/ (var(--width)/100)) * 100%);\n // width: calc(var(--width) * 1%)M\n // }\n // @ts-ignore\n '--spectrum-track-background-size': `${(1 / state.getThumbPercent(0)) * 100}%`,\n '--spectrum-track-background-position': direction === 'ltr' ? '0' : '100%'\n }} />\n );\n let upperTrack = (\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n width: `${(1 - state.getThumbPercent(0)) * 100}%`,\n // @ts-ignore\n '--spectrum-track-background-size': `${(1 / (1 - state.getThumbPercent(0))) * 100}%`,\n '--spectrum-track-background-position': direction === 'ltr' ? '100%' : '0'\n }} />\n );\n\n let filledTrack = null;\n if (isFilled && fillOffset != null) {\n let width = state.getThumbPercent(0) - state.getValuePercent(fillOffset);\n let isRightOfOffset = width > 0;\n let offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);\n filledTrack = (\n <div\n className={classNames(styles, 'spectrum-Slider-fill', {'spectrum-Slider-fill--right': isRightOfOffset})}\n style={{\n [cssDirection]: `${offset * 100}%`,\n width: `${Math.abs(width) * 100}%`\n }} />\n );\n }\n\n return (\n <>\n {lowerTrack}\n <SliderThumb\n index={0}\n isDisabled={props.isDisabled}\n trackRef={trackRef}\n inputRef={inputRef}\n state={state}\n name={props.name} />\n {filledTrack}\n {upperTrack}\n </>\n );\n }}\n </SliderBase>\n );\n}\n\n/**\n * 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.\n */\nconst _Slider = React.forwardRef(Slider);\nexport {_Slider as Slider};\n"],"names":[],"version":3,"file":"Slider.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAYD,SAAS,6BAAO,KAA0B,EAAE,GAAiC;IAC3E,IAAI,YAAC,QAAQ,eAAE,WAAW,SAAE,KAAK,gBAAE,YAAY,YAAE,QAAQ,cAAE,UAAU,iBAAE,aAAa,iBAAE,aAAa,EAAE,GAAG,YAAW,GAAG;IAEtH,IAAI,YAA+C;QACjD,GAAG,UAAU;QACb,iDAAiD;QACjD,OAAO,SAAS,OAAO;YAAC;SAAM,GAAG;QACjC,cAAc,gBAAgB,OAAO;YAAC;SAAa,GAAG;QACtD,UAAU,CAAC;YACT,qBAAA,+BAAA,SAAW,CAAC,CAAC,EA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AAoC,GAAG,AAAC,IAAK,CAAA,IAAI,MAAM,eAAe,CAAC,EAAC,IAAM,IAAI,CAAC,CAAC;gBACpF,wCAAwC,cAAc,QAAQ,SAAS;YACzE;;QAGJ,IAAI,cAAyB;QAC7B,IAAI,YAAY,cAAc,MAAM;YAClC,IAAI,QAAQ,MAAM,eAAe,CAAC,KAAK,MAAM,eAAe,CAAC;YAC7D,IAAI,kBAAkB,QAAQ;YAC9B,IAAI,SAAS,kBAAkB,MAAM,eAAe,CAAC,cAAc,MAAM,eAAe,CAAC;YACzF,4BACE,gCAAC;gBACC,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG,wBAAwB;oBAAC,+BAA+B;gBAAe;gBACrG,OAAO;oBACL,CAAC,aAAa,EAAE,GAAG,SAAS,IAAI,CAAC,CAAC;oBAClC,OAAO,GAAG,KAAK,GAAG,CAAC,SAAS,IAAI,CAAC,CAAC;gBACpC;;QAEN;QAEA,qBACE,kEACG,0BACD,gCAAC,CAAA,GAAA,yCAAU;YACT,OAAO;YACP,YAAY,MAAM,UAAU;YAC5B,UAAU;YACV,UAAU;YACV,OAAO;YACP,MAAM,MAAM,IAAI;YACjB,aACA;IAGP;AAGN;AAEA;;CAEC,GACD,MAAM,0DAAU,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/slider/src/Slider.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 {clamp} from '@react-aria/utils';\nimport {classNames} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport React, {ReactNode} from 'react';\nimport {SliderBase, SliderBaseChildArguments, SliderBaseProps} from './SliderBase';\nimport {SliderThumb} from './SliderThumb';\nimport {SpectrumSliderProps} from '@react-types/slider';\nimport styles from '@adobe/spectrum-css-temp/components/slider/vars.css';\nimport {useLocale} from '@react-aria/i18n';\n\nfunction Slider(props: SpectrumSliderProps, ref: FocusableRef<HTMLDivElement>) {\n let {onChange, onChangeEnd, value, defaultValue, isFilled, fillOffset, trackGradient, getValueLabel, ...otherProps} = props;\n\n let baseProps: Omit<SliderBaseProps, 'children'> = {\n ...otherProps,\n // Normalize `value: number[]` to `value: number`\n value: value != null ? [value] : undefined,\n defaultValue: defaultValue != null ? [defaultValue] : undefined,\n onChange: (v: number[]): void => {\n onChange?.(v[0]);\n },\n onChangeEnd: (v: number[]): void => {\n onChangeEnd?.(v[0]);\n },\n getValueLabel: getValueLabel ? ([v]) => getValueLabel(v) : undefined\n };\n\n let {direction} = useLocale();\n\n return (\n <SliderBase\n {...baseProps}\n ref={ref}\n classes={{\n 'spectrum-Slider--filled': isFilled && fillOffset == null\n }}\n style={\n // @ts-ignore\n {'--spectrum-slider-track-gradient': trackGradient && `linear-gradient(to ${direction === 'ltr' ? 'right' : 'left'}, ${trackGradient.join(', ')})`}\n }>\n {({trackRef, inputRef, state}: SliderBaseChildArguments) => {\n fillOffset = fillOffset != null ? clamp(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : fillOffset;\n let cssDirection = direction === 'rtl' ? 'right' : 'left';\n\n let lowerTrack = (\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n width: `${state.getThumbPercent(0) * 100}%`,\n // TODO not sure if it has advantages, but this could also be implemented as CSS calc():\n // .track::before {\n // background-size: calc((1/ (var(--width)/100)) * 100%);\n // width: calc(var(--width) * 1%)M\n // }\n // @ts-ignore\n '--spectrum-track-background-size': `${(1 / state.getThumbPercent(0)) * 100}%`,\n '--spectrum-track-background-position': direction === 'ltr' ? '0' : '100%'\n }} />\n );\n let upperTrack = (\n <div\n className={classNames(styles, 'spectrum-Slider-track')}\n style={{\n width: `${(1 - state.getThumbPercent(0)) * 100}%`,\n // @ts-ignore\n '--spectrum-track-background-size': `${(1 / (1 - state.getThumbPercent(0))) * 100}%`,\n '--spectrum-track-background-position': direction === 'ltr' ? '100%' : '0'\n }} />\n );\n\n let filledTrack: ReactNode = null;\n if (isFilled && fillOffset != null) {\n let width = state.getThumbPercent(0) - state.getValuePercent(fillOffset);\n let isRightOfOffset = width > 0;\n let offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);\n filledTrack = (\n <div\n className={classNames(styles, 'spectrum-Slider-fill', {'spectrum-Slider-fill--right': isRightOfOffset})}\n style={{\n [cssDirection]: `${offset * 100}%`,\n width: `${Math.abs(width) * 100}%`\n }} />\n );\n }\n\n return (\n <>\n {lowerTrack}\n <SliderThumb\n index={0}\n isDisabled={props.isDisabled}\n trackRef={trackRef}\n inputRef={inputRef}\n state={state}\n name={props.name} />\n {filledTrack}\n {upperTrack}\n </>\n );\n }}\n </SliderBase>\n );\n}\n\n/**\n * 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.\n */\nconst _Slider = React.forwardRef(Slider);\nexport {_Slider as Slider};\n"],"names":[],"version":3,"file":"Slider.module.js.map"}
@@ -44,11 +44,9 @@ function $ec6ca573d82152ff$var$SliderBase(props, ref) {
44
44
  if (formatOptions != null) {
45
45
  if (!('signDisplay' in formatOptions)) formatOptions = {
46
46
  ...formatOptions,
47
- // @ts-ignore
48
47
  signDisplay: 'exceptZero'
49
48
  };
50
- } else // @ts-ignore
51
- formatOptions = {
49
+ } else formatOptions = {
52
50
  signDisplay: 'exceptZero'
53
51
  };
54
52
  }
@@ -59,12 +57,12 @@ function $ec6ca573d82152ff$var$SliderBase(props, ref) {
59
57
  minValue: minValue,
60
58
  maxValue: maxValue
61
59
  });
62
- let trackRef = (0, $2j89m$react.useRef)(undefined);
60
+ let trackRef = (0, $2j89m$react.useRef)(null);
63
61
  let { groupProps: groupProps, trackProps: trackProps, labelProps: labelProps, outputProps: outputProps } = (0, $2j89m$reactariaslider.useSlider)(props, state, trackRef);
64
- let inputRef = (0, $2j89m$react.useRef)(undefined);
62
+ let inputRef = (0, $2j89m$react.useRef)(null);
65
63
  let domRef = (0, $2j89m$reactspectrumutils.useFocusableRef)(ref, inputRef);
66
64
  let displayValue = '';
67
- let maxLabelLength = undefined;
65
+ let maxLabelLength = null;
68
66
  if (typeof getValueLabel === 'function') {
69
67
  displayValue = getValueLabel(state.values);
70
68
  switch(state.values.length){
@@ -126,10 +124,10 @@ function $ec6ca573d82152ff$var$SliderBase(props, ref) {
126
124
  let valueNode = /*#__PURE__*/ (0, ($parcel$interopDefault($2j89m$react))).createElement("output", {
127
125
  ...outputProps,
128
126
  className: (0, $2j89m$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-value'),
129
- style: maxLabelLength && {
127
+ style: maxLabelLength != null ? {
130
128
  width: `${maxLabelLength}ch`,
131
129
  minWidth: `${maxLabelLength}ch`
132
- }
130
+ } : undefined
133
131
  }, displayValue);
134
132
  return /*#__PURE__*/ (0, ($parcel$interopDefault($2j89m$react))).createElement("div", {
135
133
  ref: domRef,
@@ -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,o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AK,GAAG;QAAmC,MAAK;OACxE,MAAM,KAAK,IAAI,WACf,MAAM,cAAc,kBACnB,0DAAC,CAAA,GAAA,sCAAW;QACV,OAAO;YACL,cAAc;gBACZ,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;YACvC;QACF;OACC,MAAM,cAAc,GAGxB,kBAAkB,SAAS,kBAAkB,0BAGlD,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAA6B,KAAK;QAAW,GAAG,UAAU;QAAE,MAAK;OACjG,SAAS;kBACR;kBACA;eACA;IACF,KAED,kBAAkB,wBACjB,0DAAC;QAAI,WAAW,CAAA,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
+ {"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;YACf;QACF,OAEA,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,EAAyB;IAC7C,IAAI,cACF,UAAU,cACV,UAAU,cACV,UAAU,eACV,WAAW,EACZ,GAAG,CAAA,GAAA,gCAAQ,EAAE,OAAO,OAAO;IAE5B,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,SAAS,CAAA,GAAA,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. 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 signDisplay: 'exceptZero'\n };\n }\n } else {\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<HTMLDivElement | null>(null);\n let {\n groupProps,\n trackProps,\n labelProps,\n outputProps\n } = useSlider(props, state, trackRef);\n\n let inputRef = useRef<HTMLInputElement | null>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let displayValue = '';\n let maxLabelLength: number | null = null;\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 != null ? {width: `${maxLabelLength}ch`, minWidth: `${maxLabelLength}ch`} : undefined}>\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"}
@@ -38,11 +38,9 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
38
38
  if (formatOptions != null) {
39
39
  if (!('signDisplay' in formatOptions)) formatOptions = {
40
40
  ...formatOptions,
41
- // @ts-ignore
42
41
  signDisplay: 'exceptZero'
43
42
  };
44
- } else // @ts-ignore
45
- formatOptions = {
43
+ } else formatOptions = {
46
44
  signDisplay: 'exceptZero'
47
45
  };
48
46
  }
@@ -53,12 +51,12 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
53
51
  minValue: minValue,
54
52
  maxValue: maxValue
55
53
  });
56
- let trackRef = (0, $63Ecs$useRef)(undefined);
54
+ let trackRef = (0, $63Ecs$useRef)(null);
57
55
  let { groupProps: groupProps, trackProps: trackProps, labelProps: labelProps, outputProps: outputProps } = (0, $63Ecs$useSlider)(props, state, trackRef);
58
- let inputRef = (0, $63Ecs$useRef)(undefined);
56
+ let inputRef = (0, $63Ecs$useRef)(null);
59
57
  let domRef = (0, $63Ecs$useFocusableRef)(ref, inputRef);
60
58
  let displayValue = '';
61
- let maxLabelLength = undefined;
59
+ let maxLabelLength = null;
62
60
  if (typeof getValueLabel === 'function') {
63
61
  displayValue = getValueLabel(state.values);
64
62
  switch(state.values.length){
@@ -120,10 +118,10 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
120
118
  let valueNode = /*#__PURE__*/ (0, $63Ecs$react).createElement("output", {
121
119
  ...outputProps,
122
120
  className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-value'),
123
- style: maxLabelLength && {
121
+ style: maxLabelLength != null ? {
124
122
  width: `${maxLabelLength}ch`,
125
123
  minWidth: `${maxLabelLength}ch`
126
- }
124
+ } : undefined
127
125
  }, displayValue);
128
126
  return /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
129
127
  ref: domRef,
@@ -38,11 +38,9 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
38
38
  if (formatOptions != null) {
39
39
  if (!('signDisplay' in formatOptions)) formatOptions = {
40
40
  ...formatOptions,
41
- // @ts-ignore
42
41
  signDisplay: 'exceptZero'
43
42
  };
44
- } else // @ts-ignore
45
- formatOptions = {
43
+ } else formatOptions = {
46
44
  signDisplay: 'exceptZero'
47
45
  };
48
46
  }
@@ -53,12 +51,12 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
53
51
  minValue: minValue,
54
52
  maxValue: maxValue
55
53
  });
56
- let trackRef = (0, $63Ecs$useRef)(undefined);
54
+ let trackRef = (0, $63Ecs$useRef)(null);
57
55
  let { groupProps: groupProps, trackProps: trackProps, labelProps: labelProps, outputProps: outputProps } = (0, $63Ecs$useSlider)(props, state, trackRef);
58
- let inputRef = (0, $63Ecs$useRef)(undefined);
56
+ let inputRef = (0, $63Ecs$useRef)(null);
59
57
  let domRef = (0, $63Ecs$useFocusableRef)(ref, inputRef);
60
58
  let displayValue = '';
61
- let maxLabelLength = undefined;
59
+ let maxLabelLength = null;
62
60
  if (typeof getValueLabel === 'function') {
63
61
  displayValue = getValueLabel(state.values);
64
62
  switch(state.values.length){
@@ -120,10 +118,10 @@ function $39572711324a3b8e$var$SliderBase(props, ref) {
120
118
  let valueNode = /*#__PURE__*/ (0, $63Ecs$react).createElement("output", {
121
119
  ...outputProps,
122
120
  className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-value'),
123
- style: maxLabelLength && {
121
+ style: maxLabelLength != null ? {
124
122
  width: `${maxLabelLength}ch`,
125
123
  minWidth: `${maxLabelLength}ch`
126
- }
124
+ } : undefined
127
125
  }, displayValue);
128
126
  return /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
129
127
  ref: domRef,
@@ -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,kBACb,iBAAiB,CAAC,CAAC,MAAM,KAAK,iBAC9B,aAAa,YACb,WAAW,aACX,WAAW,KACX,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,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,GAA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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.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AAG,eAAe,EAAE,CAAC;QAAA,IAAI;OACjG;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 signDisplay: 'exceptZero'\n };\n }\n } else {\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<HTMLDivElement | null>(null);\n let {\n groupProps,\n trackProps,\n labelProps,\n outputProps\n } = useSlider(props, state, trackRef);\n\n let inputRef = useRef<HTMLInputElement | null>(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let displayValue = '';\n let maxLabelLength: number | null = null;\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 != null ? {width: `${maxLabelLength}ch`, minWidth: `${maxLabelLength}ch`} : undefined}>\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"}
@@ -38,7 +38,7 @@ $parcel$export(module.exports, "SliderThumb", () => $77acc7fb8bfd13d6$export$2c1
38
38
 
39
39
  function $77acc7fb8bfd13d6$export$2c1b491743890dec(props) {
40
40
  let { inputRef: inputRef, state: state } = props;
41
- let backupRef = (0, $75NyJ$react.useRef)(undefined);
41
+ let backupRef = (0, $75NyJ$react.useRef)(null);
42
42
  inputRef = inputRef || backupRef;
43
43
  let { thumbProps: thumbProps, inputProps: inputProps, isDragging: isDragging, isFocused: isFocused } = (0, $75NyJ$reactariaslider.useSliderThumb)({
44
44
  ...props,
@@ -1 +1 @@
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
+ {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAoBM,SAAS,0CAAY,KAAuB;IACjD,IAAI,YACF,QAAQ,SACR,KAAK,EACN,GAAG;IACJ,IAAI,YAAY,CAAA,GAAA,mBAAK,EAA2B;IAChD,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 | null>(null);\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"}
@@ -32,7 +32,7 @@ function $parcel$interopDefault(a) {
32
32
 
33
33
  function $9058ca69d66a724f$export$2c1b491743890dec(props) {
34
34
  let { inputRef: inputRef, state: state } = props;
35
- let backupRef = (0, $fQERx$useRef)(undefined);
35
+ let backupRef = (0, $fQERx$useRef)(null);
36
36
  inputRef = inputRef || backupRef;
37
37
  let { thumbProps: thumbProps, inputProps: inputProps, isDragging: isDragging, isFocused: isFocused } = (0, $fQERx$useSliderThumb)({
38
38
  ...props,
@@ -32,7 +32,7 @@ function $parcel$interopDefault(a) {
32
32
 
33
33
  function $9058ca69d66a724f$export$2c1b491743890dec(props) {
34
34
  let { inputRef: inputRef, state: state } = props;
35
- let backupRef = (0, $fQERx$useRef)(undefined);
35
+ let backupRef = (0, $fQERx$useRef)(null);
36
36
  inputRef = inputRef || backupRef;
37
37
  let { thumbProps: thumbProps, inputProps: inputProps, isDragging: isDragging, isFocused: isFocused } = (0, $fQERx$useSliderThumb)({
38
38
  ...props,
@@ -1 +1 @@
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"}
1
+ {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAoBM,SAAS,0CAAY,KAAuB;IACjD,IAAI,YACF,QAAQ,SACR,KAAK,EACN,GAAG;IACJ,IAAI,YAAY,CAAA,GAAA,aAAK,EAA2B;IAChD,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 | null>(null);\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"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AA7CA,0CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAiC,CAAC,mBAAmB,CAAC;AACtD,4CAA0B,CAAC,YAAY,CAAC;AACxC,4CAAoC,CAAC,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C;AACxE,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAAwD,CAAC,0CAA0C,CAAC;AACpG,4CAAiC,CAAC,mBAAmB,CAAC;AACtD,4CAA0B,CAAC,YAAY,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/slider/vars.css"],"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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"slider_vars_css.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AA7CA,0CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAg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,CAAC;AACxE,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAAwD,CAAC,0CAA0C,CAAC;AACpG,4CAAiC,CAAC,mBAAmB,CAAC;AACtD,4CAA0B,CAAC,YAAY,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/slider/vars.css"],"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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"slider_vars_css.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAC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0C,CAAC,4BAA4B,CAAC;AACxE,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAAwD,CAAC,0CAA0C,CAAC;AACpG,4CAAiC,CAAC,mBAAmB,CAAC;AACtD,4CAA0B,CAAC,YAAY,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/slider/vars.css"],"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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"slider_vars_css.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAC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CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,2CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,2CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAA2C,CAAC,6BAA6B,CAAC;AAC1E,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAA0C,CAAC,4BAA4B,CAAC;AACxE,4CAAwD,CAAC,0CAA0C,CAAC;AACpG,4CAAiC,CAAC,mBAAmB,CAAC;AACtD,4CAA0B,CAAC,YAAY,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/slider/vars.css"],"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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"slider_vars_css.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/slider",
3
- "version": "3.6.12",
3
+ "version": "3.7.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,16 +36,16 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/focus": "^3.18.3",
40
- "@react-aria/i18n": "^3.12.3",
41
- "@react-aria/interactions": "^3.22.3",
42
- "@react-aria/slider": "^3.7.12",
43
- "@react-aria/utils": "^3.25.3",
44
- "@react-aria/visually-hidden": "^3.8.16",
45
- "@react-spectrum/utils": "^3.11.11",
46
- "@react-stately/slider": "^3.5.8",
47
- "@react-types/shared": "^3.25.0",
48
- "@react-types/slider": "^3.7.6",
39
+ "@react-aria/focus": "^3.19.0",
40
+ "@react-aria/i18n": "^3.12.4",
41
+ "@react-aria/interactions": "^3.22.5",
42
+ "@react-aria/slider": "^3.7.14",
43
+ "@react-aria/utils": "^3.26.0",
44
+ "@react-aria/visually-hidden": "^3.8.18",
45
+ "@react-spectrum/utils": "^3.12.0",
46
+ "@react-stately/slider": "^3.6.0",
47
+ "@react-types/shared": "^3.26.0",
48
+ "@react-types/slider": "^3.7.7",
49
49
  "@swc/helpers": "^0.5.0"
50
50
  },
51
51
  "devDependencies": {
@@ -53,9 +53,10 @@
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@react-spectrum/provider": "^3.0.0",
56
- "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
56
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"
60
- }
61
- }
60
+ },
61
+ "gitHead": "71f0ef23053f9e03ee7e97df736e8b083e006849"
62
+ }
package/src/Slider.tsx CHANGED
@@ -13,7 +13,7 @@
13
13
  import {clamp} from '@react-aria/utils';
14
14
  import {classNames} from '@react-spectrum/utils';
15
15
  import {FocusableRef} from '@react-types/shared';
16
- import React from 'react';
16
+ import React, {ReactNode} from 'react';
17
17
  import {SliderBase, SliderBaseChildArguments, SliderBaseProps} from './SliderBase';
18
18
  import {SliderThumb} from './SliderThumb';
19
19
  import {SpectrumSliderProps} from '@react-types/slider';
@@ -80,7 +80,7 @@ function Slider(props: SpectrumSliderProps, ref: FocusableRef<HTMLDivElement>) {
80
80
  }} />
81
81
  );
82
82
 
83
- let filledTrack = null;
83
+ let filledTrack: ReactNode = null;
84
84
  if (isFilled && fillOffset != null) {
85
85
  let width = state.getThumbPercent(0) - state.getValuePercent(fillOffset);
86
86
  let isRightOfOffset = width > 0;
@@ -57,12 +57,10 @@ function SliderBase(props: SliderBaseProps, ref: FocusableRef<HTMLDivElement>) {
57
57
  if (!('signDisplay' in formatOptions)) {
58
58
  formatOptions = {
59
59
  ...formatOptions,
60
- // @ts-ignore
61
60
  signDisplay: 'exceptZero'
62
61
  };
63
62
  }
64
63
  } else {
65
- // @ts-ignore
66
64
  formatOptions = {signDisplay: 'exceptZero'};
67
65
  }
68
66
  }
@@ -74,7 +72,7 @@ function SliderBase(props: SliderBaseProps, ref: FocusableRef<HTMLDivElement>) {
74
72
  minValue,
75
73
  maxValue
76
74
  });
77
- let trackRef = useRef(undefined);
75
+ let trackRef = useRef<HTMLDivElement | null>(null);
78
76
  let {
79
77
  groupProps,
80
78
  trackProps,
@@ -82,11 +80,11 @@ function SliderBase(props: SliderBaseProps, ref: FocusableRef<HTMLDivElement>) {
82
80
  outputProps
83
81
  } = useSlider(props, state, trackRef);
84
82
 
85
- let inputRef = useRef(undefined);
83
+ let inputRef = useRef<HTMLInputElement | null>(null);
86
84
  let domRef = useFocusableRef(ref, inputRef);
87
85
 
88
86
  let displayValue = '';
89
- let maxLabelLength = undefined;
87
+ let maxLabelLength: number | null = null;
90
88
 
91
89
  if (typeof getValueLabel === 'function') {
92
90
  displayValue = getValueLabel(state.values);
@@ -142,7 +140,7 @@ function SliderBase(props: SliderBaseProps, ref: FocusableRef<HTMLDivElement>) {
142
140
  <output
143
141
  {...outputProps}
144
142
  className={classNames(styles, 'spectrum-Slider-value')}
145
- style={maxLabelLength && {width: `${maxLabelLength}ch`, minWidth: `${maxLabelLength}ch`}}>
143
+ style={maxLabelLength != null ? {width: `${maxLabelLength}ch`, minWidth: `${maxLabelLength}ch`} : undefined}>
146
144
  {displayValue}
147
145
  </output>
148
146
  );
@@ -33,7 +33,7 @@ export function SliderThumb(props: SliderThumbProps) {
33
33
  inputRef,
34
34
  state
35
35
  } = props;
36
- let backupRef = useRef<HTMLInputElement>(undefined);
36
+ let backupRef = useRef<HTMLInputElement | null>(null);
37
37
  inputRef = inputRef || backupRef;
38
38
 
39
39
  let {thumbProps, inputProps, isDragging, isFocused} = useSliderThumb({