@react-spectrum/color 3.0.0-beta.2 → 3.0.0-beta.21

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.js CHANGED
@@ -1,418 +1,552 @@
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");
70
-
2
+ var $aAzec$reactspectrumutils = require("@react-spectrum/utils");
3
+ var $aAzec$reactariautils = require("@react-aria/utils");
4
+ var $aAzec$react = require("react");
5
+ var $aAzec$reactariacolor = require("@react-aria/color");
6
+ var $aAzec$reactstatelycolor = require("@react-stately/color");
7
+ var $aAzec$reactariafocus = require("@react-aria/focus");
8
+ var $aAzec$reactspectrumprovider = require("@react-spectrum/provider");
9
+ var $aAzec$reactspectrumlabel = require("@react-spectrum/label");
10
+ var $aAzec$reactariainteractions = require("@react-aria/interactions");
11
+ var $aAzec$reactariai18n = require("@react-aria/i18n");
12
+ var $aAzec$reactspectrumtextfield = require("@react-spectrum/textfield");
13
+
14
+ function $parcel$export(e, n, v, s) {
15
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
16
+ }
71
17
  function $parcel$interopDefault(a) {
72
18
  return a && a.__esModule ? a.default : a;
73
19
  }
74
20
 
75
- // ASSET: /Users/govett/dev/react-spectrum-v3/node_modules/@adobe/spectrum-css-temp/components/colorhandle/vars.css
76
- var $a55762e3754ccaed122df9bda494d$exports = {};
77
- $a55762e3754ccaed122df9bda494d$exports = {
78
- "spectrum-ColorHandle": "_spectrum-ColorHandle_cc6c6",
79
- "is-focused": "_is-focused_cc6c6",
80
- "focus-ring": "_focus-ring_cc6c6",
81
- "is-disabled": "_is-disabled_cc6c6",
82
- "spectrum-ColorHandle-color": "_spectrum-ColorHandle-color_cc6c6"
83
- };
84
- // ASSET: /Users/govett/dev/react-spectrum-v3/node_modules/@adobe/spectrum-css-temp/components/colorloupe/vars.css
85
- var $c0c7404f767cd2ff4437cc6ce4e$exports = {};
86
- $c0c7404f767cd2ff4437cc6ce4e$exports = {
87
- "spectrum-ColorLoupe": "_spectrum-ColorLoupe_583f5",
88
- "is-open": "_is-open_583f5",
89
- "spectrum-ColorLoupe-outer": "_spectrum-ColorLoupe-outer_583f5",
90
- "spectrum-ColorLoupe-inner-background": "_spectrum-ColorLoupe-inner-background_583f5",
91
- "spectrum-ColorLoupe-inner-checker": "_spectrum-ColorLoupe-inner-checker_583f5"
92
- };
93
- var $a55762e3754ccaed122df9bda494d$$interop$default = $parcel$interopDefault($a55762e3754ccaed122df9bda494d$exports);
94
- var $c0c7404f767cd2ff4437cc6ce4e$$interop$default = $parcel$interopDefault($c0c7404f767cd2ff4437cc6ce4e$exports);
95
-
96
- function $f1039d797e7720d032e7ae6b6b3355b$export$ColorThumb(props) {
97
- let {
98
- value,
99
- isDisabled,
100
- isDragging,
101
- isFocused,
102
- children,
103
- className = ''
104
- } = props,
105
- otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["value", "isDisabled", "isDragging", "isFocused", "children", "className"]);
106
-
107
- let patternId = useId();
108
- let valueCSS = value.toString('css');
109
- return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersExtends({
110
- className: classNames($a55762e3754ccaed122df9bda494d$$interop$default, 'spectrum-ColorHandle', {
111
- 'is-focused': isFocused,
112
- 'is-disabled': isDisabled
113
- }) + ' ' + className
114
- }, otherProps), /*#__PURE__*/_react.createElement("div", {
115
- className: classNames($a55762e3754ccaed122df9bda494d$$interop$default, 'spectrum-ColorHandle-color'),
116
- style: {
117
- backgroundColor: valueCSS
118
- }
119
- }), /*#__PURE__*/_react.createElement("svg", {
120
- className: classNames($c0c7404f767cd2ff4437cc6ce4e$$interop$default, 'spectrum-ColorLoupe', {
121
- 'is-open': isDragging
122
- }),
123
- "aria-hidden": "true"
124
- }, /*#__PURE__*/_react.createElement("pattern", {
125
- id: patternId,
126
- x: "0",
127
- y: "0",
128
- width: "16",
129
- height: "16",
130
- patternUnits: "userSpaceOnUse"
131
- }, /*#__PURE__*/_react.createElement("rect", {
132
- className: classNames($c0c7404f767cd2ff4437cc6ce4e$$interop$default, 'spectrum-ColorLoupe-inner-background'),
133
- x: "0",
134
- y: "0",
135
- width: "16",
136
- height: "16"
137
- }), /*#__PURE__*/_react.createElement("rect", {
138
- className: classNames($c0c7404f767cd2ff4437cc6ce4e$$interop$default, 'spectrum-ColorLoupe-inner-checker'),
139
- x: "0",
140
- y: "0",
141
- width: "8",
142
- height: "8"
143
- }), /*#__PURE__*/_react.createElement("rect", {
144
- className: classNames($c0c7404f767cd2ff4437cc6ce4e$$interop$default, 'spectrum-ColorLoupe-inner-checker'),
145
- x: "8",
146
- y: "8",
147
- width: "8",
148
- height: "8"
149
- })), /*#__PURE__*/_react.createElement("path", {
150
- className: classNames($c0c7404f767cd2ff4437cc6ce4e$$interop$default, 'spectrum-ColorLoupe-inner'),
151
- d: "M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z",
152
- fill: "url(#" + patternId + ")"
153
- }), /*#__PURE__*/_react.createElement("path", {
154
- className: classNames($c0c7404f767cd2ff4437cc6ce4e$$interop$default, 'spectrum-ColorLoupe-inner'),
155
- d: "M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z",
156
- fill: valueCSS
157
- }), /*#__PURE__*/_react.createElement("path", {
158
- className: classNames($c0c7404f767cd2ff4437cc6ce4e$$interop$default, 'spectrum-ColorLoupe-outer'),
159
- 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"
160
- })), children);
21
+ $parcel$export(module.exports, "ColorArea", () => $5f016e950c2dc3a6$export$b2103f68a961418e);
22
+ $parcel$export(module.exports, "ColorWheel", () => $63a2864687444ae1$export$f80663f808113381);
23
+ $parcel$export(module.exports, "ColorSlider", () => $4537dec0de08c277$export$44fd664bcca5b6fb);
24
+ $parcel$export(module.exports, "ColorField", () => $8bdb9bc27ff3debb$export$b865d4358897bb17);
25
+ /*
26
+ * Copyright 2020 Adobe. All rights reserved.
27
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
28
+ * you may not use this file except in compliance with the License. You may obtain a copy
29
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
30
+ *
31
+ * Unless required by applicable law or agreed to in writing, software distributed under
32
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
33
+ * OF ANY KIND, either express or implied. See the License for the specific language
34
+ * governing permissions and limitations under the License.
35
+ */ /// <reference types="css-module-types" />
36
+ /*
37
+ * Copyright 2021 Adobe. All rights reserved.
38
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
39
+ * you may not use this file except in compliance with the License. You may obtain a copy
40
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
41
+ *
42
+ * Unless required by applicable law or agreed to in writing, software distributed under
43
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
44
+ * OF ANY KIND, either express or implied. See the License for the specific language
45
+ * governing permissions and limitations under the License.
46
+ */
47
+ /*
48
+ * Copyright 2020 Adobe. All rights reserved.
49
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
50
+ * you may not use this file except in compliance with the License. You may obtain a copy
51
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
52
+ *
53
+ * Unless required by applicable law or agreed to in writing, software distributed under
54
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
55
+ * OF ANY KIND, either express or implied. See the License for the specific language
56
+ * governing permissions and limitations under the License.
57
+ */
58
+
59
+ var $f61d632765728b2e$exports = {};
60
+
61
+ $parcel$export($f61d632765728b2e$exports, "spectrum-ColorHandle", () => $f61d632765728b2e$export$cd9afaa621b6216f, (v) => $f61d632765728b2e$export$cd9afaa621b6216f = v);
62
+ $parcel$export($f61d632765728b2e$exports, "is-focused", () => $f61d632765728b2e$export$e7dc768d35940237, (v) => $f61d632765728b2e$export$e7dc768d35940237 = v);
63
+ $parcel$export($f61d632765728b2e$exports, "focus-ring", () => $f61d632765728b2e$export$f39a09f249340e2a, (v) => $f61d632765728b2e$export$f39a09f249340e2a = v);
64
+ $parcel$export($f61d632765728b2e$exports, "is-disabled", () => $f61d632765728b2e$export$d35bc1e505d1ebbf, (v) => $f61d632765728b2e$export$d35bc1e505d1ebbf = v);
65
+ $parcel$export($f61d632765728b2e$exports, "spectrum-ColorHandle-color", () => $f61d632765728b2e$export$afe4c366ed4e659c, (v) => $f61d632765728b2e$export$afe4c366ed4e659c = v);
66
+ var $f61d632765728b2e$export$cd9afaa621b6216f;
67
+ var $f61d632765728b2e$export$e7dc768d35940237;
68
+ var $f61d632765728b2e$export$f39a09f249340e2a;
69
+ var $f61d632765728b2e$export$d35bc1e505d1ebbf;
70
+ var $f61d632765728b2e$export$afe4c366ed4e659c;
71
+ $f61d632765728b2e$export$cd9afaa621b6216f = "spectrum-ColorHandle_5a9f41";
72
+ $f61d632765728b2e$export$e7dc768d35940237 = "is-focused_5a9f41";
73
+ $f61d632765728b2e$export$f39a09f249340e2a = "focus-ring_5a9f41";
74
+ $f61d632765728b2e$export$d35bc1e505d1ebbf = "is-disabled_5a9f41";
75
+ $f61d632765728b2e$export$afe4c366ed4e659c = "spectrum-ColorHandle-color_5a9f41";
76
+
77
+
78
+ var $f65977ae56facfaa$exports = {};
79
+
80
+ $parcel$export($f65977ae56facfaa$exports, "spectrum-ColorLoupe", () => $f65977ae56facfaa$export$88d6ed2576b21809, (v) => $f65977ae56facfaa$export$88d6ed2576b21809 = v);
81
+ $parcel$export($f65977ae56facfaa$exports, "is-open", () => $f65977ae56facfaa$export$a9781837241c946d, (v) => $f65977ae56facfaa$export$a9781837241c946d = v);
82
+ $parcel$export($f65977ae56facfaa$exports, "spectrum-ColorLoupe-outer", () => $f65977ae56facfaa$export$d6ad38291e8aca9c, (v) => $f65977ae56facfaa$export$d6ad38291e8aca9c = v);
83
+ $parcel$export($f65977ae56facfaa$exports, "spectrum-ColorLoupe-inner-background", () => $f65977ae56facfaa$export$397af82b48750fe5, (v) => $f65977ae56facfaa$export$397af82b48750fe5 = v);
84
+ $parcel$export($f65977ae56facfaa$exports, "spectrum-ColorLoupe-inner-checker", () => $f65977ae56facfaa$export$f9a2a02e0b271024, (v) => $f65977ae56facfaa$export$f9a2a02e0b271024 = v);
85
+ var $f65977ae56facfaa$export$88d6ed2576b21809;
86
+ var $f65977ae56facfaa$export$a9781837241c946d;
87
+ var $f65977ae56facfaa$export$d6ad38291e8aca9c;
88
+ var $f65977ae56facfaa$export$397af82b48750fe5;
89
+ var $f65977ae56facfaa$export$f9a2a02e0b271024;
90
+ $f65977ae56facfaa$export$88d6ed2576b21809 = "spectrum-ColorLoupe_c818a8";
91
+ $f65977ae56facfaa$export$a9781837241c946d = "is-open_c818a8";
92
+ $f65977ae56facfaa$export$d6ad38291e8aca9c = "spectrum-ColorLoupe-outer_c818a8";
93
+ $f65977ae56facfaa$export$397af82b48750fe5 = "spectrum-ColorLoupe-inner-background_c818a8";
94
+ $f65977ae56facfaa$export$f9a2a02e0b271024 = "spectrum-ColorLoupe-inner-checker_c818a8";
95
+
96
+
97
+
98
+ function $2b9adc23f6c7cae1$export$a3cc47cee1c1ccc(props) {
99
+ let { value: value , isDisabled: isDisabled , isDragging: isDragging , isFocused: isFocused , children: children , className: className = "" , ...otherProps } = props;
100
+ let patternId = (0, $aAzec$reactariautils.useId)();
101
+ let valueCSS = value.toString("css");
102
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("div", {
103
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f61d632765728b2e$exports))), "spectrum-ColorHandle", {
104
+ "is-focused": isFocused,
105
+ "is-disabled": isDisabled
106
+ }) + " " + className,
107
+ ...otherProps
108
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("div", {
109
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f61d632765728b2e$exports))), "spectrum-ColorHandle-color"),
110
+ style: {
111
+ backgroundColor: valueCSS
112
+ }
113
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("svg", {
114
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f65977ae56facfaa$exports))), "spectrum-ColorLoupe", {
115
+ "is-open": isDragging
116
+ }),
117
+ "aria-hidden": "true"
118
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("pattern", {
119
+ id: patternId,
120
+ x: "0",
121
+ y: "0",
122
+ width: "16",
123
+ height: "16",
124
+ patternUnits: "userSpaceOnUse"
125
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("rect", {
126
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f65977ae56facfaa$exports))), "spectrum-ColorLoupe-inner-background"),
127
+ x: "0",
128
+ y: "0",
129
+ width: "16",
130
+ height: "16"
131
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("rect", {
132
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f65977ae56facfaa$exports))), "spectrum-ColorLoupe-inner-checker"),
133
+ x: "0",
134
+ y: "0",
135
+ width: "8",
136
+ height: "8"
137
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("rect", {
138
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f65977ae56facfaa$exports))), "spectrum-ColorLoupe-inner-checker"),
139
+ x: "8",
140
+ y: "8",
141
+ width: "8",
142
+ height: "8"
143
+ })), /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("path", {
144
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f65977ae56facfaa$exports))), "spectrum-ColorLoupe-inner"),
145
+ d: "M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z",
146
+ fill: `url(#${patternId})`
147
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("path", {
148
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f65977ae56facfaa$exports))), "spectrum-ColorLoupe-inner"),
149
+ d: "M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z",
150
+ fill: valueCSS
151
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("path", {
152
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f65977ae56facfaa$exports))), "spectrum-ColorLoupe-outer"),
153
+ 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"
154
+ })), children);
161
155
  }
