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