@react-spectrum/slider 3.8.4 → 3.9.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.
Files changed (216) hide show
  1. package/dist/import.mjs +3 -3
  2. package/dist/main.js +4 -4
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +3 -3
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +5 -0
  7. package/package.json +12 -34
  8. package/src/index.ts +6 -3
  9. package/dist/RangeSlider.main.js +0 -120
  10. package/dist/RangeSlider.main.js.map +0 -1
  11. package/dist/RangeSlider.mjs +0 -115
  12. package/dist/RangeSlider.module.js +0 -115
  13. package/dist/RangeSlider.module.js.map +0 -1
  14. package/dist/Slider.main.js +0 -121
  15. package/dist/Slider.main.js.map +0 -1
  16. package/dist/Slider.mjs +0 -116
  17. package/dist/Slider.module.js +0 -116
  18. package/dist/Slider.module.js.map +0 -1
  19. package/dist/SliderBase.main.js +0 -169
  20. package/dist/SliderBase.main.js.map +0 -1
  21. package/dist/SliderBase.mjs +0 -164
  22. package/dist/SliderBase.module.js +0 -164
  23. package/dist/SliderBase.module.js.map +0 -1
  24. package/dist/SliderThumb.main.js +0 -67
  25. package/dist/SliderThumb.main.js.map +0 -1
  26. package/dist/SliderThumb.mjs +0 -62
  27. package/dist/SliderThumb.module.js +0 -62
  28. package/dist/SliderThumb.module.js.map +0 -1
  29. package/dist/ar-AE.main.js +0 -7
  30. package/dist/ar-AE.main.js.map +0 -1
  31. package/dist/ar-AE.mjs +0 -9
  32. package/dist/ar-AE.module.js +0 -9
  33. package/dist/ar-AE.module.js.map +0 -1
  34. package/dist/bg-BG.main.js +0 -7
  35. package/dist/bg-BG.main.js.map +0 -1
  36. package/dist/bg-BG.mjs +0 -9
  37. package/dist/bg-BG.module.js +0 -9
  38. package/dist/bg-BG.module.js.map +0 -1
  39. package/dist/cs-CZ.main.js +0 -7
  40. package/dist/cs-CZ.main.js.map +0 -1
  41. package/dist/cs-CZ.mjs +0 -9
  42. package/dist/cs-CZ.module.js +0 -9
  43. package/dist/cs-CZ.module.js.map +0 -1
  44. package/dist/da-DK.main.js +0 -7
  45. package/dist/da-DK.main.js.map +0 -1
  46. package/dist/da-DK.mjs +0 -9
  47. package/dist/da-DK.module.js +0 -9
  48. package/dist/da-DK.module.js.map +0 -1
  49. package/dist/de-DE.main.js +0 -7
  50. package/dist/de-DE.main.js.map +0 -1
  51. package/dist/de-DE.mjs +0 -9
  52. package/dist/de-DE.module.js +0 -9
  53. package/dist/de-DE.module.js.map +0 -1
  54. package/dist/el-GR.main.js +0 -7
  55. package/dist/el-GR.main.js.map +0 -1
  56. package/dist/el-GR.mjs +0 -9
  57. package/dist/el-GR.module.js +0 -9
  58. package/dist/el-GR.module.js.map +0 -1
  59. package/dist/en-US.main.js +0 -7
  60. package/dist/en-US.main.js.map +0 -1
  61. package/dist/en-US.mjs +0 -9
  62. package/dist/en-US.module.js +0 -9
  63. package/dist/en-US.module.js.map +0 -1
  64. package/dist/es-ES.main.js +0 -7
  65. package/dist/es-ES.main.js.map +0 -1
  66. package/dist/es-ES.mjs +0 -9
  67. package/dist/es-ES.module.js +0 -9
  68. package/dist/es-ES.module.js.map +0 -1
  69. package/dist/et-EE.main.js +0 -7
  70. package/dist/et-EE.main.js.map +0 -1
  71. package/dist/et-EE.mjs +0 -9
  72. package/dist/et-EE.module.js +0 -9
  73. package/dist/et-EE.module.js.map +0 -1
  74. package/dist/fi-FI.main.js +0 -7
  75. package/dist/fi-FI.main.js.map +0 -1
  76. package/dist/fi-FI.mjs +0 -9
  77. package/dist/fi-FI.module.js +0 -9
  78. package/dist/fi-FI.module.js.map +0 -1
  79. package/dist/fr-FR.main.js +0 -7
  80. package/dist/fr-FR.main.js.map +0 -1
  81. package/dist/fr-FR.mjs +0 -9
  82. package/dist/fr-FR.module.js +0 -9
  83. package/dist/fr-FR.module.js.map +0 -1
  84. package/dist/he-IL.main.js +0 -7
  85. package/dist/he-IL.main.js.map +0 -1
  86. package/dist/he-IL.mjs +0 -9
  87. package/dist/he-IL.module.js +0 -9
  88. package/dist/he-IL.module.js.map +0 -1
  89. package/dist/hr-HR.main.js +0 -7
  90. package/dist/hr-HR.main.js.map +0 -1
  91. package/dist/hr-HR.mjs +0 -9
  92. package/dist/hr-HR.module.js +0 -9
  93. package/dist/hr-HR.module.js.map +0 -1
  94. package/dist/hu-HU.main.js +0 -7
  95. package/dist/hu-HU.main.js.map +0 -1
  96. package/dist/hu-HU.mjs +0 -9
  97. package/dist/hu-HU.module.js +0 -9
  98. package/dist/hu-HU.module.js.map +0 -1
  99. package/dist/intlStrings.main.js +0 -108
  100. package/dist/intlStrings.main.js.map +0 -1
  101. package/dist/intlStrings.mjs +0 -110
  102. package/dist/intlStrings.module.js +0 -110
  103. package/dist/intlStrings.module.js.map +0 -1
  104. package/dist/it-IT.main.js +0 -7
  105. package/dist/it-IT.main.js.map +0 -1
  106. package/dist/it-IT.mjs +0 -9
  107. package/dist/it-IT.module.js +0 -9
  108. package/dist/it-IT.module.js.map +0 -1
  109. package/dist/ja-JP.main.js +0 -7
  110. package/dist/ja-JP.main.js.map +0 -1
  111. package/dist/ja-JP.mjs +0 -9
  112. package/dist/ja-JP.module.js +0 -9
  113. package/dist/ja-JP.module.js.map +0 -1
  114. package/dist/ko-KR.main.js +0 -7
  115. package/dist/ko-KR.main.js.map +0 -1
  116. package/dist/ko-KR.mjs +0 -9
  117. package/dist/ko-KR.module.js +0 -9
  118. package/dist/ko-KR.module.js.map +0 -1
  119. package/dist/lt-LT.main.js +0 -7
  120. package/dist/lt-LT.main.js.map +0 -1
  121. package/dist/lt-LT.mjs +0 -9
  122. package/dist/lt-LT.module.js +0 -9
  123. package/dist/lt-LT.module.js.map +0 -1
  124. package/dist/lv-LV.main.js +0 -7
  125. package/dist/lv-LV.main.js.map +0 -1
  126. package/dist/lv-LV.mjs +0 -9
  127. package/dist/lv-LV.module.js +0 -9
  128. package/dist/lv-LV.module.js.map +0 -1
  129. package/dist/nb-NO.main.js +0 -7
  130. package/dist/nb-NO.main.js.map +0 -1
  131. package/dist/nb-NO.mjs +0 -9
  132. package/dist/nb-NO.module.js +0 -9
  133. package/dist/nb-NO.module.js.map +0 -1
  134. package/dist/nl-NL.main.js +0 -7
  135. package/dist/nl-NL.main.js.map +0 -1
  136. package/dist/nl-NL.mjs +0 -9
  137. package/dist/nl-NL.module.js +0 -9
  138. package/dist/nl-NL.module.js.map +0 -1
  139. package/dist/pl-PL.main.js +0 -7
  140. package/dist/pl-PL.main.js.map +0 -1
  141. package/dist/pl-PL.mjs +0 -9
  142. package/dist/pl-PL.module.js +0 -9
  143. package/dist/pl-PL.module.js.map +0 -1
  144. package/dist/pt-BR.main.js +0 -7
  145. package/dist/pt-BR.main.js.map +0 -1
  146. package/dist/pt-BR.mjs +0 -9
  147. package/dist/pt-BR.module.js +0 -9
  148. package/dist/pt-BR.module.js.map +0 -1
  149. package/dist/pt-PT.main.js +0 -7
  150. package/dist/pt-PT.main.js.map +0 -1
  151. package/dist/pt-PT.mjs +0 -9
  152. package/dist/pt-PT.module.js +0 -9
  153. package/dist/pt-PT.module.js.map +0 -1
  154. package/dist/ro-RO.main.js +0 -7
  155. package/dist/ro-RO.main.js.map +0 -1
  156. package/dist/ro-RO.mjs +0 -9
  157. package/dist/ro-RO.module.js +0 -9
  158. package/dist/ro-RO.module.js.map +0 -1
  159. package/dist/ru-RU.main.js +0 -7
  160. package/dist/ru-RU.main.js.map +0 -1
  161. package/dist/ru-RU.mjs +0 -9
  162. package/dist/ru-RU.module.js +0 -9
  163. package/dist/ru-RU.module.js.map +0 -1
  164. package/dist/sk-SK.main.js +0 -7
  165. package/dist/sk-SK.main.js.map +0 -1
  166. package/dist/sk-SK.mjs +0 -9
  167. package/dist/sk-SK.module.js +0 -9
  168. package/dist/sk-SK.module.js.map +0 -1
  169. package/dist/sl-SI.main.js +0 -7
  170. package/dist/sl-SI.main.js.map +0 -1
  171. package/dist/sl-SI.mjs +0 -9
  172. package/dist/sl-SI.module.js +0 -9
  173. package/dist/sl-SI.module.js.map +0 -1
  174. package/dist/slider.674e7af0.css +0 -1189
  175. package/dist/slider.674e7af0.css.map +0 -1
  176. package/dist/slider_vars_css.main.js +0 -146
  177. package/dist/slider_vars_css.main.js.map +0 -1
  178. package/dist/slider_vars_css.mjs +0 -148
  179. package/dist/slider_vars_css.module.js +0 -148
  180. package/dist/slider_vars_css.module.js.map +0 -1
  181. package/dist/sr-SP.main.js +0 -7
  182. package/dist/sr-SP.main.js.map +0 -1
  183. package/dist/sr-SP.mjs +0 -9
  184. package/dist/sr-SP.module.js +0 -9
  185. package/dist/sr-SP.module.js.map +0 -1
  186. package/dist/sv-SE.main.js +0 -7
  187. package/dist/sv-SE.main.js.map +0 -1
  188. package/dist/sv-SE.mjs +0 -9
  189. package/dist/sv-SE.module.js +0 -9
  190. package/dist/sv-SE.module.js.map +0 -1
  191. package/dist/tr-TR.main.js +0 -7
  192. package/dist/tr-TR.main.js.map +0 -1
  193. package/dist/tr-TR.mjs +0 -9
  194. package/dist/tr-TR.module.js +0 -9
  195. package/dist/tr-TR.module.js.map +0 -1
  196. package/dist/types.d.ts +0 -14
  197. package/dist/types.d.ts.map +0 -1
  198. package/dist/uk-UA.main.js +0 -7
  199. package/dist/uk-UA.main.js.map +0 -1
  200. package/dist/uk-UA.mjs +0 -9
  201. package/dist/uk-UA.module.js +0 -9
  202. package/dist/uk-UA.module.js.map +0 -1
  203. package/dist/zh-CN.main.js +0 -7
  204. package/dist/zh-CN.main.js.map +0 -1
  205. package/dist/zh-CN.mjs +0 -9
  206. package/dist/zh-CN.module.js +0 -9
  207. package/dist/zh-CN.module.js.map +0 -1
  208. package/dist/zh-TW.main.js +0 -7
  209. package/dist/zh-TW.main.js.map +0 -1
  210. package/dist/zh-TW.mjs +0 -9
  211. package/dist/zh-TW.module.js +0 -9
  212. package/dist/zh-TW.module.js.map +0 -1
  213. package/src/RangeSlider.tsx +0 -95
  214. package/src/Slider.tsx +0 -119
  215. package/src/SliderBase.tsx +0 -195
  216. package/src/SliderThumb.tsx +0 -68
