@react-spectrum/color 3.0.0-beta.6 → 3.0.0-beta.9

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/module.js CHANGED
@@ -1,358 +1,586 @@
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 $kF0Zw$dimensionValue, useStyleProps as $kF0Zw$useStyleProps, useFocusableRef as $kF0Zw$useFocusableRef, classNames as $kF0Zw$classNames} from "@react-spectrum/utils";
3
+ import {mergeProps as $kF0Zw$mergeProps, useId as $kF0Zw$useId, useResizeObserver as $kF0Zw$useResizeObserver} from "@react-aria/utils";
4
+ import $kF0Zw$react, {useRef as $kF0Zw$useRef, useState as $kF0Zw$useState, useCallback as $kF0Zw$useCallback, useEffect as $kF0Zw$useEffect} from "react";
5
+ import {useColorArea as $kF0Zw$useColorArea, useColorWheel as $kF0Zw$useColorWheel, useColorSlider as $kF0Zw$useColorSlider, useColorField as $kF0Zw$useColorField} from "@react-aria/color";
6
+ import {useColorAreaState as $kF0Zw$useColorAreaState, useColorWheelState as $kF0Zw$useColorWheelState, useColorSliderState as $kF0Zw$useColorSliderState, useColorFieldState as $kF0Zw$useColorFieldState} from "@react-stately/color";
7
+ import {useFocusRing as $kF0Zw$useFocusRing} from "@react-aria/focus";
8
+ import {useLocale as $kF0Zw$useLocale} from "@react-aria/i18n";
9
+ import {useProviderProps as $kF0Zw$useProviderProps} from "@react-spectrum/provider";
10
+ import {Flex as $kF0Zw$Flex} from "@react-spectrum/layout";
11
+ import {Label as $kF0Zw$Label} from "@react-spectrum/label";
12
+ import {useFocusVisible as $kF0Zw$useFocusVisible, useFocus as $kF0Zw$useFocus} from "@react-aria/interactions";
13
+ import {TextFieldBase as $kF0Zw$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 $40046aa1a7ccb226$exports = {};
20
22
 
21
- // ASSET: /Users/govett/Downloads/react-spectrum-release/node_modules/@adobe/spectrum-css-temp/components/colorhandle/vars.css
22
- var $c1d45c9efa4321d2caaabcad$exports = {};
23
- $c1d45c9efa4321d2caaabcad$exports = {
24
- "spectrum-ColorHandle": "_spectrum-ColorHandle_90b59",
25
- "is-focused": "_is-focused_90b59",
26
- "focus-ring": "_focus-ring_90b59",
27
- "is-disabled": "_is-disabled_90b59",
28
- "spectrum-ColorHandle-color": "_spectrum-ColorHandle-color_90b59"
29
- };
30
- // ASSET: /Users/govett/Downloads/react-spectrum-release/node_modules/@adobe/spectrum-css-temp/components/colorloupe/vars.css
31
- var $ec92b82bdbd68020936817f8c4e6c2a$exports = {};
32
- $ec92b82bdbd68020936817f8c4e6c2a$exports = {
33
- "spectrum-ColorLoupe": "_spectrum-ColorLoupe_b3834",
34
- "is-open": "_is-open_b3834",
35
- "spectrum-ColorLoupe-outer": "_spectrum-ColorLoupe-outer_b3834",
36
- "spectrum-ColorLoupe-inner-background": "_spectrum-ColorLoupe-inner-background_b3834",
37
- "spectrum-ColorLoupe-inner-checker": "_spectrum-ColorLoupe-inner-checker_b3834"
38
- };
39
- var $c1d45c9efa4321d2caaabcad$$interop$default = $parcel$interopDefault($c1d45c9efa4321d2caaabcad$exports);
40
- var $ec92b82bdbd68020936817f8c4e6c2a$$interop$default = $parcel$interopDefault($ec92b82bdbd68020936817f8c4e6c2a$exports);
41
-
42
- function $cdd8663043560cec63b4e230ec6e9f1$export$ColorThumb(props) {
43
- let {
44
- value,
45
- isDisabled,
46
- isDragging,
47
- isFocused,
48
- children,
49
- className = ''
50
- } = props,
51
- otherProps = _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose(props, ["value", "isDisabled", "isDragging", "isFocused", "children", "className"]);
52
-
53
- let patternId = useId();
54
- let valueCSS = value.toString('css');
55
- return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersEsmExtends({
56
- className: classNames($c1d45c9efa4321d2caaabcad$$interop$default, 'spectrum-ColorHandle', {
57
- 'is-focused': isFocused,
58
- 'is-disabled': isDisabled
59
- }) + ' ' + className
60
- }, otherProps), /*#__PURE__*/_react.createElement("div", {
61
- className: classNames($c1d45c9efa4321d2caaabcad$$interop$default, 'spectrum-ColorHandle-color'),
62
- style: {
63
- backgroundColor: valueCSS
64
- }
65
- }), /*#__PURE__*/_react.createElement("svg", {
66
- className: classNames($ec92b82bdbd68020936817f8c4e6c2a$$interop$default, 'spectrum-ColorLoupe', {
67
- 'is-open': isDragging
68
- }),
69
- "aria-hidden": "true"
70
- }, /*#__PURE__*/_react.createElement("pattern", {
71
- id: patternId,
72
- x: "0",
73
- y: "0",
74
- width: "16",
75
- height: "16",
76
- patternUnits: "userSpaceOnUse"
77
- }, /*#__PURE__*/_react.createElement("rect", {
78
- className: classNames($ec92b82bdbd68020936817f8c4e6c2a$$interop$default, 'spectrum-ColorLoupe-inner-background'),
79
- x: "0",
80
- y: "0",
81
- width: "16",
82
- height: "16"
83
- }), /*#__PURE__*/_react.createElement("rect", {
84
- className: classNames($ec92b82bdbd68020936817f8c4e6c2a$$interop$default, 'spectrum-ColorLoupe-inner-checker'),
85
- x: "0",
86
- y: "0",
87
- width: "8",
88
- height: "8"
89
- }), /*#__PURE__*/_react.createElement("rect", {
90
- className: classNames($ec92b82bdbd68020936817f8c4e6c2a$$interop$default, 'spectrum-ColorLoupe-inner-checker'),
91
- x: "8",
92
- y: "8",
93
- width: "8",
94
- height: "8"
95
- })), /*#__PURE__*/_react.createElement("path", {
96
- className: classNames($ec92b82bdbd68020936817f8c4e6c2a$$interop$default, 'spectrum-ColorLoupe-inner'),
97
- d: "M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z",
98
- fill: "url(#" + patternId + ")"
99
- }), /*#__PURE__*/_react.createElement("path", {
100
- className: classNames($ec92b82bdbd68020936817f8c4e6c2a$$interop$default, 'spectrum-ColorLoupe-inner'),
101
- d: "M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z",
102
- fill: valueCSS
103
- }), /*#__PURE__*/_react.createElement("path", {
104
- className: classNames($ec92b82bdbd68020936817f8c4e6c2a$$interop$default, 'spectrum-ColorLoupe-outer'),
105
- 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"
106
- })), children);
23
+ $parcel$export($40046aa1a7ccb226$exports, "ColorArea", () => $40046aa1a7ccb226$export$b2103f68a961418e);
24
+
25
+
26
+
27
+ var $9d103974e3e19727$exports = {};
28
+
29
+ $parcel$export($9d103974e3e19727$exports, "spectrum-ColorHandle", () => $9d103974e3e19727$export$cd9afaa621b6216f, (v) => $9d103974e3e19727$export$cd9afaa621b6216f = v);
30
+ $parcel$export($9d103974e3e19727$exports, "is-focused", () => $9d103974e3e19727$export$e7dc768d35940237, (v) => $9d103974e3e19727$export$e7dc768d35940237 = v);
31
+ $parcel$export($9d103974e3e19727$exports, "focus-ring", () => $9d103974e3e19727$export$f39a09f249340e2a, (v) => $9d103974e3e19727$export$f39a09f249340e2a = v);
32
+ $parcel$export($9d103974e3e19727$exports, "is-disabled", () => $9d103974e3e19727$export$d35bc1e505d1ebbf, (v) => $9d103974e3e19727$export$d35bc1e505d1ebbf = v);
33
+ $parcel$export($9d103974e3e19727$exports, "spectrum-ColorHandle-color", () => $9d103974e3e19727$export$afe4c366ed4e659c, (v) => $9d103974e3e19727$export$afe4c366ed4e659c = v);
34
+ var $9d103974e3e19727$export$cd9afaa621b6216f;
35
+ var $9d103974e3e19727$export$e7dc768d35940237;
36
+ var $9d103974e3e19727$export$f39a09f249340e2a;
37
+ var $9d103974e3e19727$export$d35bc1e505d1ebbf;
38
+ var $9d103974e3e19727$export$afe4c366ed4e659c;
39
+ $9d103974e3e19727$export$cd9afaa621b6216f = "spectrum-ColorHandle_5a9f41";
40
+ $9d103974e3e19727$export$e7dc768d35940237 = "is-focused_5a9f41";
41
+ $9d103974e3e19727$export$f39a09f249340e2a = "focus-ring_5a9f41";
42
+ $9d103974e3e19727$export$d35bc1e505d1ebbf = "is-disabled_5a9f41";
43
+ $9d103974e3e19727$export$afe4c366ed4e659c = "spectrum-ColorHandle-color_5a9f41";
44
+
45
+
46
+ var $f3cdcbdb4b87f010$exports = {};
47
+
48
+ $parcel$export($f3cdcbdb4b87f010$exports, "spectrum-ColorLoupe", () => $f3cdcbdb4b87f010$export$88d6ed2576b21809, (v) => $f3cdcbdb4b87f010$export$88d6ed2576b21809 = v);
49
+ $parcel$export($f3cdcbdb4b87f010$exports, "is-open", () => $f3cdcbdb4b87f010$export$a9781837241c946d, (v) => $f3cdcbdb4b87f010$export$a9781837241c946d = v);
50
+ $parcel$export($f3cdcbdb4b87f010$exports, "spectrum-ColorLoupe-outer", () => $f3cdcbdb4b87f010$export$d6ad38291e8aca9c, (v) => $f3cdcbdb4b87f010$export$d6ad38291e8aca9c = v);
51
+ $parcel$export($f3cdcbdb4b87f010$exports, "spectrum-ColorLoupe-inner-background", () => $f3cdcbdb4b87f010$export$397af82b48750fe5, (v) => $f3cdcbdb4b87f010$export$397af82b48750fe5 = v);
52
+ $parcel$export($f3cdcbdb4b87f010$exports, "spectrum-ColorLoupe-inner-checker", () => $f3cdcbdb4b87f010$export$f9a2a02e0b271024, (v) => $f3cdcbdb4b87f010$export$f9a2a02e0b271024 = v);
53
+ var $f3cdcbdb4b87f010$export$88d6ed2576b21809;
54
+ var $f3cdcbdb4b87f010$export$a9781837241c946d;
55
+ var $f3cdcbdb4b87f010$export$d6ad38291e8aca9c;
56
+ var $f3cdcbdb4b87f010$export$397af82b48750fe5;
57
+ var $f3cdcbdb4b87f010$export$f9a2a02e0b271024;
58
+ $f3cdcbdb4b87f010$export$88d6ed2576b21809 = "spectrum-ColorLoupe_c818a8";
59
+ $f3cdcbdb4b87f010$export$a9781837241c946d = "is-open_c818a8";
60
+ $f3cdcbdb4b87f010$export$d6ad38291e8aca9c = "spectrum-ColorLoupe-outer_c818a8";
61
+ $f3cdcbdb4b87f010$export$397af82b48750fe5 = "spectrum-ColorLoupe-inner-background_c818a8";
62
+ $f3cdcbdb4b87f010$export$f9a2a02e0b271024 = "spectrum-ColorLoupe-inner-checker_c818a8";
63
+
64
+
65
+
66
+ function $3a90e89d07d7bbd5$export$a3cc47cee1c1ccc(props) {
67
+ let { value: value , isDisabled: isDisabled , isDragging: isDragging , isFocused: isFocused , children: children , className: className = '' , ...otherProps } = props;
68
+ let patternId = $kF0Zw$useId();
69
+ let valueCSS = value.toString('css');
70
+ return(/*#__PURE__*/ $kF0Zw$react.createElement("div", {
71
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($9d103974e3e19727$exports)), 'spectrum-ColorHandle', {
72
+ 'is-focused': isFocused,
73
+ 'is-disabled': isDisabled
74
+ }) + ' ' + className,
75
+ ...otherProps
76
+ }, /*#__PURE__*/ $kF0Zw$react.createElement("div", {
77
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($9d103974e3e19727$exports)), 'spectrum-ColorHandle-color'),
78
+ style: {
79
+ backgroundColor: valueCSS
80
+ }
81
+ }), /*#__PURE__*/ $kF0Zw$react.createElement("svg", {
82
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($f3cdcbdb4b87f010$exports)), 'spectrum-ColorLoupe', {
83
+ 'is-open': isDragging
84
+ }),
85
+ "aria-hidden": "true"
86
+ }, /*#__PURE__*/ $kF0Zw$react.createElement("pattern", {
87
+ id: patternId,
88
+ x: "0",
89
+ y: "0",
90
+ width: "16",
91
+ height: "16",
92
+ patternUnits: "userSpaceOnUse"
93
+ }, /*#__PURE__*/ $kF0Zw$react.createElement("rect", {
94
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($f3cdcbdb4b87f010$exports)), 'spectrum-ColorLoupe-inner-background'),
95
+ x: "0",
96
+ y: "0",
97
+ width: "16",
98
+ height: "16"
99
+ }), /*#__PURE__*/ $kF0Zw$react.createElement("rect", {
100
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($f3cdcbdb4b87f010$exports)), 'spectrum-ColorLoupe-inner-checker'),
101
+ x: "0",
102
+ y: "0",
103
+ width: "8",
104
+ height: "8"
105
+ }), /*#__PURE__*/ $kF0Zw$react.createElement("rect", {
106
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($f3cdcbdb4b87f010$exports)), 'spectrum-ColorLoupe-inner-checker'),
107
+ x: "8",
108
+ y: "8",
109
+ width: "8",
110
+ height: "8"
111
+ })), /*#__PURE__*/ $kF0Zw$react.createElement("path", {
112
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($f3cdcbdb4b87f010$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__*/ $kF0Zw$react.createElement("path", {
116
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($f3cdcbdb4b87f010$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__*/ $kF0Zw$react.createElement("path", {
120
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($f3cdcbdb4b87f010$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
- // ASSET: /Users/govett/Downloads/react-spectrum-release/node_modules/@adobe/spectrum-css-temp/components/colorwheel/vars.css
110
- var $dcd06c3755bbe1eb4ff3238a5ab59863$exports = {};
111
- $dcd06c3755bbe1eb4ff3238a5ab59863$exports = {
112
- "spectrum-ColorWheel": "_spectrum-ColorWheel_58477",
113
- "is-focused": "_is-focused_58477",
114
- "spectrum-ColorWheel-handle": "_spectrum-ColorWheel-handle_58477",
115
- "spectrum-ColorWheel-slider": "_spectrum-ColorWheel-slider_58477",
116
- "is-disabled": "_is-disabled_58477",
117
- "is-dragged": "_is-dragged_58477",
118
- "spectrum-ColorWheel-gradient": "_spectrum-ColorWheel-gradient_58477",
119
- "spectrum-ColorWheel-segment": "_spectrum-ColorWheel-segment_58477"
120
- };
121
- const $bba021f7e6d36b6853febf56a778d$var$WHEEL_THICKNESS = 24;
122
- var $dcd06c3755bbe1eb4ff3238a5ab59863$$interop$default = $parcel$interopDefault($dcd06c3755bbe1eb4ff3238a5ab59863$exports);
123
-
124
- function $bba021f7e6d36b6853febf56a778d$var$ColorWheel(props, ref) {
125
- props = useProviderProps(props);
126
- let {
127
- isDisabled
128
- } = props;
129
- let size = props.size && dimensionValue(props.size);
130
- let {
131
- styleProps
132
- } = useStyleProps(props);
133
- let inputRef = useRef(null);
134
- let containerRef = useFocusableRef(ref, inputRef);
135
- let [wheelRadius, setWheelRadius] = useState(null);
136
- let [wheelThickness, setWheelThickness] = useState($bba021f7e6d36b6853febf56a778d$var$WHEEL_THICKNESS);
137
- let resizeHandler = useCallback(() => {
138
- if (containerRef.current) {
139
- setWheelRadius(containerRef.current.offsetWidth / 2);
140
- let thickness = window.getComputedStyle(containerRef.current).getPropertyValue('--spectrum-colorwheel-track-thickness');
141
-
142
- if (thickness) {
143
- setWheelThickness(parseInt(thickness, 10));
144
- }
145
- }
146
- }, [containerRef, setWheelRadius, setWheelThickness]);
147
- useEffect(() => {
148
- // the size observer's fallback to the window resize event doesn't fire on mount
149
- if (wheelRadius == null) {
150
- resizeHandler();
125
+
126
+
127
+
128
+ var $7d12200010f0192e$exports = {};
129
+
130
+ $parcel$export($7d12200010f0192e$exports, "spectrum-ColorArea", () => $7d12200010f0192e$export$bb6257a55a3c1efc, (v) => $7d12200010f0192e$export$bb6257a55a3c1efc = v);
131
+ $parcel$export($7d12200010f0192e$exports, "is-focused", () => $7d12200010f0192e$export$e7dc768d35940237, (v) => $7d12200010f0192e$export$e7dc768d35940237 = v);
132
+ $parcel$export($7d12200010f0192e$exports, "focus-ring", () => $7d12200010f0192e$export$f39a09f249340e2a, (v) => $7d12200010f0192e$export$f39a09f249340e2a = v);
133
+ $parcel$export($7d12200010f0192e$exports, "spectrum-ColorArea-handle", () => $7d12200010f0192e$export$d8addbd273c4e00, (v) => $7d12200010f0192e$export$d8addbd273c4e00 = v);
134
+ $parcel$export($7d12200010f0192e$exports, "is-disabled", () => $7d12200010f0192e$export$d35bc1e505d1ebbf, (v) => $7d12200010f0192e$export$d35bc1e505d1ebbf = v);
135
+ $parcel$export($7d12200010f0192e$exports, "spectrum-ColorArea-gradient", () => $7d12200010f0192e$export$40686f4fcb8a9916, (v) => $7d12200010f0192e$export$40686f4fcb8a9916 = v);
136
+ $parcel$export($7d12200010f0192e$exports, "spectrum-ColorArea-slider", () => $7d12200010f0192e$export$7d727cacaa7cea1e, (v) => $7d12200010f0192e$export$7d727cacaa7cea1e = v);
137
+ $parcel$export($7d12200010f0192e$exports, "spectrum-ColorHandle-color", () => $7d12200010f0192e$export$afe4c366ed4e659c, (v) => $7d12200010f0192e$export$afe4c366ed4e659c = v);
138
+ var $7d12200010f0192e$export$bb6257a55a3c1efc;
139
+ var $7d12200010f0192e$export$e7dc768d35940237;
140
+ var $7d12200010f0192e$export$f39a09f249340e2a;
141
+ var $7d12200010f0192e$export$d8addbd273c4e00;
142
+ var $7d12200010f0192e$export$d35bc1e505d1ebbf;
143
+ var $7d12200010f0192e$export$40686f4fcb8a9916;
144
+ var $7d12200010f0192e$export$7d727cacaa7cea1e;
145
+ var $7d12200010f0192e$export$afe4c366ed4e659c;
146
+ $7d12200010f0192e$export$bb6257a55a3c1efc = "spectrum-ColorArea_35e2c0";
147
+ $7d12200010f0192e$export$e7dc768d35940237 = "is-focused_35e2c0";
148
+ $7d12200010f0192e$export$f39a09f249340e2a = "focus-ring_35e2c0";
149
+ $7d12200010f0192e$export$d8addbd273c4e00 = "spectrum-ColorArea-handle_35e2c0";
150
+ $7d12200010f0192e$export$d35bc1e505d1ebbf = "is-disabled_35e2c0";
151
+ $7d12200010f0192e$export$40686f4fcb8a9916 = "spectrum-ColorArea-gradient_35e2c0";
152
+ $7d12200010f0192e$export$7d727cacaa7cea1e = "spectrum-ColorArea-slider_35e2c0";
153
+ $7d12200010f0192e$export$afe4c366ed4e659c = "spectrum-ColorHandle-color_35e2c0";
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+ function $40046aa1a7ccb226$var$ColorArea(props, ref) {
162
+ props = $kF0Zw$useProviderProps(props);
163
+ let { isDisabled: isDisabled } = props;
164
+ let size = props.size && $kF0Zw$dimensionValue(props.size);
165
+ let { styleProps: styleProps } = $kF0Zw$useStyleProps(props);
166
+ let inputXRef = $kF0Zw$useRef();
167
+ let inputYRef = $kF0Zw$useRef();
168
+ let containerRef = $kF0Zw$useFocusableRef(ref, inputXRef);
169
+ let state = $kF0Zw$useColorAreaState(props);
170
+ let { channels: { xChannel: xChannel , zChannel: zChannel } } = state;
171
+ let { colorAreaProps: colorAreaProps , gradientProps: gradientProps , xInputProps: xInputProps , yInputProps: yInputProps , thumbProps: thumbProps } = $kF0Zw$useColorArea({
172
+ ...props,
173
+ inputXRef: inputXRef,
174
+ inputYRef: inputYRef,
175
+ containerRef: containerRef
176
+ }, state);
177
+ let { direction: direction } = $kF0Zw$useLocale();
178
+ let { colorAreaStyleProps: colorAreaStyleProps , gradientStyleProps: gradientStyleProps , thumbStyleProps: thumbStyleProps } = $40046aa1a7ccb226$var$useGradients({
179
+ direction: direction,
180
+ state: state,
181
+ xChannel: xChannel,
182
+ zChannel: zChannel,
183
+ isDisabled: props.isDisabled
184
+ });
185
+ let { focusProps: focusProps , isFocusVisible: isFocusVisible } = $kF0Zw$useFocusRing();
186
+ return(/*#__PURE__*/ $kF0Zw$react.createElement("div", {
187
+ ...colorAreaProps,
188
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($7d12200010f0192e$exports)), 'spectrum-ColorArea', {
189
+ 'is-disabled': isDisabled
190
+ }, styleProps.className),
191
+ ref: containerRef,
192
+ style: {
193
+ ...colorAreaStyleProps.style,
194
+ ...styleProps.style,
195
+ // Workaround around https://github.com/adobe/spectrum-css/issues/1032
196
+ width: size,
197
+ height: size
198
+ }
199
+ }, /*#__PURE__*/ $kF0Zw$react.createElement("div", {
200
+ ...gradientProps,
201
+ ...gradientStyleProps,
202
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($7d12200010f0192e$exports)), 'spectrum-ColorArea-gradient')
203
+ }), /*#__PURE__*/ $kF0Zw$react.createElement($3a90e89d07d7bbd5$export$a3cc47cee1c1ccc, {
204
+ value: state.getDisplayColor(),
205
+ isFocused: isFocusVisible,
206
+ isDisabled: isDisabled,
207
+ isDragging: state.isDragging,
208
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($7d12200010f0192e$exports)), 'spectrum-ColorArea-handle'),
209
+ ...thumbProps,
210
+ ...thumbStyleProps
211
+ }, /*#__PURE__*/ $kF0Zw$react.createElement("div", {
212
+ role: "presentation"
213
+ }, /*#__PURE__*/ $kF0Zw$react.createElement("input", {
214
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($7d12200010f0192e$exports)), 'spectrum-ColorArea-slider'),
215
+ ...$kF0Zw$mergeProps(xInputProps, focusProps),
216
+ ref: inputXRef
217
+ }), /*#__PURE__*/ $kF0Zw$react.createElement("input", {
218
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($7d12200010f0192e$exports)), 'spectrum-ColorArea-slider'),
219
+ ...$kF0Zw$mergeProps(yInputProps, focusProps),
220
+ ref: inputYRef
221
+ })))));
222
+ }
223
+ let $40046aa1a7ccb226$export$b2103f68a961418e = /*#__PURE__*/ $kF0Zw$react.forwardRef($40046aa1a7ccb226$var$ColorArea);
224
+ // this function looks scary, but it's actually pretty quick, just generates some strings
225
+ function $40046aa1a7ccb226$var$useGradients({ direction: direction , state: state , zChannel: zChannel , xChannel: xChannel , isDisabled: isDisabled }) {
226
+ let orientation = [
227
+ 'top',
228
+ direction === 'rtl' ? 'left' : 'right'
229
+ ];
230
+ let dir = false;
231
+ let background = {
232
+ colorAreaStyles: {
233
+ },
234
+ gradientStyles: {
235
+ }
236
+ };
237
+ let zValue = state.value.getChannelValue(zChannel);
238
+ let maskImage;
239
+ if (!isDisabled) switch(zChannel){
240
+ case 'red':
241
+ dir = xChannel === 'green';
242
+ maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, transparent, #000)`;
243
+ background.colorAreaStyles = {
244
+ /* the background represents the green channel as a linear gradient from min to max,
245
+ with the blue channel minimized, adjusted by the red channel value. */ backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(${zValue},0,0),rgb(${zValue},255,0))`
246
+ };
247
+ background.gradientStyles = {
248
+ /* the foreground represents the green channel as a linear gradient from min to max,
249
+ with the blue channel maximized, adjusted by the red channel value. */ backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(${zValue},0,255),rgb(${zValue},255,255))`,
250
+ /* the foreground gradient is masked by a perpendicular linear gradient from black to white */ 'WebkitMaskImage': maskImage,
251
+ maskImage: maskImage
252
+ };
253
+ break;
254
+ case 'green':
255
+ dir = xChannel === 'red';
256
+ maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, transparent, #000)`;
257
+ background.colorAreaStyles = {
258
+ /* the background represents the red channel as a linear gradient from min to max,
259
+ with the blue channel minimized, adjusted by the green channel value. */ backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,${zValue},0),rgb(255,${zValue},0))`
260
+ };
261
+ background.gradientStyles = {
262
+ /* the foreground represents the red channel as a linear gradient from min to max,
263
+ with the blue channel maximized, adjusted by the green channel value. */ backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,${zValue},255),rgb(255,${zValue},255))`,
264
+ /* the foreground gradient is masked by a perpendicular linear gradient from black to white */ 'WebkitMaskImage': maskImage,
265
+ maskImage: maskImage
266
+ };
267
+ break;
268
+ case 'blue':
269
+ dir = xChannel === 'red';
270
+ maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, transparent, #000)`;
271
+ background.colorAreaStyles = {
272
+ /* the background represents the red channel as a linear gradient from min to max,
273
+ with the green channel minimized, adjusted by the blue channel value. */ backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,0,${zValue}),rgb(255,0,${zValue}))`
274
+ };
275
+ background.gradientStyles = {
276
+ /* the foreground represents the red channel as a linear gradient from min to max,
277
+ with the green channel maximized, adjusted by the blue channel value. */ backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,255,${zValue}),rgb(255,255,${zValue}))`,
278
+ /* the foreground gradient is masked by a perpendicular linear gradient from black to white */ 'WebkitMaskImage': maskImage,
279
+ maskImage: maskImage
280
+ };
281
+ break;
151
282
  }