162
156
 
163
- // ASSET: /Users/govett/dev/react-spectrum-v3/node_modules/@adobe/spectrum-css-temp/components/colorwheel/vars.css
164
- var $fa4e08bc458be14d6359c7136192ec4$exports = {};
165
- $fa4e08bc458be14d6359c7136192ec4$exports = {
166
- "spectrum-ColorWheel": "_spectrum-ColorWheel_5efa1",
167
- "is-focused": "_is-focused_5efa1",
168
- "spectrum-ColorWheel-handle": "_spectrum-ColorWheel-handle_5efa1",
169
- "spectrum-ColorWheel-slider": "_spectrum-ColorWheel-slider_5efa1",
170
- "is-disabled": "_is-disabled_5efa1",
171
- "is-dragged": "_is-dragged_5efa1",
172
- "spectrum-ColorWheel-gradient": "_spectrum-ColorWheel-gradient_5efa1",
173
- "spectrum-ColorWheel-segment": "_spectrum-ColorWheel-segment_5efa1"
174
- };
175
- const $c78a3286fdf083d3611a04f1cfbd186e$var$WHEEL_THICKNESS = 24;
176
- var $fa4e08bc458be14d6359c7136192ec4$$interop$default = $parcel$interopDefault($fa4e08bc458be14d6359c7136192ec4$exports);
177
-
178
- function $c78a3286fdf083d3611a04f1cfbd186e$var$ColorWheel(props, ref) {
179
- props = useProviderProps(props);
180
- let {
181
- isDisabled
182
- } = props;
183
- let size = props.size && dimensionValue(props.size);
184
- let {
185
- styleProps
186
- } = useStyleProps(props);
187
- let inputRef = useRef(null);
188
- let containerRef = useFocusableRef(ref, inputRef);
189
- let [wheelRadius, setWheelRadius] = useState(null);
190
- let [wheelThickness, setWheelThickness] = useState($c78a3286fdf083d3611a04f1cfbd186e$var$WHEEL_THICKNESS);
191
- let resizeHandler = useCallback(() => {
192
- if (containerRef.current) {
193
- setWheelRadius(containerRef.current.offsetWidth / 2);
194
- let thickness = window.getComputedStyle(containerRef.current).getPropertyValue('--spectrum-colorwheel-track-thickness');
195
-
196
- if (thickness) {
197
- setWheelThickness(parseInt(thickness, 10));
198
- }
199
- }
200
- }, [containerRef, setWheelRadius, setWheelThickness]);
201
- useEffect(() => {
202
- // the size observer's fallback to the window resize event doesn't fire on mount
203
- if (wheelRadius == null) {
204
- resizeHandler();
205
- }
206
- }, [wheelRadius, resizeHandler]);
207
- useResizeObserver({
208
- ref: containerRef,
209
- onResize: resizeHandler
210
- });
211
- let state = useColorWheelState(props);
212
- let {
213
- trackProps,
214
- inputProps,
215
- thumbProps
216
- } = useColorWheel(_babelRuntimeHelpersExtends({}, props, {
217
- innerRadius: wheelRadius - wheelThickness,
218
- outerRadius: wheelRadius
219
- }), state, inputRef);
220
- let {
221
- focusProps,
222
- isFocusVisible
223
- } = useFocusRing();
224
- return /*#__PURE__*/_react.createElement("div", {
225
- className: classNames($fa4e08bc458be14d6359c7136192ec4$$interop$default, 'spectrum-ColorWheel', {
226
- 'is-disabled': isDisabled
227
- }, styleProps.className),
228
- ref: containerRef,
229
- style: _babelRuntimeHelpersExtends({}, styleProps.style, {
230
- // Workaround around https://github.com/adobe/spectrum-css/issues/1032
231
- // @ts-ignore
232
- 'width': size,
233
- 'height': size
234
- })
235
- }, /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersExtends({}, trackProps, {
236
- className: classNames($fa4e08bc458be14d6359c7136192ec4$$interop$default, 'spectrum-ColorWheel-gradient')
237
- })), /*#__PURE__*/_react.createElement($f1039d797e7720d032e7ae6b6b3355b$export$ColorThumb, _babelRuntimeHelpersExtends({
238
- value: state.getDisplayColor(),
239
- isFocused: isFocusVisible,
240
- isDisabled: isDisabled,
241
- isDragging: state.isDragging,
242
- className: classNames($fa4e08bc458be14d6359c7136192ec4$$interop$default, 'spectrum-ColorWheel-handle')
243
- }, thumbProps), /*#__PURE__*/_react.createElement("input", _babelRuntimeHelpersExtends({}, focusProps, {
244
- className: classNames($fa4e08bc458be14d6359c7136192ec4$$interop$default, 'spectrum-ColorWheel-slider')
245
- }, inputProps, {
246
- ref: inputRef
247
- }))));
157
+
158
+
159
+
160
+ var $d4b4e0a63f9ca8c1$exports = {};
161
+
162
+ $parcel$export($d4b4e0a63f9ca8c1$exports, "spectrum-ColorArea", () => $d4b4e0a63f9ca8c1$export$bb6257a55a3c1efc, (v) => $d4b4e0a63f9ca8c1$export$bb6257a55a3c1efc = v);
163
+ $parcel$export($d4b4e0a63f9ca8c1$exports, "is-focused", () => $d4b4e0a63f9ca8c1$export$e7dc768d35940237, (v) => $d4b4e0a63f9ca8c1$export$e7dc768d35940237 = v);
164
+ $parcel$export($d4b4e0a63f9ca8c1$exports, "focus-ring", () => $d4b4e0a63f9ca8c1$export$f39a09f249340e2a, (v) => $d4b4e0a63f9ca8c1$export$f39a09f249340e2a = v);
165
+ $parcel$export($d4b4e0a63f9ca8c1$exports, "spectrum-ColorArea-handle", () => $d4b4e0a63f9ca8c1$export$d8addbd273c4e00, (v) => $d4b4e0a63f9ca8c1$export$d8addbd273c4e00 = v);
166
+ $parcel$export($d4b4e0a63f9ca8c1$exports, "is-disabled", () => $d4b4e0a63f9ca8c1$export$d35bc1e505d1ebbf, (v) => $d4b4e0a63f9ca8c1$export$d35bc1e505d1ebbf = v);
167
+ $parcel$export($d4b4e0a63f9ca8c1$exports, "spectrum-ColorArea-gradient", () => $d4b4e0a63f9ca8c1$export$40686f4fcb8a9916, (v) => $d4b4e0a63f9ca8c1$export$40686f4fcb8a9916 = v);
168
+ $parcel$export($d4b4e0a63f9ca8c1$exports, "spectrum-ColorArea-slider", () => $d4b4e0a63f9ca8c1$export$7d727cacaa7cea1e, (v) => $d4b4e0a63f9ca8c1$export$7d727cacaa7cea1e = v);
169
+ $parcel$export($d4b4e0a63f9ca8c1$exports, "spectrum-ColorHandle-color", () => $d4b4e0a63f9ca8c1$export$afe4c366ed4e659c, (v) => $d4b4e0a63f9ca8c1$export$afe4c366ed4e659c = v);
170
+ var $d4b4e0a63f9ca8c1$export$bb6257a55a3c1efc;
171
+ var $d4b4e0a63f9ca8c1$export$e7dc768d35940237;
172
+ var $d4b4e0a63f9ca8c1$export$f39a09f249340e2a;
173
+ var $d4b4e0a63f9ca8c1$export$d8addbd273c4e00;
174
+ var $d4b4e0a63f9ca8c1$export$d35bc1e505d1ebbf;
175
+ var $d4b4e0a63f9ca8c1$export$40686f4fcb8a9916;
176
+ var $d4b4e0a63f9ca8c1$export$7d727cacaa7cea1e;
177
+ var $d4b4e0a63f9ca8c1$export$afe4c366ed4e659c;
178
+ $d4b4e0a63f9ca8c1$export$bb6257a55a3c1efc = "spectrum-ColorArea_35e2c0";
179
+ $d4b4e0a63f9ca8c1$export$e7dc768d35940237 = "is-focused_35e2c0";
180
+ $d4b4e0a63f9ca8c1$export$f39a09f249340e2a = "focus-ring_35e2c0";
181
+ $d4b4e0a63f9ca8c1$export$d8addbd273c4e00 = "spectrum-ColorArea-handle_35e2c0";
182
+ $d4b4e0a63f9ca8c1$export$d35bc1e505d1ebbf = "is-disabled_35e2c0";
183
+ $d4b4e0a63f9ca8c1$export$40686f4fcb8a9916 = "spectrum-ColorArea-gradient_35e2c0";
184
+ $d4b4e0a63f9ca8c1$export$7d727cacaa7cea1e = "spectrum-ColorArea-slider_35e2c0";
185
+ $d4b4e0a63f9ca8c1$export$afe4c366ed4e659c = "spectrum-ColorHandle-color_35e2c0";
186
+
187
+
188
+
189
+
190
+
191
+
192
+ function $5f016e950c2dc3a6$var$ColorArea(props, ref) {
193
+ props = (0, $aAzec$reactspectrumprovider.useProviderProps)(props);
194
+ let { isDisabled: isDisabled } = props;
195
+ let size = props.size && (0, $aAzec$reactspectrumutils.dimensionValue)(props.size);
196
+ let { styleProps: styleProps } = (0, $aAzec$reactspectrumutils.useStyleProps)(props);
197
+ let inputXRef = (0, $aAzec$react.useRef)(null);
198
+ let inputYRef = (0, $aAzec$react.useRef)(null);
199
+ let containerRef = (0, $aAzec$reactspectrumutils.useFocusableRef)(ref, inputXRef);
200
+ let state = (0, $aAzec$reactstatelycolor.useColorAreaState)(props);
201
+ let { colorAreaProps: colorAreaProps , gradientProps: gradientProps , xInputProps: xInputProps , yInputProps: yInputProps , thumbProps: thumbProps } = (0, $aAzec$reactariacolor.useColorArea)({
202
+ ...props,
203
+ inputXRef: inputXRef,
204
+ inputYRef: inputYRef,
205
+ containerRef: containerRef
206
+ }, state);
207
+ let { focusProps: focusProps , isFocusVisible: isFocusVisible } = (0, $aAzec$reactariafocus.useFocusRing)();
208
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("div", {
209
+ ...colorAreaProps,
210
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($d4b4e0a63f9ca8c1$exports))), "spectrum-ColorArea", {
211
+ "is-disabled": isDisabled
212
+ }, styleProps.className),
213
+ ref: containerRef,
214
+ style: {
215
+ ...colorAreaProps.style,
216
+ ...styleProps.style,
217
+ // Workaround around https://github.com/adobe/spectrum-css/issues/1032
218
+ width: size,
219
+ height: size
220
+ }
221
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("div", {
222
+ ...gradientProps,
223
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($d4b4e0a63f9ca8c1$exports))), "spectrum-ColorArea-gradient")
224
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement((0, $2b9adc23f6c7cae1$export$a3cc47cee1c1ccc), {
225
+ value: state.getDisplayColor(),
226
+ isFocused: isFocusVisible,
227
+ isDisabled: isDisabled,
228
+ isDragging: state.isDragging,
229
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($d4b4e0a63f9ca8c1$exports))), "spectrum-ColorArea-handle"),
230
+ ...thumbProps
231
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("div", {
232
+ role: "presentation"
233
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("input", {
234
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($d4b4e0a63f9ca8c1$exports))), "spectrum-ColorArea-slider"),
235
+ ...(0, $aAzec$reactariautils.mergeProps)(xInputProps, focusProps),
236
+ ref: inputXRef
237
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("input", {
238
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($d4b4e0a63f9ca8c1$exports))), "spectrum-ColorArea-slider"),
239
+ ...(0, $aAzec$reactariautils.mergeProps)(yInputProps, focusProps),
240
+ ref: inputYRef
241
+ }))));
242
+ }
243
+ /**
244
+ * ColorArea allows users to adjust two channels of an RGB, HSL or HSB color value against a two-dimensional gradient background.
245
+ */ let $5f016e950c2dc3a6$export$b2103f68a961418e = /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).forwardRef($5f016e950c2dc3a6$var$ColorArea);
246
+
247
+
248
+ /*
249
+ * Copyright 2020 Adobe. All rights reserved.
250
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
251
+ * you may not use this file except in compliance with the License. You may obtain a copy
252
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
253
+ *
254
+ * Unless required by applicable law or agreed to in writing, software distributed under
255
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
256
+ * OF ANY KIND, either express or implied. See the License for the specific language
257
+ * governing permissions and limitations under the License.
258
+ */
259
+
260
+
261
+ var $8fc6b1a2f4e7f682$exports = {};
262
+
263
+ $parcel$export($8fc6b1a2f4e7f682$exports, "spectrum-ColorWheel", () => $8fc6b1a2f4e7f682$export$b70a5ca28702fbc6, (v) => $8fc6b1a2f4e7f682$export$b70a5ca28702fbc6 = v);
264
+ $parcel$export($8fc6b1a2f4e7f682$exports, "is-focused", () => $8fc6b1a2f4e7f682$export$e7dc768d35940237, (v) => $8fc6b1a2f4e7f682$export$e7dc768d35940237 = v);
265
+ $parcel$export($8fc6b1a2f4e7f682$exports, "spectrum-ColorWheel-handle", () => $8fc6b1a2f4e7f682$export$4cd23920eb8ac056, (v) => $8fc6b1a2f4e7f682$export$4cd23920eb8ac056 = v);
266
+ $parcel$export($8fc6b1a2f4e7f682$exports, "spectrum-ColorWheel-slider", () => $8fc6b1a2f4e7f682$export$f476ddda713d62b, (v) => $8fc6b1a2f4e7f682$export$f476ddda713d62b = v);
267
+ $parcel$export($8fc6b1a2f4e7f682$exports, "is-disabled", () => $8fc6b1a2f4e7f682$export$d35bc1e505d1ebbf, (v) => $8fc6b1a2f4e7f682$export$d35bc1e505d1ebbf = v);
268
+ $parcel$export($8fc6b1a2f4e7f682$exports, "is-dragged", () => $8fc6b1a2f4e7f682$export$8778c911bed6c759, (v) => $8fc6b1a2f4e7f682$export$8778c911bed6c759 = v);
269
+ $parcel$export($8fc6b1a2f4e7f682$exports, "spectrum-ColorWheel-gradient", () => $8fc6b1a2f4e7f682$export$9afaa791d7500a9b, (v) => $8fc6b1a2f4e7f682$export$9afaa791d7500a9b = v);
270
+ $parcel$export($8fc6b1a2f4e7f682$exports, "spectrum-ColorWheel-segment", () => $8fc6b1a2f4e7f682$export$ada9fbffdaa4f10, (v) => $8fc6b1a2f4e7f682$export$ada9fbffdaa4f10 = v);
271
+ var $8fc6b1a2f4e7f682$export$b70a5ca28702fbc6;
272
+ var $8fc6b1a2f4e7f682$export$e7dc768d35940237;
273
+ var $8fc6b1a2f4e7f682$export$4cd23920eb8ac056;
274
+ var $8fc6b1a2f4e7f682$export$f476ddda713d62b;
275
+ var $8fc6b1a2f4e7f682$export$d35bc1e505d1ebbf;
276
+ var $8fc6b1a2f4e7f682$export$8778c911bed6c759;
277
+ var $8fc6b1a2f4e7f682$export$9afaa791d7500a9b;
278
+ var $8fc6b1a2f4e7f682$export$ada9fbffdaa4f10;
279
+ $8fc6b1a2f4e7f682$export$b70a5ca28702fbc6 = "spectrum-ColorWheel_31462a";
280
+ $8fc6b1a2f4e7f682$export$e7dc768d35940237 = "is-focused_31462a";
281
+ $8fc6b1a2f4e7f682$export$4cd23920eb8ac056 = "spectrum-ColorWheel-handle_31462a";
282
+ $8fc6b1a2f4e7f682$export$f476ddda713d62b = "spectrum-ColorWheel-slider_31462a";
283
+ $8fc6b1a2f4e7f682$export$d35bc1e505d1ebbf = "is-disabled_31462a";
284
+ $8fc6b1a2f4e7f682$export$8778c911bed6c759 = "is-dragged_31462a";
285
+ $8fc6b1a2f4e7f682$export$9afaa791d7500a9b = "spectrum-ColorWheel-gradient_31462a";
286
+ $8fc6b1a2f4e7f682$export$ada9fbffdaa4f10 = "spectrum-ColorWheel-segment_31462a";
287
+
288
+
289
+
290
+
291
+
292
+
293
+
294
+ const $63a2864687444ae1$var$WHEEL_THICKNESS = 24;
295
+ function $63a2864687444ae1$var$ColorWheel(props, ref) {
296
+ props = (0, $aAzec$reactspectrumprovider.useProviderProps)(props);
297
+ let { isDisabled: isDisabled } = props;
298
+ let size = props.size && (0, $aAzec$reactspectrumutils.dimensionValue)(props.size);
299
+ let { styleProps: styleProps } = (0, $aAzec$reactspectrumutils.useStyleProps)(props);
300
+ let inputRef = (0, $aAzec$react.useRef)(null);
301
+ let containerRef = (0, $aAzec$reactspectrumutils.useFocusableRef)(ref, inputRef);
302
+ let [wheelRadius, setWheelRadius] = (0, $aAzec$react.useState)(0);
303
+ let [wheelThickness, setWheelThickness] = (0, $aAzec$react.useState)($63a2864687444ae1$var$WHEEL_THICKNESS);
304
+ let resizeHandler = (0, $aAzec$react.useCallback)(()=>{
305
+ if (containerRef.current) {
306
+ setWheelRadius(containerRef.current.offsetWidth / 2);
307
+ let thickness = window.getComputedStyle(containerRef.current).getPropertyValue("--spectrum-colorwheel-track-thickness");
308
+ if (thickness) setWheelThickness(parseInt(thickness, 10));
309
+ }
310
+ }, [
311
+ containerRef,
312
+ setWheelRadius,
313
+ setWheelThickness
314
+ ]);
315
+ (0, $aAzec$react.useEffect)(()=>{
316
+ // the size observer's fallback to the window resize event doesn't fire on mount
317
+ if (wheelRadius === 0) resizeHandler();
318
+ }, [
319
+ wheelRadius,
320
+ resizeHandler
321
+ ]);
322
+ (0, $aAzec$reactariautils.useResizeObserver)({
323
+ ref: containerRef,
324
+ onResize: resizeHandler
325
+ });
326
+ let state = (0, $aAzec$reactstatelycolor.useColorWheelState)(props);
327
+ let { trackProps: trackProps , inputProps: inputProps , thumbProps: thumbProps } = (0, $aAzec$reactariacolor.useColorWheel)({
328
+ ...props,
329
+ innerRadius: wheelRadius - wheelThickness,
330
+ outerRadius: wheelRadius
331
+ }, state, inputRef);
332
+ let { focusProps: focusProps , isFocusVisible: isFocusVisible } = (0, $aAzec$reactariafocus.useFocusRing)();
333
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("div", {
334
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fc6b1a2f4e7f682$exports))), "spectrum-ColorWheel", {
335
+ "is-disabled": isDisabled
336
+ }, styleProps.className),
337
+ ref: containerRef,
338
+ style: {
339
+ ...styleProps.style,
340
+ // Workaround around https://github.com/adobe/spectrum-css/issues/1032
341
+ // @ts-ignore
342
+ "width": size,
343
+ "height": size
344
+ }
345
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("div", {
346
+ ...trackProps,
347
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fc6b1a2f4e7f682$exports))), "spectrum-ColorWheel-gradient")
348
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement((0, $2b9adc23f6c7cae1$export$a3cc47cee1c1ccc), {
349
+ value: state.getDisplayColor(),
350
+ isFocused: isFocusVisible,
351
+ isDisabled: isDisabled,
352
+ isDragging: state.isDragging,
353
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fc6b1a2f4e7f682$exports))), "spectrum-ColorWheel-handle"),
354
+ ...thumbProps
355
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("input", {
356
+ ...focusProps,
357
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($8fc6b1a2f4e7f682$exports))), "spectrum-ColorWheel-slider"),
358
+ ...inputProps,
359
+ ref: inputRef
360
+ })));
248
361
  }