@@ -1,164 +0,0 @@
1
- import "./slider.674e7af0.css";
2
- import $63Ecs$slider_vars_cssmodulejs from "./slider_vars_css.mjs";
3
- import {useStyleProps as $63Ecs$useStyleProps, useFocusableRef as $63Ecs$useFocusableRef, classNames as $63Ecs$classNames, SlotProvider as $63Ecs$SlotProvider} from "@react-spectrum/utils";
4
- import $63Ecs$react, {useRef as $63Ecs$useRef} from "react";
5
- import {useSliderState as $63Ecs$useSliderState} from "@react-stately/slider";
6
- import {useNumberFormatter as $63Ecs$useNumberFormatter} from "@react-aria/i18n";
7
- import {useProviderProps as $63Ecs$useProviderProps} from "@react-spectrum/provider";
8
- import {useSlider as $63Ecs$useSlider} from "@react-aria/slider";
9
-
10
-
11
- function $parcel$interopDefault(a) {
12
- return a && a.__esModule ? a.default : a;
13
- }
14
- /*
15
- * Copyright 2020 Adobe. All rights reserved.
16
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
17
- * you may not use this file except in compliance with the License. You may obtain a copy
18
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
19
- *
20
- * Unless required by applicable law or agreed to in writing, software distributed under
21
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
22
- * OF ANY KIND, either express or implied. See the License for the specific language
23
- * governing permissions and limitations under the License.
24
- */
25
-
26
-
27
-
28
-
29
-
30
-
31
- const $39572711324a3b8e$export$9418495bb635ebde = /*#__PURE__*/ (0, $63Ecs$react).forwardRef(function SliderBase(props, ref) {
32
- props = (0, $63Ecs$useProviderProps)(props);
33
- let { isDisabled: isDisabled, children: children, classes: classes, style: style, labelPosition: labelPosition = 'top', getValueLabel: getValueLabel, showValueLabel: showValueLabel = !!props.label, formatOptions: formatOptions, minValue: minValue = 0, maxValue: maxValue = 100, ...otherProps } = props;
34
- let { styleProps: styleProps } = (0, $63Ecs$useStyleProps)(otherProps);
35
- // `Math.abs(Math.sign(a) - Math.sign(b)) === 2` is true if the values have a different sign.
36
- let alwaysDisplaySign = Math.abs(Math.sign(minValue) - Math.sign(maxValue)) === 2;
37
- if (alwaysDisplaySign) {
38
- if (formatOptions != null) {
39
- if (!('signDisplay' in formatOptions)) formatOptions = {
40
- ...formatOptions,
41
- signDisplay: 'exceptZero'
42
- };
43
- } else formatOptions = {
44
- signDisplay: 'exceptZero'
45
- };
46
- }
47
- const formatter = (0, $63Ecs$useNumberFormatter)(formatOptions);
48
- const state = (0, $63Ecs$useSliderState)({
49
- ...props,
50
- numberFormatter: formatter,
51
- minValue: minValue,
52
- maxValue: maxValue
53
- });
54
- let trackRef = (0, $63Ecs$useRef)(null);
55
- let { groupProps: groupProps, trackProps: trackProps, labelProps: labelProps, outputProps: outputProps } = (0, $63Ecs$useSlider)(props, state, trackRef);
56
- let inputRef = (0, $63Ecs$useRef)(null);
57
- let domRef = (0, $63Ecs$useFocusableRef)(ref, inputRef);
58
- let displayValue = '';
59
- let maxLabelLength = null;
60
- if (typeof getValueLabel === 'function') {
61
- displayValue = getValueLabel(state.values);
62
- switch(state.values.length){
63
- case 1:
64
- maxLabelLength = Math.max(getValueLabel([
65
- minValue
66
- ]).length, getValueLabel([
67
- maxValue
68
- ]).length);
69
- break;
70
- case 2:
71
- // Try all possible combinations of min and max values.
72
- maxLabelLength = Math.max(getValueLabel([
73
- minValue,
74
- minValue
75
- ]).length, getValueLabel([
76
- minValue,
77
- maxValue
78
- ]).length, getValueLabel([
79
- maxValue,
80
- minValue
81
- ]).length, getValueLabel([
82
- maxValue,
83
- maxValue
84
- ]).length);
85
- break;
86
- default:
87
- throw new Error('Only sliders with 1 or 2 handles are supported!');
88
- }
89
- } else {
90
- maxLabelLength = Math.max([
91
- ...formatter.format(minValue)
92
- ].length, [
93
- ...formatter.format(maxValue)
94
- ].length);
95
- switch(state.values.length){
96
- case 1:
97
- displayValue = state.getThumbValueLabel(0);
98
- break;
99
- case 2:
100
- // This should really use the NumberFormat#formatRange proposal...
101
- // https://github.com/tc39/ecma402/issues/393
102
- // https://github.com/tc39/proposal-intl-numberformat-v3#formatrange-ecma-402-393
103
- displayValue = `${state.getThumbValueLabel(0)} \u{2013} ${state.getThumbValueLabel(1)}`;
104
- maxLabelLength = 3 + 2 * Math.max(maxLabelLength, [
105
- ...formatter.format(minValue)
106
- ].length, [
107
- ...formatter.format(maxValue)
108
- ].length);
109
- break;
110
- default:
111
- throw new Error('Only sliders with 1 or 2 handles are supported!');
112
- }
113
- }
114
- let labelNode = /*#__PURE__*/ (0, $63Ecs$react).createElement("label", {
115
- className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-label'),
116
- ...labelProps
117
- }, props.label);
118
- let valueNode = /*#__PURE__*/ (0, $63Ecs$react).createElement("output", {
119
- ...outputProps,
120
- className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-value'),
121
- style: maxLabelLength != null ? {
122
- width: `${maxLabelLength}ch`,
123
- minWidth: `${maxLabelLength}ch`
124
- } : undefined
125
- }, displayValue);
126
- return /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
127
- ref: domRef,
128
- className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider', {
129
- 'spectrum-Slider--positionTop': labelPosition === 'top',
130
- 'spectrum-Slider--positionSide': labelPosition === 'side',
131
- 'is-disabled': isDisabled
132
- }, classes, styleProps.className),
133
- style: {
134
- ...style,
135
- ...styleProps.style
136
- },
137
- ...groupProps
138
- }, props.label && /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
139
- className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-labelContainer'),
140
- role: "presentation"
141
- }, props.label && labelNode, props.contextualHelp && /*#__PURE__*/ (0, $63Ecs$react).createElement((0, $63Ecs$SlotProvider), {
142
- slots: {
143
- actionButton: {
144
- UNSAFE_className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-contextualHelp')
145
- }
146
- }
147
- }, props.contextualHelp), labelPosition === 'top' && showValueLabel && valueNode), /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
148
- className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-controls'),
149
- ref: trackRef,
150
- ...trackProps,
151
- role: "presentation"
152
- }, children({
153
- trackRef: trackRef,
154
- inputRef: inputRef,
155
- state: state
156
- })), labelPosition === 'side' && /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
157
- className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-valueLabelContainer'),
158
- role: "presentation"
159
- }, showValueLabel && valueNode));
160
- });
161
-
162
-
163
- export {$39572711324a3b8e$export$9418495bb635ebde as SliderBase};
164
- //# sourceMappingURL=SliderBase.module.js.map
@@ -1,164 +0,0 @@
1
- import "./slider.674e7af0.css";
2
- import $63Ecs$slider_vars_cssmodulejs from "./slider_vars_css.module.js";
3
- import {useStyleProps as $63Ecs$useStyleProps, useFocusableRef as $63Ecs$useFocusableRef, classNames as $63Ecs$classNames, SlotProvider as $63Ecs$SlotProvider} from "@react-spectrum/utils";
4
- import $63Ecs$react, {useRef as $63Ecs$useRef} from "react";
5
- import {useSliderState as $63Ecs$useSliderState} from "@react-stately/slider";
6
- import {useNumberFormatter as $63Ecs$useNumberFormatter} from "@react-aria/i18n";
7
- import {useProviderProps as $63Ecs$useProviderProps} from "@react-spectrum/provider";
8
- import {useSlider as $63Ecs$useSlider} from "@react-aria/slider";
9
-
10
-
11
- function $parcel$interopDefault(a) {
12
- return a && a.__esModule ? a.default : a;
13
- }
14
- /*
15
- * Copyright 2020 Adobe. All rights reserved.
16
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
17
- * you may not use this file except in compliance with the License. You may obtain a copy
18
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
19
- *
20
- * Unless required by applicable law or agreed to in writing, software distributed under
21
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
22
- * OF ANY KIND, either express or implied. See the License for the specific language
23
- * governing permissions and limitations under the License.
24
- */
25
-
26
-
27
-
28
-
29
-
30
-
31
- const $39572711324a3b8e$export$9418495bb635ebde = /*#__PURE__*/ (0, $63Ecs$react).forwardRef(function SliderBase(props, ref) {
32
- props = (0, $63Ecs$useProviderProps)(props);
33
- let { isDisabled: isDisabled, children: children, classes: classes, style: style, labelPosition: labelPosition = 'top', getValueLabel: getValueLabel, showValueLabel: showValueLabel = !!props.label, formatOptions: formatOptions, minValue: minValue = 0, maxValue: maxValue = 100, ...otherProps } = props;
34
- let { styleProps: styleProps } = (0, $63Ecs$useStyleProps)(otherProps);
35
- // `Math.abs(Math.sign(a) - Math.sign(b)) === 2` is true if the values have a different sign.
36
- let alwaysDisplaySign = Math.abs(Math.sign(minValue) - Math.sign(maxValue)) === 2;
37
- if (alwaysDisplaySign) {
38
- if (formatOptions != null) {
39
- if (!('signDisplay' in formatOptions)) formatOptions = {
40
- ...formatOptions,
41
- signDisplay: 'exceptZero'
42
- };
43
- } else formatOptions = {
44
- signDisplay: 'exceptZero'
45
- };
46
- }
47
- const formatter = (0, $63Ecs$useNumberFormatter)(formatOptions);
48
- const state = (0, $63Ecs$useSliderState)({
49
- ...props,
50
- numberFormatter: formatter,
51
- minValue: minValue,
52
- maxValue: maxValue
53
- });
54
- let trackRef = (0, $63Ecs$useRef)(null);
55
- let { groupProps: groupProps, trackProps: trackProps, labelProps: labelProps, outputProps: outputProps } = (0, $63Ecs$useSlider)(props, state, trackRef);
56
- let inputRef = (0, $63Ecs$useRef)(null);
57
- let domRef = (0, $63Ecs$useFocusableRef)(ref, inputRef);
58
- let displayValue = '';
59
- let maxLabelLength = null;
60
- if (typeof getValueLabel === 'function') {
61
- displayValue = getValueLabel(state.values);
62
- switch(state.values.length){
63
- case 1:
64
- maxLabelLength = Math.max(getValueLabel([
65
- minValue
66
- ]).length, getValueLabel([
67
- maxValue
68
- ]).length);
69
- break;
70
- case 2:
71
- // Try all possible combinations of min and max values.
72
- maxLabelLength = Math.max(getValueLabel([
73
- minValue,
74
- minValue
75
- ]).length, getValueLabel([
76
- minValue,
77
- maxValue
78
- ]).length, getValueLabel([
79
- maxValue,
80
- minValue
81
- ]).length, getValueLabel([
82
- maxValue,
83
- maxValue
84
- ]).length);
85
- break;
86
- default:
87
- throw new Error('Only sliders with 1 or 2 handles are supported!');
88
- }
89
- } else {
90
- maxLabelLength = Math.max([
91
- ...formatter.format(minValue)
92
- ].length, [
93
- ...formatter.format(maxValue)
94
- ].length);
95
- switch(state.values.length){
96
- case 1:
97
- displayValue = state.getThumbValueLabel(0);
98
- break;
99
- case 2:
100
- // This should really use the NumberFormat#formatRange proposal...
101
- // https://github.com/tc39/ecma402/issues/393
102
- // https://github.com/tc39/proposal-intl-numberformat-v3#formatrange-ecma-402-393
103
- displayValue = `${state.getThumbValueLabel(0)} \u{2013} ${state.getThumbValueLabel(1)}`;
104
- maxLabelLength = 3 + 2 * Math.max(maxLabelLength, [
105
- ...formatter.format(minValue)
106
- ].length, [
107
- ...formatter.format(maxValue)
108
- ].length);
109
- break;
110
- default:
111
- throw new Error('Only sliders with 1 or 2 handles are supported!');
112
- }
113
- }
114
- let labelNode = /*#__PURE__*/ (0, $63Ecs$react).createElement("label", {
115
- className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-label'),
116
- ...labelProps
117
- }, props.label);
118
- let valueNode = /*#__PURE__*/ (0, $63Ecs$react).createElement("output", {
119
- ...outputProps,
120
- className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-value'),
121
- style: maxLabelLength != null ? {
122
- width: `${maxLabelLength}ch`,
123
- minWidth: `${maxLabelLength}ch`
124
- } : undefined
125
- }, displayValue);
126
- return /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
127
- ref: domRef,
128
- className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider', {
129
- 'spectrum-Slider--positionTop': labelPosition === 'top',
130
- 'spectrum-Slider--positionSide': labelPosition === 'side',
131
- 'is-disabled': isDisabled
132
- }, classes, styleProps.className),
133
- style: {
134
- ...style,
135
- ...styleProps.style
136
- },
137
- ...groupProps
138
- }, props.label && /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
139
- className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-labelContainer'),
140
- role: "presentation"
141
- }, props.label && labelNode, props.contextualHelp && /*#__PURE__*/ (0, $63Ecs$react).createElement((0, $63Ecs$SlotProvider), {
142
- slots: {
143
- actionButton: {
144
- UNSAFE_className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-contextualHelp')
145
- }
146
- }
147
- }, props.contextualHelp), labelPosition === 'top' && showValueLabel && valueNode), /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
148
- className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-controls'),
149
- ref: trackRef,
150
- ...trackProps,
151
- role: "presentation"
152
- }, children({
153
- trackRef: trackRef,
154
- inputRef: inputRef,
155
- state: state
156
- })), labelPosition === 'side' && /*#__PURE__*/ (0, $63Ecs$react).createElement("div", {
157
- className: (0, $63Ecs$classNames)((0, ($parcel$interopDefault($63Ecs$slider_vars_cssmodulejs))), 'spectrum-Slider-valueLabelContainer'),
158
- role: "presentation"
159
- }, showValueLabel && valueNode));
160
- });
161
-
162
-
163
- export {$39572711324a3b8e$export$9418495bb635ebde as SliderBase};
164
- //# sourceMappingURL=SliderBase.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":"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","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\nexport const SliderBase = React.forwardRef(function 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"],"names":[],"version":3,"file":"SliderBase.module.js.map"}
@@ -1,67 +0,0 @@
1
- require("./slider.674e7af0.css");
2
- var $57893a49ef34c169$exports = require("./slider_vars_css.main.js");
3
- var $75NyJ$reactspectrumutils = require("@react-spectrum/utils");
4
- var $75NyJ$reactariafocus = require("@react-aria/focus");
5
- var $75NyJ$reactariautils = require("@react-aria/utils");
6
- var $75NyJ$react = require("react");
7
- var $75NyJ$reactariainteractions = require("@react-aria/interactions");
8
- var $75NyJ$reactariaslider = require("@react-aria/slider");
9
- var $75NyJ$reactariavisuallyhidden = require("@react-aria/visually-hidden");
10
-
11
-
12
- function $parcel$interopDefault(a) {
13
- return a && a.__esModule ? a.default : a;
14
- }
15
-
16
- function $parcel$export(e, n, v, s) {
17
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
18
- }
19
-
20
- $parcel$export(module.exports, "SliderThumb", () => $77acc7fb8bfd13d6$export$2c1b491743890dec);
21
- /*
22
- * Copyright 2020 Adobe. All rights reserved.
23
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
24
- * you may not use this file except in compliance with the License. You may obtain a copy
25
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
26
- *
27
- * Unless required by applicable law or agreed to in writing, software distributed under
28
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
29
- * OF ANY KIND, either express or implied. See the License for the specific language
30
- * governing permissions and limitations under the License.
31
- */
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
- function $77acc7fb8bfd13d6$export$2c1b491743890dec(props) {
40
- let { inputRef: inputRef, state: state } = props;
41
- let backupRef = (0, $75NyJ$react.useRef)(null);
42
- inputRef = inputRef || backupRef;
43
- let { thumbProps: thumbProps, inputProps: inputProps, isDragging: isDragging, isFocused: isFocused } = (0, $75NyJ$reactariaslider.useSliderThumb)({
44
- ...props,
45
- inputRef: inputRef
46
- }, state);
47
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $75NyJ$reactariainteractions.useHover)({});
48
- return /*#__PURE__*/ (0, ($parcel$interopDefault($75NyJ$react))).createElement((0, $75NyJ$reactariafocus.FocusRing), {
49
- within: true,
50
- focusRingClass: (0, $75NyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'is-focused')
51
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($75NyJ$react))).createElement("div", {
52
- className: (0, $75NyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-handle', {
53
- 'is-hovered': isHovered,
54
- 'is-dragged': isDragging,
55
- 'is-tophandle': isFocused
56
- }),
57
- ...(0, $75NyJ$reactariautils.mergeProps)(thumbProps, hoverProps),
58
- role: "presentation"
59
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($75NyJ$react))).createElement((0, $75NyJ$reactariavisuallyhidden.VisuallyHidden), null, /*#__PURE__*/ (0, ($parcel$interopDefault($75NyJ$react))).createElement("input", {
60
- className: (0, $75NyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($57893a49ef34c169$exports))), 'spectrum-Slider-input'),
61
- ref: inputRef,
62
- ...inputProps
63
- }))));
64
- }
65
-
66
-
67
- //# sourceMappingURL=SliderThumb.main.js.map
@@ -1 +0,0 @@
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, {ReactNode, 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): ReactNode {\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"}
@@ -1,62 +0,0 @@
1
- import "./slider.674e7af0.css";
2
- import $fQERx$slider_vars_cssmodulejs from "./slider_vars_css.mjs";
3
- import {classNames as $fQERx$classNames} from "@react-spectrum/utils";
4
- import {FocusRing as $fQERx$FocusRing} from "@react-aria/focus";
5
- import {mergeProps as $fQERx$mergeProps} from "@react-aria/utils";
6
- import $fQERx$react, {useRef as $fQERx$useRef} from "react";
7
- import {useHover as $fQERx$useHover} from "@react-aria/interactions";
8
- import {useSliderThumb as $fQERx$useSliderThumb} from "@react-aria/slider";
9
- import {VisuallyHidden as $fQERx$VisuallyHidden} from "@react-aria/visually-hidden";
10
-
11
-
12
- function $parcel$interopDefault(a) {
13
- return a && a.__esModule ? a.default : a;
14
- }
15
- /*
16
- * Copyright 2020 Adobe. All rights reserved.
17
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
18
- * you may not use this file except in compliance with the License. You may obtain a copy
19
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
20
- *
21
- * Unless required by applicable law or agreed to in writing, software distributed under
22
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
23
- * OF ANY KIND, either express or implied. See the License for the specific language
24
- * governing permissions and limitations under the License.
25
- */
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
- function $9058ca69d66a724f$export$2c1b491743890dec(props) {
34
- let { inputRef: inputRef, state: state } = props;
35
- let backupRef = (0, $fQERx$useRef)(null);
36
- inputRef = inputRef || backupRef;
37
- let { thumbProps: thumbProps, inputProps: inputProps, isDragging: isDragging, isFocused: isFocused } = (0, $fQERx$useSliderThumb)({
38
- ...props,
39
- inputRef: inputRef
40
- }, state);
41
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $fQERx$useHover)({});
42
- return /*#__PURE__*/ (0, $fQERx$react).createElement((0, $fQERx$FocusRing), {
43
- within: true,
44
- focusRingClass: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))), 'is-focused')
45
- }, /*#__PURE__*/ (0, $fQERx$react).createElement("div", {
46
- className: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))), 'spectrum-Slider-handle', {
47
- 'is-hovered': isHovered,
48
- 'is-dragged': isDragging,
49
- 'is-tophandle': isFocused
50
- }),
51
- ...(0, $fQERx$mergeProps)(thumbProps, hoverProps),
52
- role: "presentation"
53
- }, /*#__PURE__*/ (0, $fQERx$react).createElement((0, $fQERx$VisuallyHidden), null, /*#__PURE__*/ (0, $fQERx$react).createElement("input", {
54
- className: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))), 'spectrum-Slider-input'),
55
- ref: inputRef,
56
- ...inputProps
57
- }))));
58
- }
59
-
60
-
61
- export {$9058ca69d66a724f$export$2c1b491743890dec as SliderThumb};
62
- //# sourceMappingURL=SliderThumb.module.js.map
@@ -1,62 +0,0 @@
1
- import "./slider.674e7af0.css";
2
- import $fQERx$slider_vars_cssmodulejs from "./slider_vars_css.module.js";
3
- import {classNames as $fQERx$classNames} from "@react-spectrum/utils";
4
- import {FocusRing as $fQERx$FocusRing} from "@react-aria/focus";
5
- import {mergeProps as $fQERx$mergeProps} from "@react-aria/utils";
6
- import $fQERx$react, {useRef as $fQERx$useRef} from "react";
7
- import {useHover as $fQERx$useHover} from "@react-aria/interactions";
8
- import {useSliderThumb as $fQERx$useSliderThumb} from "@react-aria/slider";
9
- import {VisuallyHidden as $fQERx$VisuallyHidden} from "@react-aria/visually-hidden";
10
-
11
-
12
- function $parcel$interopDefault(a) {
13
- return a && a.__esModule ? a.default : a;
14
- }
15
- /*
16
- * Copyright 2020 Adobe. All rights reserved.
17
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
18
- * you may not use this file except in compliance with the License. You may obtain a copy
19
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
20
- *
21
- * Unless required by applicable law or agreed to in writing, software distributed under
22
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
23
- * OF ANY KIND, either express or implied. See the License for the specific language
24
- * governing permissions and limitations under the License.
25
- */
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
- function $9058ca69d66a724f$export$2c1b491743890dec(props) {
34
- let { inputRef: inputRef, state: state } = props;
35
- let backupRef = (0, $fQERx$useRef)(null);
36
- inputRef = inputRef || backupRef;
37
- let { thumbProps: thumbProps, inputProps: inputProps, isDragging: isDragging, isFocused: isFocused } = (0, $fQERx$useSliderThumb)({
38
- ...props,
39
- inputRef: inputRef
40
- }, state);
41
- let { hoverProps: hoverProps, isHovered: isHovered } = (0, $fQERx$useHover)({});
42
- return /*#__PURE__*/ (0, $fQERx$react).createElement((0, $fQERx$FocusRing), {
43
- within: true,
44
- focusRingClass: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))), 'is-focused')
45
- }, /*#__PURE__*/ (0, $fQERx$react).createElement("div", {
46
- className: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))), 'spectrum-Slider-handle', {
47
- 'is-hovered': isHovered,
48
- 'is-dragged': isDragging,
49
- 'is-tophandle': isFocused
50
- }),
51
- ...(0, $fQERx$mergeProps)(thumbProps, hoverProps),
52
- role: "presentation"
53
- }, /*#__PURE__*/ (0, $fQERx$react).createElement((0, $fQERx$VisuallyHidden), null, /*#__PURE__*/ (0, $fQERx$react).createElement("input", {
54
- className: (0, $fQERx$classNames)((0, ($parcel$interopDefault($fQERx$slider_vars_cssmodulejs))), 'spectrum-Slider-input'),
55
- ref: inputRef,
56
- ...inputProps
57
- }))));
58
- }
59
-
60
-
61
- export {$9058ca69d66a724f$export$2c1b491743890dec as SliderThumb};
62
- //# sourceMappingURL=SliderThumb.module.js.map
@@ -1 +0,0 @@
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, {ReactNode, 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): ReactNode {\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,7 +0,0 @@
1
- module.exports = {
2
- "maximum": `\u{623}\u{642}\u{635}\u{649}`,
3
- "minimum": `\u{623}\u{62F}\u{646}\u{649}`
4
- };
5
-
6
-
7
- //# sourceMappingURL=ar-AE.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,4BAAI,CAAC;IACnC,WAAW,CAAC,4BAAI,CAAC;AACnB","sources":["packages/@react-spectrum/slider/intl/ar-AE.json"],"sourcesContent":["{\n \"maximum\": \"أقصى\",\n \"minimum\": \"أدنى\"\n}\n"],"names":[],"version":3,"file":"ar-AE.main.js.map"}
package/dist/ar-AE.mjs DELETED
@@ -1,9 +0,0 @@
1
- var $e8390eb96e247aac$exports = {};
2
- $e8390eb96e247aac$exports = {
3
- "maximum": `\u{623}\u{642}\u{635}\u{649}`,
4
- "minimum": `\u{623}\u{62F}\u{646}\u{649}`
5
- };
6
-
7
-
8
- export {$e8390eb96e247aac$exports as default};
9
- //# sourceMappingURL=ar-AE.module.js.map
@@ -1,9 +0,0 @@
1
- var $e8390eb96e247aac$exports = {};
2
- $e8390eb96e247aac$exports = {
3
- "maximum": `\u{623}\u{642}\u{635}\u{649}`,
4
- "minimum": `\u{623}\u{62F}\u{646}\u{649}`
5
- };
6
-
7
-
8
- export {$e8390eb96e247aac$exports as default};
9
- //# sourceMappingURL=ar-AE.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,WAAW,CAAC,4BAAI,CAAC;IACnC,WAAW,CAAC,4BAAI,CAAC;AACnB","sources":["packages/@react-spectrum/slider/intl/ar-AE.json"],"sourcesContent":["{\n \"maximum\": \"أقصى\",\n \"minimum\": \"أدنى\"\n}\n"],"names":[],"version":3,"file":"ar-AE.module.js.map"}
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- "maximum": `\u{41C}\u{430}\u{43A}\u{441}\u{438}\u{43C}\u{443}\u{43C}`,
3
- "minimum": `\u{41C}\u{438}\u{43D}\u{438}\u{43C}\u{443}\u{43C}`
4
- };
5
-
6
-
7
- //# sourceMappingURL=bg-BG.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,wDAAQ,CAAC;IACvC,WAAW,CAAC,iDAAO,CAAC;AACtB","sources":["packages/@react-spectrum/slider/intl/bg-BG.json"],"sourcesContent":["{\n \"maximum\": \"Максимум\",\n \"minimum\": \"Минимум\"\n}\n"],"names":[],"version":3,"file":"bg-BG.main.js.map"}
package/dist/bg-BG.mjs DELETED
@@ -1,9 +0,0 @@
1
- var $50d639be1d52f61f$exports = {};
2
- $50d639be1d52f61f$exports = {
3
- "maximum": `\u{41C}\u{430}\u{43A}\u{441}\u{438}\u{43C}\u{443}\u{43C}`,
4
- "minimum": `\u{41C}\u{438}\u{43D}\u{438}\u{43C}\u{443}\u{43C}`
5
- };
6
-
7
-
8
- export {$50d639be1d52f61f$exports as default};
9
- //# sourceMappingURL=bg-BG.module.js.map
@@ -1,9 +0,0 @@
1
- var $50d639be1d52f61f$exports = {};
2
- $50d639be1d52f61f$exports = {
3
- "maximum": `\u{41C}\u{430}\u{43A}\u{441}\u{438}\u{43C}\u{443}\u{43C}`,
4
- "minimum": `\u{41C}\u{438}\u{43D}\u{438}\u{43C}\u{443}\u{43C}`
5
- };
6
-
7
-
8
- export {$50d639be1d52f61f$exports as default};
9
- //# sourceMappingURL=bg-BG.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,WAAW,CAAC,wDAAQ,CAAC;IACvC,WAAW,CAAC,iDAAO,CAAC;AACtB","sources":["packages/@react-spectrum/slider/intl/bg-BG.json"],"sourcesContent":["{\n \"maximum\": \"Максимум\",\n \"minimum\": \"Минимум\"\n}\n"],"names":[],"version":3,"file":"bg-BG.module.js.map"}
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- "maximum": `Maximum`,
3
- "minimum": `Minimum`
4
- };
5
-
6
-
7
- //# sourceMappingURL=cs-CZ.main.js.map