152
- }, [wheelRadius, resizeHandler]);
153
- useResizeObserver({
154
- ref: containerRef,
155
- onResize: resizeHandler
156
- });
157
- let state = useColorWheelState(props);
158
- let {
159
- trackProps,
160
- inputProps,
161
- thumbProps
162
- } = useColorWheel(_babelRuntimeHelpersEsmExtends({}, props, {
163
- innerRadius: wheelRadius - wheelThickness,
164
- outerRadius: wheelRadius
165
- }), state, inputRef);
166
- let {
167
- focusProps,
168
- isFocusVisible
169
- } = useFocusRing();
170
- return /*#__PURE__*/_react.createElement("div", {
171
- className: classNames($dcd06c3755bbe1eb4ff3238a5ab59863$$interop$default, 'spectrum-ColorWheel', {
172
- 'is-disabled': isDisabled
173
- }, styleProps.className),
174
- ref: containerRef,
175
- style: _babelRuntimeHelpersEsmExtends({}, styleProps.style, {
176
- // Workaround around https://github.com/adobe/spectrum-css/issues/1032
177
- // @ts-ignore
178
- 'width': size,
179
- 'height': size
180
- })
181
- }, /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersEsmExtends({}, trackProps, {
182
- className: classNames($dcd06c3755bbe1eb4ff3238a5ab59863$$interop$default, 'spectrum-ColorWheel-gradient')
183
- })), /*#__PURE__*/_react.createElement($cdd8663043560cec63b4e230ec6e9f1$export$ColorThumb, _babelRuntimeHelpersEsmExtends({
184
- value: state.getDisplayColor(),
185
- isFocused: isFocusVisible,
186
- isDisabled: isDisabled,
187
- isDragging: state.isDragging,
188
- className: classNames($dcd06c3755bbe1eb4ff3238a5ab59863$$interop$default, 'spectrum-ColorWheel-handle')
189
- }, thumbProps), /*#__PURE__*/_react.createElement("input", _babelRuntimeHelpersEsmExtends({}, focusProps, {
190
- className: classNames($dcd06c3755bbe1eb4ff3238a5ab59863$$interop$default, 'spectrum-ColorWheel-slider')
191
- }, inputProps, {
192
- ref: inputRef
193
- }))));
283
+ let { x: x , y: y } = state.getThumbPosition();
284
+ if (direction === 'rtl') x = 1 - x;
285
+ return {
286
+ colorAreaStyleProps: {
287
+ style: {
288
+ position: 'relative',
289
+ touchAction: 'none',
290
+ ...background.colorAreaStyles
291
+ }
292
+ },
293
+ gradientStyleProps: {
294
+ style: {
295
+ touchAction: 'none',
296
+ ...background.gradientStyles
297
+ }
298
+ },
299
+ thumbStyleProps: {
300
+ style: {
301
+ position: 'absolute',
302
+ left: `${x * 100}%`,
303
+ top: `${y * 100}%`,
304
+ transform: 'translate(0%, 0%)',
305
+ touchAction: 'none'
306
+ }
307
+ }
308
+ };
309
+ }
310
+
311
+
312
+ var $3aac1c27203f04b5$exports = {};
313
+
314
+ $parcel$export($3aac1c27203f04b5$exports, "ColorWheel", () => $3aac1c27203f04b5$export$f80663f808113381);
315
+
316
+
317
+
318
+ var $f60625fffea2b12e$exports = {};
319
+
320
+ $parcel$export($f60625fffea2b12e$exports, "spectrum-ColorWheel", () => $f60625fffea2b12e$export$b70a5ca28702fbc6, (v) => $f60625fffea2b12e$export$b70a5ca28702fbc6 = v);
321
+ $parcel$export($f60625fffea2b12e$exports, "is-focused", () => $f60625fffea2b12e$export$e7dc768d35940237, (v) => $f60625fffea2b12e$export$e7dc768d35940237 = v);
322
+ $parcel$export($f60625fffea2b12e$exports, "spectrum-ColorWheel-handle", () => $f60625fffea2b12e$export$4cd23920eb8ac056, (v) => $f60625fffea2b12e$export$4cd23920eb8ac056 = v);
323
+ $parcel$export($f60625fffea2b12e$exports, "spectrum-ColorWheel-slider", () => $f60625fffea2b12e$export$f476ddda713d62b, (v) => $f60625fffea2b12e$export$f476ddda713d62b = v);
324
+ $parcel$export($f60625fffea2b12e$exports, "is-disabled", () => $f60625fffea2b12e$export$d35bc1e505d1ebbf, (v) => $f60625fffea2b12e$export$d35bc1e505d1ebbf = v);
325
+ $parcel$export($f60625fffea2b12e$exports, "is-dragged", () => $f60625fffea2b12e$export$8778c911bed6c759, (v) => $f60625fffea2b12e$export$8778c911bed6c759 = v);
326
+ $parcel$export($f60625fffea2b12e$exports, "spectrum-ColorWheel-gradient", () => $f60625fffea2b12e$export$9afaa791d7500a9b, (v) => $f60625fffea2b12e$export$9afaa791d7500a9b = v);
327
+ $parcel$export($f60625fffea2b12e$exports, "spectrum-ColorWheel-segment", () => $f60625fffea2b12e$export$ada9fbffdaa4f10, (v) => $f60625fffea2b12e$export$ada9fbffdaa4f10 = v);
328
+ var $f60625fffea2b12e$export$b70a5ca28702fbc6;
329
+ var $f60625fffea2b12e$export$e7dc768d35940237;
330
+ var $f60625fffea2b12e$export$4cd23920eb8ac056;
331
+ var $f60625fffea2b12e$export$f476ddda713d62b;
332
+ var $f60625fffea2b12e$export$d35bc1e505d1ebbf;
333
+ var $f60625fffea2b12e$export$8778c911bed6c759;
334
+ var $f60625fffea2b12e$export$9afaa791d7500a9b;
335
+ var $f60625fffea2b12e$export$ada9fbffdaa4f10;
336
+ $f60625fffea2b12e$export$b70a5ca28702fbc6 = "spectrum-ColorWheel_31462a";
337
+ $f60625fffea2b12e$export$e7dc768d35940237 = "is-focused_31462a";
338
+ $f60625fffea2b12e$export$4cd23920eb8ac056 = "spectrum-ColorWheel-handle_31462a";
339
+ $f60625fffea2b12e$export$f476ddda713d62b = "spectrum-ColorWheel-slider_31462a";
340
+ $f60625fffea2b12e$export$d35bc1e505d1ebbf = "is-disabled_31462a";
341
+ $f60625fffea2b12e$export$8778c911bed6c759 = "is-dragged_31462a";
342
+ $f60625fffea2b12e$export$9afaa791d7500a9b = "spectrum-ColorWheel-gradient_31462a";
343
+ $f60625fffea2b12e$export$ada9fbffdaa4f10 = "spectrum-ColorWheel-segment_31462a";
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+ const $3aac1c27203f04b5$var$WHEEL_THICKNESS = 24;
352
+ function $3aac1c27203f04b5$var$ColorWheel(props, ref) {
353
+ props = $kF0Zw$useProviderProps(props);
354
+ let { isDisabled: isDisabled } = props;
355
+ let size = props.size && $kF0Zw$dimensionValue(props.size);
356
+ let { styleProps: styleProps } = $kF0Zw$useStyleProps(props);
357
+ let inputRef = $kF0Zw$useRef(null);
358
+ let containerRef = $kF0Zw$useFocusableRef(ref, inputRef);
359
+ let [wheelRadius, setWheelRadius] = $kF0Zw$useState(null);
360
+ let [wheelThickness, setWheelThickness] = $kF0Zw$useState($3aac1c27203f04b5$var$WHEEL_THICKNESS);
361
+ let resizeHandler = $kF0Zw$useCallback(()=>{
362
+ if (containerRef.current) {
363
+ setWheelRadius(containerRef.current.offsetWidth / 2);
364
+ let thickness = window.getComputedStyle(containerRef.current).getPropertyValue('--spectrum-colorwheel-track-thickness');
365
+ if (thickness) setWheelThickness(parseInt(thickness, 10));
366
+ }
367
+ }, [
368
+ containerRef,
369
+ setWheelRadius,
370
+ setWheelThickness
371
+ ]);
372
+ $kF0Zw$useEffect(()=>{
373
+ // the size observer's fallback to the window resize event doesn't fire on mount
374
+ if (wheelRadius == null) resizeHandler();
375
+ }, [
376
+ wheelRadius,
377
+ resizeHandler
378
+ ]);
379
+ $kF0Zw$useResizeObserver({
380
+ ref: containerRef,
381
+ onResize: resizeHandler
382
+ });
383
+ let state = $kF0Zw$useColorWheelState(props);
384
+ let { trackProps: trackProps , inputProps: inputProps , thumbProps: thumbProps } = $kF0Zw$useColorWheel({
385
+ ...props,
386
+ innerRadius: wheelRadius - wheelThickness,
387
+ outerRadius: wheelRadius
388
+ }, state, inputRef);
389
+ let { focusProps: focusProps , isFocusVisible: isFocusVisible } = $kF0Zw$useFocusRing();
390
+ return(/*#__PURE__*/ $kF0Zw$react.createElement("div", {
391
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($f60625fffea2b12e$exports)), 'spectrum-ColorWheel', {
392
+ 'is-disabled': isDisabled
393
+ }, styleProps.className),
394
+ ref: containerRef,
395
+ style: {
396
+ ...styleProps.style,
397
+ // Workaround around https://github.com/adobe/spectrum-css/issues/1032
398
+ // @ts-ignore
399
+ 'width': size,
400
+ 'height': size
401
+ }
402
+ }, /*#__PURE__*/ $kF0Zw$react.createElement("div", {
403
+ ...trackProps,
404
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($f60625fffea2b12e$exports)), 'spectrum-ColorWheel-gradient')
405
+ }), /*#__PURE__*/ $kF0Zw$react.createElement($3a90e89d07d7bbd5$export$a3cc47cee1c1ccc, {
406
+ value: state.getDisplayColor(),
407
+ isFocused: isFocusVisible,
408
+ isDisabled: isDisabled,
409
+ isDragging: state.isDragging,
410
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($f60625fffea2b12e$exports)), 'spectrum-ColorWheel-handle'),
411
+ ...thumbProps
412
+ }, /*#__PURE__*/ $kF0Zw$react.createElement("input", {
413
+ ...focusProps,
414
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($f60625fffea2b12e$exports)), 'spectrum-ColorWheel-slider'),
415
+ ...inputProps,
416
+ ref: inputRef
417
+ }))));
194
418
  }