249
362
  /**
250
363
  * ColorWheels allow users to adjust the hue of an HSL or HSB color value on a circular track.
251
- */
252
-
253
-
254
- let ColorWheel = /*#__PURE__*/_react.forwardRef($c78a3286fdf083d3611a04f1cfbd186e$var$ColorWheel);
255
-
256
- exports.ColorWheel = ColorWheel;
257
- // ASSET: /Users/govett/dev/react-spectrum-v3/node_modules/@adobe/spectrum-css-temp/components/colorslider/vars.css
258
- var $af343c9aea50f8d58d87012145d$exports = {};
259
- $af343c9aea50f8d58d87012145d$exports = {
260
- "spectrum-ColorSlider": "_spectrum-ColorSlider_5a55e",
261
- "is-focused": "_is-focused_5a55e",
262
- "spectrum-ColorSlider-handle": "_spectrum-ColorSlider-handle_5a55e",
263
- "spectrum-ColorSlider-slider": "_spectrum-ColorSlider-slider_5a55e",
264
- "spectrum-ColorSlider-container--horizontal": "_spectrum-ColorSlider-container--horizontal_5a55e",
265
- "spectrum-ColorSlider-container--vertical": "_spectrum-ColorSlider-container--vertical_5a55e",
266
- "is-disabled": "_is-disabled_5a55e",
267
- "spectrum-ColorSlider--vertical": "_spectrum-ColorSlider--vertical_5a55e"
268
- };
269
- var $af343c9aea50f8d58d87012145d$$interop$default = $parcel$interopDefault($af343c9aea50f8d58d87012145d$exports);
270
-
271
- function $fb4f131139da532ca621e724fdbef3c$var$ColorSlider(props, ref) {
272
- props = useProviderProps(props);
273
- let {
274
- isDisabled,
275
- channel,
276
- orientation,
277
- label,
278
- showValueLabel,
279
- 'aria-label': ariaLabel
280
- } = props;
281
- let vertical = orientation === 'vertical';
282
- let {
283
- styleProps
284
- } = useStyleProps(props);
285
- let {
286
- locale
287
- } = useLocale();
288
- let inputRef = useRef();
289
- let trackRef = useRef();
290
- let domRef = useFocusableRef(ref, inputRef);
291
- let state = useColorSliderState(_babelRuntimeHelpersExtends({}, props, {
292
- locale
293
- })); // If vertical and a label is provided, use it as an aria-label instead.
294
-
295
- if (vertical && label) {
296
- ariaLabel = ariaLabel || (typeof label === 'string' ? label : null);
297
- label = null;
298
- } // If no external label, aria-label or aria-labelledby is provided,
299
- // default to displaying the localized channel value.
300
- // Specifically check if label is undefined. If label is `null` then display no visible label.
301
- // A default aria-label is provided by useColorSlider in that case.
302
-
303
-
304
- if (label === undefined && !ariaLabel && !props['aria-labelledby'] && !vertical) {
305
- label = state.value.getChannelName(channel, locale);
306
- } // Show the value label by default if there is a visible label
307
-
308
-
309
- if (showValueLabel == null) {
310
- showValueLabel = !!label;
311
- }
312
-
313
- let {
314
- inputProps,
315
- thumbProps,
316
- trackProps,
317
- labelProps,
318
- outputProps
319
- } = useColorSlider(_babelRuntimeHelpersExtends({}, props, {
320
- label,
321
- 'aria-label': ariaLabel,
322
- trackRef,
323
- inputRef
324
- }), state);
325
- let {
326
- isFocusVisible
327
- } = useFocusVisible();
328
- let [isFocused, setIsFocused] = useState(false);
329
- let {
330
- focusProps
331
- } = useFocus({
332
- isDisabled,
333
- onFocusChange: setIsFocused
334
- });
335
- let alignLabel;
336
-
337
- if (vertical) {
338
- alignLabel = 'center';
339
- } else if (label != null && showValueLabel) {
340
- alignLabel = 'space-between';
341
- } else if (label != null) {
342
- alignLabel = 'flex-start';
343
- } else if (showValueLabel) {
344
- alignLabel = 'flex-end';
345
- }
346
-
347
- return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersExtends({
348
- ref: domRef
349
- }, styleProps, {
350
- className: classNames($af343c9aea50f8d58d87012145d$$interop$default, {
351
- 'spectrum-ColorSlider-container--horizontal': !vertical,
352
- 'spectrum-ColorSlider-container--vertical': vertical
353
- })
354
- }), label && /*#__PURE__*/_react.createElement(Flex, {
355
- direction: "row",
356
- justifyContent: alignLabel
357
- }, /*#__PURE__*/_react.createElement(Label, labelProps, label), showValueLabel && /*#__PURE__*/_react.createElement(Label, {
358
- elementType: "span"
359
- }, /*#__PURE__*/_react.createElement("output", outputProps, state.value.formatChannelValue(channel, locale)))), /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersExtends({}, trackProps, {
360
- ref: trackRef,
361
- className: classNames($af343c9aea50f8d58d87012145d$$interop$default, 'spectrum-ColorSlider', {
362
- 'is-disabled': isDisabled,
363
- 'spectrum-ColorSlider--vertical': vertical
364
- })
365
- }), /*#__PURE__*/_react.createElement($f1039d797e7720d032e7ae6b6b3355b$export$ColorThumb, _babelRuntimeHelpersExtends({
366
- value: state.getDisplayColor(),
367
- isFocused: isFocused && isFocusVisible,
368
- isDisabled: isDisabled,
369
- isDragging: state.isThumbDragging(0),
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
- })))));
364
+ */ let $63a2864687444ae1$export$f80663f808113381 = /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).forwardRef($63a2864687444ae1$var$ColorWheel);
365
+
366
+
367
+ /*
368
+ * Copyright 2020 Adobe. All rights reserved.
369
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
370
+ * you may not use this file except in compliance with the License. You may obtain a copy
371
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
372
+ *
373
+ * Unless required by applicable law or agreed to in writing, software distributed under
374
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
375
+ * OF ANY KIND, either express or implied. See the License for the specific language
376
+ * governing permissions and limitations under the License.
377
+ */
378
+
379
+
380
+
381
+ var $28060baf29cc5ac7$exports = {};
382
+
383
+ $parcel$export($28060baf29cc5ac7$exports, "spectrum-ColorSlider", () => $28060baf29cc5ac7$export$a5f8b0989b27a604, (v) => $28060baf29cc5ac7$export$a5f8b0989b27a604 = v);
384
+ $parcel$export($28060baf29cc5ac7$exports, "is-focused", () => $28060baf29cc5ac7$export$e7dc768d35940237, (v) => $28060baf29cc5ac7$export$e7dc768d35940237 = v);
385
+ $parcel$export($28060baf29cc5ac7$exports, "spectrum-ColorSlider-handle", () => $28060baf29cc5ac7$export$8c273ba92fabe1f1, (v) => $28060baf29cc5ac7$export$8c273ba92fabe1f1 = v);
386
+ $parcel$export($28060baf29cc5ac7$exports, "spectrum-ColorSlider-slider", () => $28060baf29cc5ac7$export$2f08b72944af536, (v) => $28060baf29cc5ac7$export$2f08b72944af536 = v);
387
+ $parcel$export($28060baf29cc5ac7$exports, "spectrum-ColorSlider-container--horizontal", () => $28060baf29cc5ac7$export$33e97914f6746614, (v) => $28060baf29cc5ac7$export$33e97914f6746614 = v);
388
+ $parcel$export($28060baf29cc5ac7$exports, "spectrum-ColorSlider-container--vertical", () => $28060baf29cc5ac7$export$cd1c093289104c66, (v) => $28060baf29cc5ac7$export$cd1c093289104c66 = v);
389
+ $parcel$export($28060baf29cc5ac7$exports, "is-disabled", () => $28060baf29cc5ac7$export$d35bc1e505d1ebbf, (v) => $28060baf29cc5ac7$export$d35bc1e505d1ebbf = v);
390
+ $parcel$export($28060baf29cc5ac7$exports, "spectrum-ColorSlider--vertical", () => $28060baf29cc5ac7$export$83dcf61b398bfaf1, (v) => $28060baf29cc5ac7$export$83dcf61b398bfaf1 = v);
391
+ $parcel$export($28060baf29cc5ac7$exports, "spectrum-ColorSlider-labelContainer", () => $28060baf29cc5ac7$export$65139e62047f0361, (v) => $28060baf29cc5ac7$export$65139e62047f0361 = v);
392
+ $parcel$export($28060baf29cc5ac7$exports, "spectrum-ColorSlider-contextualHelp", () => $28060baf29cc5ac7$export$26ffe4cf5a5aa53c, (v) => $28060baf29cc5ac7$export$26ffe4cf5a5aa53c = v);
393
+ $parcel$export($28060baf29cc5ac7$exports, "spectrum-ColorSlider-valueLabel", () => $28060baf29cc5ac7$export$c2fbec5a538c1f81, (v) => $28060baf29cc5ac7$export$c2fbec5a538c1f81 = v);
394
+ var $28060baf29cc5ac7$export$a5f8b0989b27a604;
395
+ var $28060baf29cc5ac7$export$e7dc768d35940237;
396
+ var $28060baf29cc5ac7$export$8c273ba92fabe1f1;
397
+ var $28060baf29cc5ac7$export$2f08b72944af536;
398
+ var $28060baf29cc5ac7$export$33e97914f6746614;
399
+ var $28060baf29cc5ac7$export$cd1c093289104c66;
400
+ var $28060baf29cc5ac7$export$d35bc1e505d1ebbf;
401
+ var $28060baf29cc5ac7$export$83dcf61b398bfaf1;
402
+ var $28060baf29cc5ac7$export$65139e62047f0361;
403
+ var $28060baf29cc5ac7$export$26ffe4cf5a5aa53c;
404
+ var $28060baf29cc5ac7$export$c2fbec5a538c1f81;
405
+ $28060baf29cc5ac7$export$a5f8b0989b27a604 = "spectrum-ColorSlider_a5bb06";
406
+ $28060baf29cc5ac7$export$e7dc768d35940237 = "is-focused_a5bb06";
407
+ $28060baf29cc5ac7$export$8c273ba92fabe1f1 = "spectrum-ColorSlider-handle_a5bb06";
408
+ $28060baf29cc5ac7$export$2f08b72944af536 = "spectrum-ColorSlider-slider_a5bb06";
409
+ $28060baf29cc5ac7$export$33e97914f6746614 = "spectrum-ColorSlider-container--horizontal_a5bb06";
410
+ $28060baf29cc5ac7$export$cd1c093289104c66 = "spectrum-ColorSlider-container--vertical_a5bb06";
411
+ $28060baf29cc5ac7$export$d35bc1e505d1ebbf = "is-disabled_a5bb06";
412
+ $28060baf29cc5ac7$export$83dcf61b398bfaf1 = "spectrum-ColorSlider--vertical_a5bb06";
413
+ $28060baf29cc5ac7$export$65139e62047f0361 = "spectrum-ColorSlider-labelContainer_a5bb06";
414
+ $28060baf29cc5ac7$export$26ffe4cf5a5aa53c = "spectrum-ColorSlider-contextualHelp_a5bb06";
415
+ $28060baf29cc5ac7$export$c2fbec5a538c1f81 = "spectrum-ColorSlider-valueLabel_a5bb06";
416
+
417
+
418
+
419
+
420
+
421
+
422
+
423
+ function $4537dec0de08c277$var$ColorSlider(props, ref) {
424
+ props = (0, $aAzec$reactspectrumprovider.useProviderProps)(props);
425
+ let { isDisabled: isDisabled , channel: channel , orientation: orientation , label: label , showValueLabel: showValueLabel , "aria-label": ariaLabel } = props;
426
+ let vertical = orientation === "vertical";
427
+ let { styleProps: styleProps } = (0, $aAzec$reactspectrumutils.useStyleProps)(props);
428
+ let { locale: locale } = (0, $aAzec$reactariai18n.useLocale)();
429
+ let inputRef = (0, $aAzec$react.useRef)(null);
430
+ let trackRef = (0, $aAzec$react.useRef)(null);
431
+ let domRef = (0, $aAzec$reactspectrumutils.useFocusableRef)(ref, inputRef);
432
+ let state = (0, $aAzec$reactstatelycolor.useColorSliderState)({
433
+ ...props,
434
+ locale: locale
435
+ });
436
+ // If vertical and a label is provided, use it as an aria-label instead.
437
+ if (vertical && label) {
438
+ ariaLabel = ariaLabel || (typeof label === "string" ? label : undefined);
439
+ label = null;
440
+ }
441
+ // If no external label, aria-label or aria-labelledby is provided,
442
+ // default to displaying the localized channel value.
443
+ // Specifically check if label is undefined. If label is `null` then display no visible label.
444
+ // A default aria-label is provided by useColorSlider in that case.
445
+ if (label === undefined && !ariaLabel && !props["aria-labelledby"] && !vertical) label = state.value.getChannelName(channel, locale);
446
+ // Show the value label by default if there is a visible label
447
+ if (showValueLabel == null) showValueLabel = !!label;
448
+ let { inputProps: inputProps , thumbProps: thumbProps , trackProps: trackProps , labelProps: labelProps , outputProps: outputProps } = (0, $aAzec$reactariacolor.useColorSlider)({
449
+ ...props,
450
+ label: label,
451
+ "aria-label": ariaLabel,
452
+ trackRef: trackRef,
453
+ inputRef: inputRef
454
+ }, state);
455
+ let { isFocusVisible: isFocusVisible } = (0, $aAzec$reactariainteractions.useFocusVisible)();
456
+ let [isFocused, setIsFocused] = (0, $aAzec$react.useState)(false);
457
+ let { focusProps: focusProps } = (0, $aAzec$reactariainteractions.useFocus)({
458
+ isDisabled: isDisabled,
459
+ onFocusChange: setIsFocused
460
+ });
461
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("div", {
462
+ ref: domRef,
463
+ ...styleProps,
464
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($28060baf29cc5ac7$exports))), {
465
+ "spectrum-ColorSlider-container--horizontal": !vertical,
466
+ "spectrum-ColorSlider-container--vertical": vertical
467
+ })
468
+ }, label && /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("div", {
469
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($28060baf29cc5ac7$exports))), "spectrum-ColorSlider-labelContainer")
470
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement((0, $aAzec$reactspectrumlabel.Label), labelProps, label), props.contextualHelp && /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement((0, $aAzec$reactspectrumutils.SlotProvider), {
471
+ slots: {
472
+ actionButton: {
473
+ UNSAFE_className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($28060baf29cc5ac7$exports))), "spectrum-ColorSlider-contextualHelp")
474
+ }
475
+ }
476
+ }, props.contextualHelp), showValueLabel && /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement((0, $aAzec$reactspectrumlabel.Label), {
477
+ elementType: "span",
478
+ UNSAFE_className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($28060baf29cc5ac7$exports))), "spectrum-ColorSlider-valueLabel")
479
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("output", outputProps, state.value.formatChannelValue(channel, locale)))), /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("div", {
480
+ ...trackProps,
481
+ ref: trackRef,
482
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($28060baf29cc5ac7$exports))), "spectrum-ColorSlider", {
483
+ "is-disabled": isDisabled,
484
+ "spectrum-ColorSlider--vertical": vertical
485
+ })
486
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement((0, $2b9adc23f6c7cae1$export$a3cc47cee1c1ccc), {
487
+ value: state.getDisplayColor(),
488
+ isFocused: isFocused && isFocusVisible,
489
+ isDisabled: isDisabled,
490
+ isDragging: state.isThumbDragging(0),
491
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($28060baf29cc5ac7$exports))), "spectrum-ColorSlider-handle"),
492
+ ...thumbProps
493
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement("input", {
494
+ ...inputProps,
495
+ ...focusProps,
496
+ ref: inputRef,
497
+ className: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($28060baf29cc5ac7$exports))), "spectrum-ColorSlider-slider")
498
+ }))));
375
499
  }
