@react-spectrum/color 3.0.0-nightly.3038 → 3.0.0-nightly.3062
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.css +1 -2
- package/dist/main.js +393 -398
- package/dist/main.js.map +1 -1
- package/dist/module.js +375 -338
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +20 -20
- package/dist/main.css.map +0 -1
package/dist/main.js
CHANGED
@@ -1,418 +1,413 @@
|
|
1
|
-
var {
|
2
|
-
TextFieldBase
|
3
|
-
} = require("@react-spectrum/textfield");
|
4
|
-
|
5
|
-
var {
|
6
|
-
useLocale
|
7
|
-
} = require("@react-aria/i18n");
|
8
|
-
|
9
|
-
var {
|
10
|
-
useFocus,
|
11
|
-
useFocusVisible
|
12
|
-
} = require("@react-aria/interactions");
|
13
|
-
|
14
|
-
var {
|
15
|
-
Label
|
16
|
-
} = require("@react-spectrum/label");
|
17
|
-
|
18
|
-
var {
|
19
|
-
Flex
|
20
|
-
} = require("@react-spectrum/layout");
|
21
|
-
|
22
|
-
var {
|
23
|
-
useProviderProps
|
24
|
-
} = require("@react-spectrum/provider");
|
25
|
-
|
26
|
-
var {
|
27
|
-
useFocusRing
|
28
|
-
} = require("@react-aria/focus");
|
29
|
-
|
30
|
-
var {
|
31
|
-
useColorWheelState,
|
32
|
-
useColorSliderState,
|
33
|
-
useColorFieldState
|
34
|
-
} = require("@react-stately/color");
|
35
|
-
|
36
|
-
var {
|
37
|
-
useColorWheel,
|
38
|
-
useColorSlider,
|
39
|
-
useColorField
|
40
|
-
} = require("@react-aria/color");
|
41
|
-
|
42
|
-
var {
|
43
|
-
useId,
|
44
|
-
useResizeObserver
|
45
|
-
} = require("@react-aria/utils");
|
46
|
-
|
47
|
-
var _react2 = require("react");
|
48
|
-
|
49
|
-
var _react = $parcel$interopDefault(_react2);
|
50
|
-
|
51
|
-
var {
|
52
|
-
useCallback,
|
53
|
-
useEffect,
|
54
|
-
useRef,
|
55
|
-
useState
|
56
|
-
} = _react2;
|
57
|
-
|
58
|
-
var _babelRuntimeHelpersObjectWithoutPropertiesLoose = $parcel$interopDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
59
|
-
|
60
|
-
var {
|
61
|
-
classNames,
|
62
|
-
dimensionValue,
|
63
|
-
useFocusableRef,
|
64
|
-
useStyleProps
|
65
|
-
} = require("@react-spectrum/utils");
|
66
|
-
|
67
|
-
var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
|
68
|
-
|
69
1
|
require("./main.css");
|
2
|
+
var $91ZxQ$reactspectrumutils = require("@react-spectrum/utils");
|
3
|
+
var $91ZxQ$react = require("react");
|
4
|
+
var $91ZxQ$reactariacolor = require("@react-aria/color");
|
5
|
+
var $91ZxQ$reactstatelycolor = require("@react-stately/color");
|
6
|
+
var $91ZxQ$reactariafocus = require("@react-aria/focus");
|
7
|
+
var $91ZxQ$reactspectrumprovider = require("@react-spectrum/provider");
|
8
|
+
var $91ZxQ$reactariautils = require("@react-aria/utils");
|
9
|
+
var $91ZxQ$reactspectrumlayout = require("@react-spectrum/layout");
|
10
|
+
var $91ZxQ$reactspectrumlabel = require("@react-spectrum/label");
|
11
|
+
var $91ZxQ$reactariainteractions = require("@react-aria/interactions");
|
12
|
+
var $91ZxQ$reactariai18n = require("@react-aria/i18n");
|
13
|
+
var $91ZxQ$reactspectrumtextfield = require("@react-spectrum/textfield");
|
14
|
+
|
15
|
+
function $parcel$exportWildcard(dest, source) {
|
16
|
+
Object.keys(source).forEach(function(key) {
|
17
|
+
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
18
|
+
return;
|
19
|
+
}
|
20
|
+
|
21
|
+
Object.defineProperty(dest, key, {
|
22
|
+
enumerable: true,
|
23
|
+
get: function get() {
|
24
|
+
return source[key];
|
25
|
+
}
|
26
|
+
});
|
27
|
+
});
|
70
28
|
|
29
|
+
return dest;
|
30
|
+
}
|
71
31
|
function $parcel$interopDefault(a) {
|
72
32
|
return a && a.__esModule ? a.default : a;
|
73
33
|
}
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
$
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
};
|
84
|
-
|
85
|
-
|
86
|
-
$
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
var $
|
94
|
-
var $
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
34
|
+
function $parcel$export(e, n, v, s) {
|
35
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
36
|
+
}
|
37
|
+
var $38dc4cfa8cb7ace6$exports = {};
|
38
|
+
|
39
|
+
$parcel$export($38dc4cfa8cb7ace6$exports, "ColorWheel", () => $38dc4cfa8cb7ace6$export$f80663f808113381);
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
var $642956d8c541470c$exports = {};
|
44
|
+
|
45
|
+
$parcel$export($642956d8c541470c$exports, "spectrum-ColorHandle", () => $642956d8c541470c$export$cd9afaa621b6216f, (v) => $642956d8c541470c$export$cd9afaa621b6216f = v);
|
46
|
+
$parcel$export($642956d8c541470c$exports, "is-focused", () => $642956d8c541470c$export$e7dc768d35940237, (v) => $642956d8c541470c$export$e7dc768d35940237 = v);
|
47
|
+
$parcel$export($642956d8c541470c$exports, "focus-ring", () => $642956d8c541470c$export$f39a09f249340e2a, (v) => $642956d8c541470c$export$f39a09f249340e2a = v);
|
48
|
+
$parcel$export($642956d8c541470c$exports, "is-disabled", () => $642956d8c541470c$export$d35bc1e505d1ebbf, (v) => $642956d8c541470c$export$d35bc1e505d1ebbf = v);
|
49
|
+
$parcel$export($642956d8c541470c$exports, "spectrum-ColorHandle-color", () => $642956d8c541470c$export$afe4c366ed4e659c, (v) => $642956d8c541470c$export$afe4c366ed4e659c = v);
|
50
|
+
var $642956d8c541470c$export$cd9afaa621b6216f;
|
51
|
+
var $642956d8c541470c$export$e7dc768d35940237;
|
52
|
+
var $642956d8c541470c$export$f39a09f249340e2a;
|
53
|
+
var $642956d8c541470c$export$d35bc1e505d1ebbf;
|
54
|
+
var $642956d8c541470c$export$afe4c366ed4e659c;
|
55
|
+
$642956d8c541470c$export$cd9afaa621b6216f = "_spectrum-ColorHandle_5a9f41";
|
56
|
+
$642956d8c541470c$export$e7dc768d35940237 = "_is-focused_5a9f41";
|
57
|
+
$642956d8c541470c$export$f39a09f249340e2a = "_focus-ring_5a9f41";
|
58
|
+
$642956d8c541470c$export$d35bc1e505d1ebbf = "_is-disabled_5a9f41";
|
59
|
+
$642956d8c541470c$export$afe4c366ed4e659c = "_spectrum-ColorHandle-color_5a9f41";
|
60
|
+
|
61
|
+
|
62
|
+
var $0459f00910e52686$exports = {};
|
63
|
+
|
64
|
+
$parcel$export($0459f00910e52686$exports, "spectrum-ColorLoupe", () => $0459f00910e52686$export$88d6ed2576b21809, (v) => $0459f00910e52686$export$88d6ed2576b21809 = v);
|
65
|
+
$parcel$export($0459f00910e52686$exports, "is-open", () => $0459f00910e52686$export$a9781837241c946d, (v) => $0459f00910e52686$export$a9781837241c946d = v);
|
66
|
+
$parcel$export($0459f00910e52686$exports, "spectrum-ColorLoupe-outer", () => $0459f00910e52686$export$d6ad38291e8aca9c, (v) => $0459f00910e52686$export$d6ad38291e8aca9c = v);
|
67
|
+
$parcel$export($0459f00910e52686$exports, "spectrum-ColorLoupe-inner-background", () => $0459f00910e52686$export$397af82b48750fe5, (v) => $0459f00910e52686$export$397af82b48750fe5 = v);
|
68
|
+
$parcel$export($0459f00910e52686$exports, "spectrum-ColorLoupe-inner-checker", () => $0459f00910e52686$export$f9a2a02e0b271024, (v) => $0459f00910e52686$export$f9a2a02e0b271024 = v);
|
69
|
+
var $0459f00910e52686$export$88d6ed2576b21809;
|
70
|
+
var $0459f00910e52686$export$a9781837241c946d;
|
71
|
+
var $0459f00910e52686$export$d6ad38291e8aca9c;
|
72
|
+
var $0459f00910e52686$export$397af82b48750fe5;
|
73
|
+
var $0459f00910e52686$export$f9a2a02e0b271024;
|
74
|
+
$0459f00910e52686$export$88d6ed2576b21809 = "_spectrum-ColorLoupe_c818a8";
|
75
|
+
$0459f00910e52686$export$a9781837241c946d = "_is-open_c818a8";
|
76
|
+
$0459f00910e52686$export$d6ad38291e8aca9c = "_spectrum-ColorLoupe-outer_c818a8";
|
77
|
+
$0459f00910e52686$export$397af82b48750fe5 = "_spectrum-ColorLoupe-inner-background_c818a8";
|
78
|
+
$0459f00910e52686$export$f9a2a02e0b271024 = "_spectrum-ColorLoupe-inner-checker_c818a8";
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
function $1c0d7ecef90694e9$export$a3cc47cee1c1ccc(props) {
|
83
|
+
let { value: value , isDisabled: isDisabled , isDragging: isDragging , isFocused: isFocused , children: children , className: className = '' , ...otherProps } = props;
|
84
|
+
let patternId = $91ZxQ$reactariautils.useId();
|
85
|
+
let valueCSS = value.toString('css');
|
86
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("div", {
|
87
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($642956d8c541470c$exports)), 'spectrum-ColorHandle', {
|
88
|
+
'is-focused': isFocused,
|
89
|
+
'is-disabled': isDisabled
|
90
|
+
}) + ' ' + className,
|
91
|
+
...otherProps
|
92
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("div", {
|
93
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($642956d8c541470c$exports)), 'spectrum-ColorHandle-color'),
|
94
|
+
style: {
|
95
|
+
backgroundColor: valueCSS
|
96
|
+
}
|
97
|
+
}), /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("svg", {
|
98
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($0459f00910e52686$exports)), 'spectrum-ColorLoupe', {
|
99
|
+
'is-open': isDragging
|
100
|
+
}),
|
101
|
+
"aria-hidden": "true"
|
102
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("pattern", {
|
103
|
+
id: patternId,
|
104
|
+
x: "0",
|
105
|
+
y: "0",
|
106
|
+
width: "16",
|
107
|
+
height: "16",
|
108
|
+
patternUnits: "userSpaceOnUse"
|
109
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("rect", {
|
110
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($0459f00910e52686$exports)), 'spectrum-ColorLoupe-inner-background'),
|
111
|
+
x: "0",
|
112
|
+
y: "0",
|
113
|
+
width: "16",
|
114
|
+
height: "16"
|
115
|
+
}), /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("rect", {
|
116
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($0459f00910e52686$exports)), 'spectrum-ColorLoupe-inner-checker'),
|
117
|
+
x: "0",
|
118
|
+
y: "0",
|
119
|
+
width: "8",
|
120
|
+
height: "8"
|
121
|
+
}), /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("rect", {
|
122
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($0459f00910e52686$exports)), 'spectrum-ColorLoupe-inner-checker'),
|
123
|
+
x: "8",
|
124
|
+
y: "8",
|
125
|
+
width: "8",
|
126
|
+
height: "8"
|
127
|
+
})), /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("path", {
|
128
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($0459f00910e52686$exports)), 'spectrum-ColorLoupe-inner'),
|
129
|
+
d: "M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z",
|
130
|
+
fill: `url(#${patternId})`
|
131
|
+
}), /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("path", {
|
132
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($0459f00910e52686$exports)), 'spectrum-ColorLoupe-inner'),
|
133
|
+
d: "M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z",
|
134
|
+
fill: valueCSS
|
135
|
+
}), /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("path", {
|
136
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($0459f00910e52686$exports)), 'spectrum-ColorLoupe-outer'),
|
137
|
+
d: "M25 3A21.98 21.98 0 003 25c0 6.2 4 14.794 11.568 24.853A144.233 144.233 0 0025 62.132a144.085 144.085 0 0010.4-12.239C42.99 39.816 47 31.209 47 25A21.98 21.98 0 0025 3m0-2a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z"
|
138
|
+
})), children));
|
161
139
|
}
|
162
140
|
|
163
|
-
|
164
|
-
|
165
|
-
$
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
var $
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
141
|
+
|
142
|
+
|
143
|
+
var $155195a08d34c5d8$exports = {};
|
144
|
+
|
145
|
+
$parcel$export($155195a08d34c5d8$exports, "spectrum-ColorWheel", () => $155195a08d34c5d8$export$b70a5ca28702fbc6, (v) => $155195a08d34c5d8$export$b70a5ca28702fbc6 = v);
|
146
|
+
$parcel$export($155195a08d34c5d8$exports, "is-focused", () => $155195a08d34c5d8$export$e7dc768d35940237, (v) => $155195a08d34c5d8$export$e7dc768d35940237 = v);
|
147
|
+
$parcel$export($155195a08d34c5d8$exports, "spectrum-ColorWheel-handle", () => $155195a08d34c5d8$export$4cd23920eb8ac056, (v) => $155195a08d34c5d8$export$4cd23920eb8ac056 = v);
|
148
|
+
$parcel$export($155195a08d34c5d8$exports, "spectrum-ColorWheel-slider", () => $155195a08d34c5d8$export$f476ddda713d62b, (v) => $155195a08d34c5d8$export$f476ddda713d62b = v);
|
149
|
+
$parcel$export($155195a08d34c5d8$exports, "is-disabled", () => $155195a08d34c5d8$export$d35bc1e505d1ebbf, (v) => $155195a08d34c5d8$export$d35bc1e505d1ebbf = v);
|
150
|
+
$parcel$export($155195a08d34c5d8$exports, "is-dragged", () => $155195a08d34c5d8$export$8778c911bed6c759, (v) => $155195a08d34c5d8$export$8778c911bed6c759 = v);
|
151
|
+
$parcel$export($155195a08d34c5d8$exports, "spectrum-ColorWheel-gradient", () => $155195a08d34c5d8$export$9afaa791d7500a9b, (v) => $155195a08d34c5d8$export$9afaa791d7500a9b = v);
|
152
|
+
$parcel$export($155195a08d34c5d8$exports, "spectrum-ColorWheel-segment", () => $155195a08d34c5d8$export$ada9fbffdaa4f10, (v) => $155195a08d34c5d8$export$ada9fbffdaa4f10 = v);
|
153
|
+
var $155195a08d34c5d8$export$b70a5ca28702fbc6;
|
154
|
+
var $155195a08d34c5d8$export$e7dc768d35940237;
|
155
|
+
var $155195a08d34c5d8$export$4cd23920eb8ac056;
|
156
|
+
var $155195a08d34c5d8$export$f476ddda713d62b;
|
157
|
+
var $155195a08d34c5d8$export$d35bc1e505d1ebbf;
|
158
|
+
var $155195a08d34c5d8$export$8778c911bed6c759;
|
159
|
+
var $155195a08d34c5d8$export$9afaa791d7500a9b;
|
160
|
+
var $155195a08d34c5d8$export$ada9fbffdaa4f10;
|
161
|
+
$155195a08d34c5d8$export$b70a5ca28702fbc6 = "_spectrum-ColorWheel_31462a";
|
162
|
+
$155195a08d34c5d8$export$e7dc768d35940237 = "_is-focused_31462a";
|
163
|
+
$155195a08d34c5d8$export$4cd23920eb8ac056 = "_spectrum-ColorWheel-handle_31462a";
|
164
|
+
$155195a08d34c5d8$export$f476ddda713d62b = "_spectrum-ColorWheel-slider_31462a";
|
165
|
+
$155195a08d34c5d8$export$d35bc1e505d1ebbf = "_is-disabled_31462a";
|
166
|
+
$155195a08d34c5d8$export$8778c911bed6c759 = "_is-dragged_31462a";
|
167
|
+
$155195a08d34c5d8$export$9afaa791d7500a9b = "_spectrum-ColorWheel-gradient_31462a";
|
168
|
+
$155195a08d34c5d8$export$ada9fbffdaa4f10 = "_spectrum-ColorWheel-segment_31462a";
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
const $38dc4cfa8cb7ace6$var$WHEEL_THICKNESS = 24;
|
177
|
+
function $38dc4cfa8cb7ace6$var$ColorWheel(props, ref) {
|
178
|
+
props = $91ZxQ$reactspectrumprovider.useProviderProps(props);
|
179
|
+
let { isDisabled: isDisabled } = props;
|
180
|
+
let size = props.size && $91ZxQ$reactspectrumutils.dimensionValue(props.size);
|
181
|
+
let { styleProps: styleProps } = $91ZxQ$reactspectrumutils.useStyleProps(props);
|
182
|
+
let inputRef = $91ZxQ$react.useRef(null);
|
183
|
+
let containerRef = $91ZxQ$reactspectrumutils.useFocusableRef(ref, inputRef);
|
184
|
+
let [wheelRadius, setWheelRadius] = $91ZxQ$react.useState(null);
|
185
|
+
let [wheelThickness, setWheelThickness] = $91ZxQ$react.useState($38dc4cfa8cb7ace6$var$WHEEL_THICKNESS);
|
186
|
+
let resizeHandler = $91ZxQ$react.useCallback(()=>{
|
187
|
+
if (containerRef.current) {
|
188
|
+
setWheelRadius(containerRef.current.offsetWidth / 2);
|
189
|
+
let thickness = window.getComputedStyle(containerRef.current).getPropertyValue('--spectrum-colorwheel-track-thickness');
|
190
|
+
if (thickness) setWheelThickness(parseInt(thickness, 10));
|
191
|
+
}
|
192
|
+
}, [
|
193
|
+
containerRef,
|
194
|
+
setWheelRadius,
|
195
|
+
setWheelThickness
|
196
|
+
]);
|
197
|
+
$91ZxQ$react.useEffect(()=>{
|
198
|
+
// the size observer's fallback to the window resize event doesn't fire on mount
|
199
|
+
if (wheelRadius == null) resizeHandler();
|
200
|
+
}, [
|
201
|
+
wheelRadius,
|
202
|
+
resizeHandler
|
203
|
+
]);
|
204
|
+
$91ZxQ$reactariautils.useResizeObserver({
|
205
|
+
ref: containerRef,
|
206
|
+
onResize: resizeHandler
|
207
|
+
});
|
208
|
+
let state = $91ZxQ$reactstatelycolor.useColorWheelState(props);
|
209
|
+
let { trackProps: trackProps , inputProps: inputProps , thumbProps: thumbProps } = $91ZxQ$reactariacolor.useColorWheel({
|
210
|
+
...props,
|
211
|
+
innerRadius: wheelRadius - wheelThickness,
|
212
|
+
outerRadius: wheelRadius
|
213
|
+
}, state, inputRef);
|
214
|
+
let { focusProps: focusProps , isFocusVisible: isFocusVisible } = $91ZxQ$reactariafocus.useFocusRing();
|
215
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("div", {
|
216
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($155195a08d34c5d8$exports)), 'spectrum-ColorWheel', {
|
217
|
+
'is-disabled': isDisabled
|
218
|
+
}, styleProps.className),
|
219
|
+
ref: containerRef,
|
220
|
+
style: {
|
221
|
+
...styleProps.style,
|
222
|
+
// Workaround around https://github.com/adobe/spectrum-css/issues/1032
|
223
|
+
// @ts-ignore
|
224
|
+
'width': size,
|
225
|
+
'height': size
|
226
|
+
}
|
227
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("div", {
|
228
|
+
...trackProps,
|
229
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($155195a08d34c5d8$exports)), 'spectrum-ColorWheel-gradient')
|
230
|
+
}), /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement($1c0d7ecef90694e9$export$a3cc47cee1c1ccc, {
|
231
|
+
value: state.getDisplayColor(),
|
232
|
+
isFocused: isFocusVisible,
|
233
|
+
isDisabled: isDisabled,
|
234
|
+
isDragging: state.isDragging,
|
235
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($155195a08d34c5d8$exports)), 'spectrum-ColorWheel-handle'),
|
236
|
+
...thumbProps
|
237
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("input", {
|
238
|
+
...focusProps,
|
239
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($155195a08d34c5d8$exports)), 'spectrum-ColorWheel-slider'),
|
240
|
+
...inputProps,
|
241
|
+
ref: inputRef
|
242
|
+
}))));
|
248
243
|
}
|
249
244
|
/**
|
250
245
|
* ColorWheels allow users to adjust the hue of an HSL or HSB color value on a circular track.
|
251
|
-
*/
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
exports
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
label =
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
} = useFocusVisible();
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
})
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
className: classNames($af343c9aea50f8d58d87012145d$$interop$default, 'spectrum-ColorSlider-handle')
|
371
|
-
}, thumbProps), /*#__PURE__*/_react.createElement("input", _babelRuntimeHelpersExtends({}, inputProps, focusProps, {
|
372
|
-
ref: inputRef,
|
373
|
-
className: classNames($af343c9aea50f8d58d87012145d$$interop$default, 'spectrum-ColorSlider-slider')
|
374
|
-
})))));
|
246
|
+
*/ let $38dc4cfa8cb7ace6$export$f80663f808113381 = /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).forwardRef($38dc4cfa8cb7ace6$var$ColorWheel);
|
247
|
+
|
248
|
+
|
249
|
+
var $b3c0cf7643c25d02$exports = {};
|
250
|
+
|
251
|
+
$parcel$export($b3c0cf7643c25d02$exports, "ColorSlider", () => $b3c0cf7643c25d02$export$44fd664bcca5b6fb);
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
var $0395a726ccae0692$exports = {};
|
258
|
+
|
259
|
+
$parcel$export($0395a726ccae0692$exports, "spectrum-ColorSlider", () => $0395a726ccae0692$export$a5f8b0989b27a604, (v) => $0395a726ccae0692$export$a5f8b0989b27a604 = v);
|
260
|
+
$parcel$export($0395a726ccae0692$exports, "is-focused", () => $0395a726ccae0692$export$e7dc768d35940237, (v) => $0395a726ccae0692$export$e7dc768d35940237 = v);
|
261
|
+
$parcel$export($0395a726ccae0692$exports, "spectrum-ColorSlider-handle", () => $0395a726ccae0692$export$8c273ba92fabe1f1, (v) => $0395a726ccae0692$export$8c273ba92fabe1f1 = v);
|
262
|
+
$parcel$export($0395a726ccae0692$exports, "spectrum-ColorSlider-slider", () => $0395a726ccae0692$export$2f08b72944af536, (v) => $0395a726ccae0692$export$2f08b72944af536 = v);
|
263
|
+
$parcel$export($0395a726ccae0692$exports, "spectrum-ColorSlider-container--horizontal", () => $0395a726ccae0692$export$33e97914f6746614, (v) => $0395a726ccae0692$export$33e97914f6746614 = v);
|
264
|
+
$parcel$export($0395a726ccae0692$exports, "spectrum-ColorSlider-container--vertical", () => $0395a726ccae0692$export$cd1c093289104c66, (v) => $0395a726ccae0692$export$cd1c093289104c66 = v);
|
265
|
+
$parcel$export($0395a726ccae0692$exports, "is-disabled", () => $0395a726ccae0692$export$d35bc1e505d1ebbf, (v) => $0395a726ccae0692$export$d35bc1e505d1ebbf = v);
|
266
|
+
$parcel$export($0395a726ccae0692$exports, "spectrum-ColorSlider--vertical", () => $0395a726ccae0692$export$83dcf61b398bfaf1, (v) => $0395a726ccae0692$export$83dcf61b398bfaf1 = v);
|
267
|
+
var $0395a726ccae0692$export$a5f8b0989b27a604;
|
268
|
+
var $0395a726ccae0692$export$e7dc768d35940237;
|
269
|
+
var $0395a726ccae0692$export$8c273ba92fabe1f1;
|
270
|
+
var $0395a726ccae0692$export$2f08b72944af536;
|
271
|
+
var $0395a726ccae0692$export$33e97914f6746614;
|
272
|
+
var $0395a726ccae0692$export$cd1c093289104c66;
|
273
|
+
var $0395a726ccae0692$export$d35bc1e505d1ebbf;
|
274
|
+
var $0395a726ccae0692$export$83dcf61b398bfaf1;
|
275
|
+
$0395a726ccae0692$export$a5f8b0989b27a604 = "_spectrum-ColorSlider_a5bb06";
|
276
|
+
$0395a726ccae0692$export$e7dc768d35940237 = "_is-focused_a5bb06";
|
277
|
+
$0395a726ccae0692$export$8c273ba92fabe1f1 = "_spectrum-ColorSlider-handle_a5bb06";
|
278
|
+
$0395a726ccae0692$export$2f08b72944af536 = "_spectrum-ColorSlider-slider_a5bb06";
|
279
|
+
$0395a726ccae0692$export$33e97914f6746614 = "_spectrum-ColorSlider-container--horizontal_a5bb06";
|
280
|
+
$0395a726ccae0692$export$cd1c093289104c66 = "_spectrum-ColorSlider-container--vertical_a5bb06";
|
281
|
+
$0395a726ccae0692$export$d35bc1e505d1ebbf = "_is-disabled_a5bb06";
|
282
|
+
$0395a726ccae0692$export$83dcf61b398bfaf1 = "_spectrum-ColorSlider--vertical_a5bb06";
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
function $b3c0cf7643c25d02$var$ColorSlider(props, ref) {
|
291
|
+
props = $91ZxQ$reactspectrumprovider.useProviderProps(props);
|
292
|
+
let { isDisabled: isDisabled , channel: channel , orientation: orientation , label: label , showValueLabel: showValueLabel , 'aria-label': ariaLabel } = props;
|
293
|
+
let vertical = orientation === 'vertical';
|
294
|
+
let { styleProps: styleProps } = $91ZxQ$reactspectrumutils.useStyleProps(props);
|
295
|
+
let { locale: locale } = $91ZxQ$reactariai18n.useLocale();
|
296
|
+
let inputRef = $91ZxQ$react.useRef();
|
297
|
+
let trackRef = $91ZxQ$react.useRef();
|
298
|
+
let domRef = $91ZxQ$reactspectrumutils.useFocusableRef(ref, inputRef);
|
299
|
+
let state = $91ZxQ$reactstatelycolor.useColorSliderState({
|
300
|
+
...props,
|
301
|
+
locale: locale
|
302
|
+
});
|
303
|
+
// If vertical and a label is provided, use it as an aria-label instead.
|
304
|
+
if (vertical && label) {
|
305
|
+
ariaLabel = ariaLabel || (typeof label === 'string' ? label : null);
|
306
|
+
label = null;
|
307
|
+
}
|
308
|
+
// If no external label, aria-label or aria-labelledby is provided,
|
309
|
+
// default to displaying the localized channel value.
|
310
|
+
// Specifically check if label is undefined. If label is `null` then display no visible label.
|
311
|
+
// A default aria-label is provided by useColorSlider in that case.
|
312
|
+
if (label === undefined && !ariaLabel && !props['aria-labelledby'] && !vertical) label = state.value.getChannelName(channel, locale);
|
313
|
+
// Show the value label by default if there is a visible label
|
314
|
+
if (showValueLabel == null) showValueLabel = !!label;
|
315
|
+
let { inputProps: inputProps , thumbProps: thumbProps , trackProps: trackProps , labelProps: labelProps , outputProps: outputProps } = $91ZxQ$reactariacolor.useColorSlider({
|
316
|
+
...props,
|
317
|
+
label: label,
|
318
|
+
'aria-label': ariaLabel,
|
319
|
+
trackRef: trackRef,
|
320
|
+
inputRef: inputRef
|
321
|
+
}, state);
|
322
|
+
let { isFocusVisible: isFocusVisible } = $91ZxQ$reactariainteractions.useFocusVisible();
|
323
|
+
let [isFocused, setIsFocused] = $91ZxQ$react.useState(false);
|
324
|
+
let { focusProps: focusProps } = $91ZxQ$reactariainteractions.useFocus({
|
325
|
+
isDisabled: isDisabled,
|
326
|
+
onFocusChange: setIsFocused
|
327
|
+
});
|
328
|
+
let alignLabel;
|
329
|
+
if (vertical) alignLabel = 'center';
|
330
|
+
else if (label != null && showValueLabel) alignLabel = 'space-between';
|
331
|
+
else if (label != null) alignLabel = 'flex-start';
|
332
|
+
else if (showValueLabel) alignLabel = 'flex-end';
|
333
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("div", {
|
334
|
+
ref: domRef,
|
335
|
+
...styleProps,
|
336
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($0395a726ccae0692$exports)), {
|
337
|
+
'spectrum-ColorSlider-container--horizontal': !vertical,
|
338
|
+
'spectrum-ColorSlider-container--vertical': vertical
|
339
|
+
})
|
340
|
+
}, label && /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement($91ZxQ$reactspectrumlayout.Flex, {
|
341
|
+
direction: "row",
|
342
|
+
justifyContent: alignLabel
|
343
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement($91ZxQ$reactspectrumlabel.Label, labelProps, label), showValueLabel && /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement($91ZxQ$reactspectrumlabel.Label, {
|
344
|
+
elementType: "span"
|
345
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("output", outputProps, state.value.formatChannelValue(channel, locale)))), /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("div", {
|
346
|
+
...trackProps,
|
347
|
+
ref: trackRef,
|
348
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($0395a726ccae0692$exports)), 'spectrum-ColorSlider', {
|
349
|
+
'is-disabled': isDisabled,
|
350
|
+
'spectrum-ColorSlider--vertical': vertical
|
351
|
+
})
|
352
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement($1c0d7ecef90694e9$export$a3cc47cee1c1ccc, {
|
353
|
+
value: state.getDisplayColor(),
|
354
|
+
isFocused: isFocused && isFocusVisible,
|
355
|
+
isDisabled: isDisabled,
|
356
|
+
isDragging: state.isThumbDragging(0),
|
357
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($0395a726ccae0692$exports)), 'spectrum-ColorSlider-handle'),
|
358
|
+
...thumbProps
|
359
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement("input", {
|
360
|
+
...inputProps,
|
361
|
+
...focusProps,
|
362
|
+
ref: inputRef,
|
363
|
+
className: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($0395a726ccae0692$exports)), 'spectrum-ColorSlider-slider')
|
364
|
+
})))));
|
375
365
|
}
|
376
366
|
/**
|
377
367
|
* ColorSliders allow users to adjust an individual channel of a color value.
|
378
|
-
*/
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
exports
|
384
|
-
|
385
|
-
|
386
|
-
$
|
387
|
-
|
388
|
-
|
389
|
-
var $
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
368
|
+
*/ let $b3c0cf7643c25d02$export$44fd664bcca5b6fb = /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).forwardRef($b3c0cf7643c25d02$var$ColorSlider);
|
369
|
+
|
370
|
+
|
371
|
+
var $5ef4cb45ea3ba8fe$exports = {};
|
372
|
+
|
373
|
+
$parcel$export($5ef4cb45ea3ba8fe$exports, "ColorField", () => $5ef4cb45ea3ba8fe$export$b865d4358897bb17);
|
374
|
+
|
375
|
+
|
376
|
+
var $9bc51c393a2ddd21$exports = {};
|
377
|
+
|
378
|
+
$parcel$export($9bc51c393a2ddd21$exports, "react-spectrum-ColorField-input", () => $9bc51c393a2ddd21$export$7d80c6630a750b1, (v) => $9bc51c393a2ddd21$export$7d80c6630a750b1 = v);
|
379
|
+
var $9bc51c393a2ddd21$export$7d80c6630a750b1;
|
380
|
+
$9bc51c393a2ddd21$export$7d80c6630a750b1 = "_react-spectrum-ColorField-input_7bde3a";
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
function $5ef4cb45ea3ba8fe$var$ColorField(props, ref) {
|
388
|
+
props = $91ZxQ$reactspectrumprovider.useProviderProps(props);
|
389
|
+
let { value: // These disabled props are handled by the state hook
|
390
|
+
value , defaultValue: defaultValue , onChange: onChange , ...otherProps } = props;
|
391
|
+
let state = $91ZxQ$reactstatelycolor.useColorFieldState(props);
|
392
|
+
let inputRef = $91ZxQ$react.useRef();
|
393
|
+
let { labelProps: labelProps , inputProps: inputProps } = $91ZxQ$reactariacolor.useColorField(otherProps, state, inputRef);
|
394
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).createElement($91ZxQ$reactspectrumtextfield.TextFieldBase, {
|
395
|
+
...otherProps,
|
396
|
+
ref: ref,
|
397
|
+
inputRef: inputRef,
|
398
|
+
labelProps: labelProps,
|
399
|
+
inputProps: inputProps,
|
400
|
+
inputClassName: $91ZxQ$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9bc51c393a2ddd21$exports)), 'react-spectrum-ColorField-input')
|
401
|
+
}));
|
409
402
|
}
|
410
403
|
/**
|
411
404
|
* ColorFields allow users to enter a color in #rrggbb hexadecimal format.
|
412
|
-
*/
|
405
|
+
*/ const $5ef4cb45ea3ba8fe$export$b865d4358897bb17 = /*#__PURE__*/ ($parcel$interopDefault($91ZxQ$react)).forwardRef($5ef4cb45ea3ba8fe$var$ColorField);
|
406
|
+
|
413
407
|
|
408
|
+
$parcel$exportWildcard(module.exports, $38dc4cfa8cb7ace6$exports);
|
409
|
+
$parcel$exportWildcard(module.exports, $b3c0cf7643c25d02$exports);
|
410
|
+
$parcel$exportWildcard(module.exports, $5ef4cb45ea3ba8fe$exports);
|
414
411
|
|
415
|
-
const ColorField = /*#__PURE__*/_react.forwardRef($b25d8991f57211cb8e429d74bf3d19f7$var$ColorField);
|
416
412
|
|
417
|
-
exports.ColorField = ColorField;
|
418
413
|
//# sourceMappingURL=main.js.map
|