195
419
  /**
196
420
  * ColorWheels allow users to adjust the hue of an HSL or HSB color value on a circular track.
197
- */
198
-
199
-
200
- export let ColorWheel = /*#__PURE__*/_react.forwardRef($bba021f7e6d36b6853febf56a778d$var$ColorWheel);
201
- // ASSET: /Users/govett/Downloads/react-spectrum-release/node_modules/@adobe/spectrum-css-temp/components/colorslider/vars.css
202
- var $d5576e4bc9a7ae94e3998a51423$exports = {};
203
- $d5576e4bc9a7ae94e3998a51423$exports = {
204
- "spectrum-ColorSlider": "_spectrum-ColorSlider_d5afb",
205
- "is-focused": "_is-focused_d5afb",
206
- "spectrum-ColorSlider-handle": "_spectrum-ColorSlider-handle_d5afb",
207
- "spectrum-ColorSlider-slider": "_spectrum-ColorSlider-slider_d5afb",
208
- "spectrum-ColorSlider-container--horizontal": "_spectrum-ColorSlider-container--horizontal_d5afb",
209
- "spectrum-ColorSlider-container--vertical": "_spectrum-ColorSlider-container--vertical_d5afb",
210
- "is-disabled": "_is-disabled_d5afb",
211
- "spectrum-ColorSlider--vertical": "_spectrum-ColorSlider--vertical_d5afb"
212
- };
213
- var $d5576e4bc9a7ae94e3998a51423$$interop$default = $parcel$interopDefault($d5576e4bc9a7ae94e3998a51423$exports);
214
-
215
- function $dbcb06f1785939ebc9c915ac7132d142$var$ColorSlider(props, ref) {
216
- props = useProviderProps(props);
217
- let {
218
- isDisabled,
219
- channel,
220
- orientation,
221
- label,
222
- showValueLabel,
223
- 'aria-label': ariaLabel
224
- } = props;
225
- let vertical = orientation === 'vertical';
226
- let {
227
- styleProps
228
- } = useStyleProps(props);
229
- let {
230
- locale
231
- } = useLocale();
232
- let inputRef = useRef();
233
- let trackRef = useRef();
234
- let domRef = useFocusableRef(ref, inputRef);
235
- let state = useColorSliderState(_babelRuntimeHelpersEsmExtends({}, props, {
236
- locale
237
- })); // If vertical and a label is provided, use it as an aria-label instead.
238
-
239
- if (vertical && label) {
240
- ariaLabel = ariaLabel || (typeof label === 'string' ? label : null);
241
- label = null;
242
- } // If no external label, aria-label or aria-labelledby is provided,
243
- // default to displaying the localized channel value.
244
- // Specifically check if label is undefined. If label is `null` then display no visible label.
245
- // A default aria-label is provided by useColorSlider in that case.
246
-
247
-
248
- if (label === undefined && !ariaLabel && !props['aria-labelledby'] && !vertical) {
249
- label = state.value.getChannelName(channel, locale);
250
- } // Show the value label by default if there is a visible label
251
-
252
-
253
- if (showValueLabel == null) {
254
- showValueLabel = !!label;
255
- }
256
-
257
- let {
258
- inputProps,
259
- thumbProps,
260
- trackProps,
261
- labelProps,
262
- outputProps
263
- } = useColorSlider(_babelRuntimeHelpersEsmExtends({}, props, {
264
- label,
265
- 'aria-label': ariaLabel,
266
- trackRef,
267
- inputRef
268
- }), state);
269
- let {
270
- isFocusVisible
271
- } = useFocusVisible();
272
- let [isFocused, setIsFocused] = useState(false);
273
- let {
274
- focusProps
275
- } = useFocus({
276
- isDisabled,
277
- onFocusChange: setIsFocused
278
- });
279
- let alignLabel;
280
-
281
- if (vertical) {
282
- alignLabel = 'center';
283
- } else if (label != null && showValueLabel) {
284
- alignLabel = 'space-between';
285
- } else if (label != null) {
286
- alignLabel = 'flex-start';
287
- } else if (showValueLabel) {
288
- alignLabel = 'flex-end';
289
- }
290
-
291
- return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersEsmExtends({
292
- ref: domRef
293
- }, styleProps, {
294
- className: classNames($d5576e4bc9a7ae94e3998a51423$$interop$default, {
295
- 'spectrum-ColorSlider-container--horizontal': !vertical,
296
- 'spectrum-ColorSlider-container--vertical': vertical
297
- })
298
- }), label && /*#__PURE__*/_react.createElement(Flex, {
299
- direction: "row",
300
- justifyContent: alignLabel
301
- }, /*#__PURE__*/_react.createElement(Label, labelProps, label), showValueLabel && /*#__PURE__*/_react.createElement(Label, {
302
- elementType: "span"
303
- }, /*#__PURE__*/_react.createElement("output", outputProps, state.value.formatChannelValue(channel, locale)))), /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersEsmExtends({}, trackProps, {
304
- ref: trackRef,
305
- className: classNames($d5576e4bc9a7ae94e3998a51423$$interop$default, 'spectrum-ColorSlider', {
306
- 'is-disabled': isDisabled,
307
- 'spectrum-ColorSlider--vertical': vertical
308
- })
309
- }), /*#__PURE__*/_react.createElement($cdd8663043560cec63b4e230ec6e9f1$export$ColorThumb, _babelRuntimeHelpersEsmExtends({
310
- value: state.getDisplayColor(),
311
- isFocused: isFocused && isFocusVisible,
312
- isDisabled: isDisabled,
313
- isDragging: state.isThumbDragging(0),
314
- className: classNames($d5576e4bc9a7ae94e3998a51423$$interop$default, 'spectrum-ColorSlider-handle')
315
- }, thumbProps), /*#__PURE__*/_react.createElement("input", _babelRuntimeHelpersEsmExtends({}, inputProps, focusProps, {
316
- ref: inputRef,
317
- className: classNames($d5576e4bc9a7ae94e3998a51423$$interop$default, 'spectrum-ColorSlider-slider')
318
- })))));
421
+ */ let $3aac1c27203f04b5$export$f80663f808113381 = /*#__PURE__*/ $kF0Zw$react.forwardRef($3aac1c27203f04b5$var$ColorWheel);
422
+
423
+
424
+ var $3870e4ce67ed7ee1$exports = {};
425
+
426
+ $parcel$export($3870e4ce67ed7ee1$exports, "ColorSlider", () => $3870e4ce67ed7ee1$export$44fd664bcca5b6fb);
427
+
428
+
429
+
430
+
431
+
432
+ var $670e80c7e5915fb5$exports = {};
433
+
434
+ $parcel$export($670e80c7e5915fb5$exports, "spectrum-ColorSlider", () => $670e80c7e5915fb5$export$a5f8b0989b27a604, (v) => $670e80c7e5915fb5$export$a5f8b0989b27a604 = v);
435
+ $parcel$export($670e80c7e5915fb5$exports, "is-focused", () => $670e80c7e5915fb5$export$e7dc768d35940237, (v) => $670e80c7e5915fb5$export$e7dc768d35940237 = v);
436
+ $parcel$export($670e80c7e5915fb5$exports, "spectrum-ColorSlider-handle", () => $670e80c7e5915fb5$export$8c273ba92fabe1f1, (v) => $670e80c7e5915fb5$export$8c273ba92fabe1f1 = v);
437
+ $parcel$export($670e80c7e5915fb5$exports, "spectrum-ColorSlider-slider", () => $670e80c7e5915fb5$export$2f08b72944af536, (v) => $670e80c7e5915fb5$export$2f08b72944af536 = v);
438
+ $parcel$export($670e80c7e5915fb5$exports, "spectrum-ColorSlider-container--horizontal", () => $670e80c7e5915fb5$export$33e97914f6746614, (v) => $670e80c7e5915fb5$export$33e97914f6746614 = v);
439
+ $parcel$export($670e80c7e5915fb5$exports, "spectrum-ColorSlider-container--vertical", () => $670e80c7e5915fb5$export$cd1c093289104c66, (v) => $670e80c7e5915fb5$export$cd1c093289104c66 = v);
440
+ $parcel$export($670e80c7e5915fb5$exports, "is-disabled", () => $670e80c7e5915fb5$export$d35bc1e505d1ebbf, (v) => $670e80c7e5915fb5$export$d35bc1e505d1ebbf = v);
441
+ $parcel$export($670e80c7e5915fb5$exports, "spectrum-ColorSlider--vertical", () => $670e80c7e5915fb5$export$83dcf61b398bfaf1, (v) => $670e80c7e5915fb5$export$83dcf61b398bfaf1 = v);
442
+ var $670e80c7e5915fb5$export$a5f8b0989b27a604;
443
+ var $670e80c7e5915fb5$export$e7dc768d35940237;
444
+ var $670e80c7e5915fb5$export$8c273ba92fabe1f1;
445
+ var $670e80c7e5915fb5$export$2f08b72944af536;
446
+ var $670e80c7e5915fb5$export$33e97914f6746614;
447
+ var $670e80c7e5915fb5$export$cd1c093289104c66;
448
+ var $670e80c7e5915fb5$export$d35bc1e505d1ebbf;
449
+ var $670e80c7e5915fb5$export$83dcf61b398bfaf1;
450
+ $670e80c7e5915fb5$export$a5f8b0989b27a604 = "spectrum-ColorSlider_a5bb06";
451
+ $670e80c7e5915fb5$export$e7dc768d35940237 = "is-focused_a5bb06";
452
+ $670e80c7e5915fb5$export$8c273ba92fabe1f1 = "spectrum-ColorSlider-handle_a5bb06";
453
+ $670e80c7e5915fb5$export$2f08b72944af536 = "spectrum-ColorSlider-slider_a5bb06";
454
+ $670e80c7e5915fb5$export$33e97914f6746614 = "spectrum-ColorSlider-container--horizontal_a5bb06";
455
+ $670e80c7e5915fb5$export$cd1c093289104c66 = "spectrum-ColorSlider-container--vertical_a5bb06";
456
+ $670e80c7e5915fb5$export$d35bc1e505d1ebbf = "is-disabled_a5bb06";
457
+ $670e80c7e5915fb5$export$83dcf61b398bfaf1 = "spectrum-ColorSlider--vertical_a5bb06";
458
+
459
+
460
+
461
+
462
+
463
+
464
+
465
+ function $3870e4ce67ed7ee1$var$ColorSlider(props, ref) {
466
+ props = $kF0Zw$useProviderProps(props);
467
+ let { isDisabled: isDisabled , channel: channel , orientation: orientation , label: label , showValueLabel: showValueLabel , 'aria-label': ariaLabel } = props;
468
+ let vertical = orientation === 'vertical';
469
+ let { styleProps: styleProps } = $kF0Zw$useStyleProps(props);
470
+ let { locale: locale } = $kF0Zw$useLocale();
471
+ let inputRef = $kF0Zw$useRef();
472
+ let trackRef = $kF0Zw$useRef();
473
+ let domRef = $kF0Zw$useFocusableRef(ref, inputRef);
474
+ let state = $kF0Zw$useColorSliderState({
475
+ ...props,
476
+ locale: locale
477
+ });
478
+ // If vertical and a label is provided, use it as an aria-label instead.
479
+ if (vertical && label) {
480
+ ariaLabel = ariaLabel || (typeof label === 'string' ? label : null);
481
+ label = null;
482
+ }
483
+ // If no external label, aria-label or aria-labelledby is provided,
484
+ // default to displaying the localized channel value.
485
+ // Specifically check if label is undefined. If label is `null` then display no visible label.
486
+ // A default aria-label is provided by useColorSlider in that case.
487
+ if (label === undefined && !ariaLabel && !props['aria-labelledby'] && !vertical) label = state.value.getChannelName(channel, locale);
488
+ // Show the value label by default if there is a visible label
489
+ if (showValueLabel == null) showValueLabel = !!label;
490
+ let { inputProps: inputProps , thumbProps: thumbProps , trackProps: trackProps , labelProps: labelProps , outputProps: outputProps } = $kF0Zw$useColorSlider({
491
+ ...props,
492
+ label: label,
493
+ 'aria-label': ariaLabel,
494
+ trackRef: trackRef,
495
+ inputRef: inputRef
496
+ }, state);
497
+ let { isFocusVisible: isFocusVisible } = $kF0Zw$useFocusVisible();
498
+ let [isFocused, setIsFocused] = $kF0Zw$useState(false);
499
+ let { focusProps: focusProps } = $kF0Zw$useFocus({
500
+ isDisabled: isDisabled,
501
+ onFocusChange: setIsFocused
502
+ });
503
+ let alignLabel;
504
+ if (vertical) alignLabel = 'center';
505
+ else if (label != null && showValueLabel) alignLabel = 'space-between';
506
+ else if (label != null) alignLabel = 'flex-start';
507
+ else if (showValueLabel) alignLabel = 'flex-end';
508
+ return(/*#__PURE__*/ $kF0Zw$react.createElement("div", {
509
+ ref: domRef,
510
+ ...styleProps,
511
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($670e80c7e5915fb5$exports)), {
512
+ 'spectrum-ColorSlider-container--horizontal': !vertical,
513
+ 'spectrum-ColorSlider-container--vertical': vertical
514
+ })
515
+ }, label && /*#__PURE__*/ $kF0Zw$react.createElement($kF0Zw$Flex, {
516
+ direction: "row",
517
+ justifyContent: alignLabel
518
+ }, /*#__PURE__*/ $kF0Zw$react.createElement($kF0Zw$Label, labelProps, label), showValueLabel && /*#__PURE__*/ $kF0Zw$react.createElement($kF0Zw$Label, {
519
+ elementType: "span"
520
+ }, /*#__PURE__*/ $kF0Zw$react.createElement("output", outputProps, state.value.formatChannelValue(channel, locale)))), /*#__PURE__*/ $kF0Zw$react.createElement("div", {
521
+ ...trackProps,
522
+ ref: trackRef,
523
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($670e80c7e5915fb5$exports)), 'spectrum-ColorSlider', {
524
+ 'is-disabled': isDisabled,
525
+ 'spectrum-ColorSlider--vertical': vertical
526
+ })
527
+ }, /*#__PURE__*/ $kF0Zw$react.createElement($3a90e89d07d7bbd5$export$a3cc47cee1c1ccc, {
528
+ value: state.getDisplayColor(),
529
+ isFocused: isFocused && isFocusVisible,
530
+ isDisabled: isDisabled,
531
+ isDragging: state.isThumbDragging(0),
532
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($670e80c7e5915fb5$exports)), 'spectrum-ColorSlider-handle'),
533
+ ...thumbProps
534
+ }, /*#__PURE__*/ $kF0Zw$react.createElement("input", {
535
+ ...inputProps,
536
+ ...focusProps,
537
+ ref: inputRef,
538
+ className: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($670e80c7e5915fb5$exports)), 'spectrum-ColorSlider-slider')
539
+ })))));
319
540
  }