376
500
  /**
377
501
  * ColorSliders allow users to adjust an individual channel of a color value.
378
- */
379
-
380
-
381
- let ColorSlider = /*#__PURE__*/_react.forwardRef($fb4f131139da532ca621e724fdbef3c$var$ColorSlider);
382
-
383
- exports.ColorSlider = ColorSlider;
384
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/color/src/colorfield.css
385
- var $b08711e3115a699593427293c2e01ba$exports = {};
386
- $b08711e3115a699593427293c2e01ba$exports = {
387
- "react-spectrum-ColorField-input": "_react-spectrum-ColorField-input_4e4c4"
388
- };
389
- var $b08711e3115a699593427293c2e01ba$$interop$default = $parcel$interopDefault($b08711e3115a699593427293c2e01ba$exports);
390
-
391
- function $b25d8991f57211cb8e429d74bf3d19f7$var$ColorField(props, ref) {
392
- props = useProviderProps(props);
393
-
394
- let otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["value", "defaultValue", "onChange"]);
395
-
396
- let state = useColorFieldState(props);
397
- let inputRef = useRef();
398
- let {
399
- labelProps,
400
- inputProps
401
- } = useColorField(otherProps, state, inputRef);
402
- return /*#__PURE__*/_react.createElement(TextFieldBase, _babelRuntimeHelpersExtends({}, otherProps, {
403
- ref: ref,
404
- inputRef: inputRef,
405
- labelProps: labelProps,
406
- inputProps: inputProps,
407
- inputClassName: classNames($b08711e3115a699593427293c2e01ba$$interop$default, 'react-spectrum-ColorField-input')
408
- }));
502
+ */ let $4537dec0de08c277$export$44fd664bcca5b6fb = /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).forwardRef($4537dec0de08c277$var$ColorSlider);
503
+
504
+
505
+ /*
506
+ * Copyright 2020 Adobe. All rights reserved.
507
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
508
+ * you may not use this file except in compliance with the License. You may obtain a copy
509
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
510
+ *
511
+ * Unless required by applicable law or agreed to in writing, software distributed under
512
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
513
+ * OF ANY KIND, either express or implied. See the License for the specific language
514
+ * governing permissions and limitations under the License.
515
+ */
516
+
517
+ var $ddec4d6aa21146c4$exports = {};
518
+
519
+ $parcel$export($ddec4d6aa21146c4$exports, "react-spectrum-ColorField-input", () => $ddec4d6aa21146c4$export$7d80c6630a750b1, (v) => $ddec4d6aa21146c4$export$7d80c6630a750b1 = v);
520
+ var $ddec4d6aa21146c4$export$7d80c6630a750b1;
521
+ $ddec4d6aa21146c4$export$7d80c6630a750b1 = "react-spectrum-ColorField-input_7bde3a";
522
+
523
+
524
+
525
+
526
+
527
+
528
+ function $8bdb9bc27ff3debb$var$ColorField(props, ref) {
529
+ props = (0, $aAzec$reactspectrumprovider.useProviderProps)(props);
530
+ let { value: // These disabled props are handled by the state hook
531
+ value , defaultValue: defaultValue , onChange: onChange , ...otherProps } = props;
532
+ let state = (0, $aAzec$reactstatelycolor.useColorFieldState)(props);
533
+ let inputRef = (0, $aAzec$react.useRef)(null);
534
+ let { labelProps: labelProps , inputProps: inputProps } = (0, $aAzec$reactariacolor.useColorField)(otherProps, state, inputRef);
535
+ if (props.placeholder) console.warn("Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text");
536
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).createElement((0, $aAzec$reactspectrumtextfield.TextFieldBase), {
537
+ ...otherProps,
538
+ ref: ref,
539
+ inputRef: inputRef,
540
+ labelProps: labelProps,
541
+ inputProps: inputProps,
542
+ inputClassName: (0, $aAzec$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ddec4d6aa21146c4$exports))), "react-spectrum-ColorField-input")
543
+ });
409
544
  }
410
545
  /**
411
546
  * ColorFields allow users to enter a color in #rrggbb hexadecimal format.
412
- */
547
+ */ const $8bdb9bc27ff3debb$export$b865d4358897bb17 = /*#__PURE__*/ (0, ($parcel$interopDefault($aAzec$react))).forwardRef($8bdb9bc27ff3debb$var$ColorField);
548
+
413
549
 
414
550
 
415
- const ColorField = /*#__PURE__*/_react.forwardRef($b25d8991f57211cb8e429d74bf3d19f7$var$ColorField);
416
551
 
417
- exports.ColorField = ColorField;
418
552
  //# sourceMappingURL=main.js.map