320
541
  /**
321
542
  * ColorSliders allow users to adjust an individual channel of a color value.
322
- */
323
-
324
-
325
- export let ColorSlider = /*#__PURE__*/_react.forwardRef($dbcb06f1785939ebc9c915ac7132d142$var$ColorSlider);
326
- // ASSET: /Users/govett/Downloads/react-spectrum-release/packages/@react-spectrum/color/src/colorfield.css
327
- var $ef922cc9e1840d9627379bdc5921de72$exports = {};
328
- $ef922cc9e1840d9627379bdc5921de72$exports = {
329
- "react-spectrum-ColorField-input": "_react-spectrum-ColorField-input_86851"
330
- };
331
- var $ef922cc9e1840d9627379bdc5921de72$$interop$default = $parcel$interopDefault($ef922cc9e1840d9627379bdc5921de72$exports);
332
-
333
- function $ac8b2e46b71785a11f529680d01ea0$var$ColorField(props, ref) {
334
- props = useProviderProps(props);
335
-
336
- let otherProps = _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose(props, ["value", "defaultValue", "onChange"]);
337
-
338
- let state = useColorFieldState(props);
339
- let inputRef = useRef();
340
- let {
341
- labelProps,
342
- inputProps
343
- } = useColorField(otherProps, state, inputRef);
344
- return /*#__PURE__*/_react.createElement(TextFieldBase, _babelRuntimeHelpersEsmExtends({}, otherProps, {
345
- ref: ref,
346
- inputRef: inputRef,
347
- labelProps: labelProps,
348
- inputProps: inputProps,
349
- inputClassName: classNames($ef922cc9e1840d9627379bdc5921de72$$interop$default, 'react-spectrum-ColorField-input')
350
- }));
543
+ */ let $3870e4ce67ed7ee1$export$44fd664bcca5b6fb = /*#__PURE__*/ $kF0Zw$react.forwardRef($3870e4ce67ed7ee1$var$ColorSlider);
544
+
545
+
546
+ var $0077d47e004328f0$exports = {};
547
+
548
+ $parcel$export($0077d47e004328f0$exports, "ColorField", () => $0077d47e004328f0$export$b865d4358897bb17);
549
+
550
+
551
+ var $9d47b39540b9e48a$exports = {};
552
+
553
+ $parcel$export($9d47b39540b9e48a$exports, "react-spectrum-ColorField-input", () => $9d47b39540b9e48a$export$7d80c6630a750b1, (v) => $9d47b39540b9e48a$export$7d80c6630a750b1 = v);
554
+ var $9d47b39540b9e48a$export$7d80c6630a750b1;
555
+ $9d47b39540b9e48a$export$7d80c6630a750b1 = "react-spectrum-ColorField-input_7bde3a";
556
+
557
+
558
+
559
+
560
+
561
+
562
+ function $0077d47e004328f0$var$ColorField(props, ref) {
563
+ props = $kF0Zw$useProviderProps(props);
564
+ let { value: // These disabled props are handled by the state hook
565
+ value , defaultValue: defaultValue , onChange: onChange , ...otherProps } = props;
566
+ let state = $kF0Zw$useColorFieldState(props);
567
+ let inputRef = $kF0Zw$useRef();
568
+ let { labelProps: labelProps , inputProps: inputProps } = $kF0Zw$useColorField(otherProps, state, inputRef);
569
+ return(/*#__PURE__*/ $kF0Zw$react.createElement($kF0Zw$TextFieldBase, {
570
+ ...otherProps,
571
+ ref: ref,
572
+ inputRef: inputRef,
573
+ labelProps: labelProps,
574
+ inputProps: inputProps,
575
+ inputClassName: $kF0Zw$classNames((/*@__PURE__*/$parcel$interopDefault($9d47b39540b9e48a$exports)), 'react-spectrum-ColorField-input')
576
+ }));
351
577
  }
352
578
  /**
353
579
  * ColorFields allow users to enter a color in #rrggbb hexadecimal format.
354
- */
580
+ */ const $0077d47e004328f0$export$b865d4358897bb17 = /*#__PURE__*/ $kF0Zw$react.forwardRef($0077d47e004328f0$var$ColorField);
581
+
582
+
355
583
 
356
584
 
357
- export const ColorField = /*#__PURE__*/_react.forwardRef($ac8b2e46b71785a11f529680d01ea0$var$ColorField);
585
+ export {$40046aa1a7ccb226$export$b2103f68a961418e as ColorArea, $3aac1c27203f04b5$export$f80663f808113381 as ColorWheel, $3870e4ce67ed7ee1$export$44fd664bcca5b6fb as ColorSlider, $0077d47e004328f0$export$b865d4358897bb17 as ColorField};
358
586
  //# sourceMappingURL=module.js.map