@react-spectrum/color 3.0.0-beta.31 → 3.0.0-beta.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/ColorArea.main.js +98 -0
  2. package/dist/ColorArea.main.js.map +1 -0
  3. package/dist/ColorArea.mjs +93 -0
  4. package/dist/ColorArea.module.js +93 -0
  5. package/dist/ColorArea.module.js.map +1 -0
  6. package/dist/ColorEditor.32e497e8.css +20 -0
  7. package/dist/ColorEditor.32e497e8.css.map +1 -0
  8. package/dist/ColorEditor.main.js +116 -0
  9. package/dist/ColorEditor.main.js.map +1 -0
  10. package/dist/ColorEditor.mjs +111 -0
  11. package/dist/ColorEditor.module.js +111 -0
  12. package/dist/ColorEditor.module.js.map +1 -0
  13. package/dist/ColorField.main.js +99 -0
  14. package/dist/ColorField.main.js.map +1 -0
  15. package/dist/ColorField.mjs +94 -0
  16. package/dist/ColorField.module.js +94 -0
  17. package/dist/ColorField.module.js.map +1 -0
  18. package/dist/ColorPicker.ab9f47c0.css +204 -0
  19. package/dist/ColorPicker.ab9f47c0.css.map +1 -0
  20. package/dist/ColorPicker.main.js +125 -0
  21. package/dist/ColorPicker.main.js.map +1 -0
  22. package/dist/ColorPicker.mjs +116 -0
  23. package/dist/ColorPicker.module.js +116 -0
  24. package/dist/ColorPicker.module.js.map +1 -0
  25. package/dist/ColorSlider.main.js +129 -0
  26. package/dist/ColorSlider.main.js.map +1 -0
  27. package/dist/ColorSlider.mjs +124 -0
  28. package/dist/ColorSlider.module.js +124 -0
  29. package/dist/ColorSlider.module.js.map +1 -0
  30. package/dist/ColorSwatch.f6e6f811.css +260 -0
  31. package/dist/ColorSwatch.f6e6f811.css.map +1 -0
  32. package/dist/ColorSwatch.main.js +94 -0
  33. package/dist/ColorSwatch.main.js.map +1 -0
  34. package/dist/ColorSwatch.mjs +84 -0
  35. package/dist/ColorSwatch.module.js +84 -0
  36. package/dist/ColorSwatch.module.js.map +1 -0
  37. package/dist/ColorSwatchPicker.1575be06.css +356 -0
  38. package/dist/ColorSwatchPicker.1575be06.css.map +1 -0
  39. package/dist/ColorSwatchPicker.main.js +115 -0
  40. package/dist/ColorSwatchPicker.main.js.map +1 -0
  41. package/dist/ColorSwatchPicker.mjs +106 -0
  42. package/dist/ColorSwatchPicker.module.js +106 -0
  43. package/dist/ColorSwatchPicker.module.js.map +1 -0
  44. package/dist/ColorThumb.main.js +144 -0
  45. package/dist/ColorThumb.main.js.map +1 -0
  46. package/dist/ColorThumb.mjs +139 -0
  47. package/dist/ColorThumb.module.js +139 -0
  48. package/dist/ColorThumb.module.js.map +1 -0
  49. package/dist/ColorWheel.main.js +118 -0
  50. package/dist/ColorWheel.main.js.map +1 -0
  51. package/dist/ColorWheel.mjs +113 -0
  52. package/dist/ColorWheel.module.js +113 -0
  53. package/dist/ColorWheel.module.js.map +1 -0
  54. package/dist/colorarea_vars_css.main.js +29 -0
  55. package/dist/colorarea_vars_css.main.js.map +1 -0
  56. package/dist/colorarea_vars_css.mjs +31 -0
  57. package/dist/colorarea_vars_css.module.js +31 -0
  58. package/dist/colorarea_vars_css.module.js.map +1 -0
  59. package/dist/colorfield.faeff3c2.css +12 -0
  60. package/dist/colorfield.faeff3c2.css.map +1 -0
  61. package/dist/colorfield_css.main.js +11 -0
  62. package/dist/colorfield_css.main.js.map +1 -0
  63. package/dist/colorfield_css.mjs +13 -0
  64. package/dist/colorfield_css.module.js +13 -0
  65. package/dist/colorfield_css.module.js.map +1 -0
  66. package/dist/colorhandle_vars_css.main.js +26 -0
  67. package/dist/colorhandle_vars_css.main.js.map +1 -0
  68. package/dist/colorhandle_vars_css.mjs +28 -0
  69. package/dist/colorhandle_vars_css.module.js +28 -0
  70. package/dist/colorhandle_vars_css.module.js.map +1 -0
  71. package/dist/colorloupe_vars_css.main.js +23 -0
  72. package/dist/colorloupe_vars_css.main.js.map +1 -0
  73. package/dist/colorloupe_vars_css.mjs +25 -0
  74. package/dist/colorloupe_vars_css.module.js +25 -0
  75. package/dist/colorloupe_vars_css.module.js.map +1 -0
  76. package/dist/colorslider_vars_css.main.js +53 -0
  77. package/dist/colorslider_vars_css.main.js.map +1 -0
  78. package/dist/colorslider_vars_css.mjs +55 -0
  79. package/dist/colorslider_vars_css.module.js +55 -0
  80. package/dist/colorslider_vars_css.module.js.map +1 -0
  81. package/dist/colorwheel_vars_css.main.js +35 -0
  82. package/dist/colorwheel_vars_css.main.js.map +1 -0
  83. package/dist/colorwheel_vars_css.mjs +37 -0
  84. package/dist/colorwheel_vars_css.module.js +37 -0
  85. package/dist/colorwheel_vars_css.module.js.map +1 -0
  86. package/dist/en-US.main.js +10 -0
  87. package/dist/en-US.main.js.map +1 -0
  88. package/dist/en-US.mjs +12 -0
  89. package/dist/en-US.module.js +12 -0
  90. package/dist/en-US.module.js.map +1 -0
  91. package/dist/import.mjs +10 -546
  92. package/dist/intlStrings.main.js +9 -0
  93. package/dist/intlStrings.main.js.map +1 -0
  94. package/dist/intlStrings.mjs +11 -0
  95. package/dist/intlStrings.module.js +11 -0
  96. package/dist/intlStrings.module.js.map +1 -0
  97. package/dist/main.js +18 -544
  98. package/dist/main.js.map +1 -1
  99. package/dist/module.js +10 -546
  100. package/dist/module.js.map +1 -1
  101. package/dist/types.d.ts +77 -6
  102. package/dist/types.d.ts.map +1 -1
  103. package/dist/vars.53b417c1.css +75 -0
  104. package/dist/vars.53b417c1.css.map +1 -0
  105. package/dist/vars.6fa9fa04.css +93 -0
  106. package/dist/vars.6fa9fa04.css.map +1 -0
  107. package/dist/vars.aa07b6d2.css +120 -0
  108. package/dist/vars.aa07b6d2.css.map +1 -0
  109. package/dist/vars.ac235018.css +93 -0
  110. package/dist/vars.ac235018.css.map +1 -0
  111. package/dist/vars.cc682729.css +41 -0
  112. package/dist/vars.cc682729.css.map +1 -0
  113. package/package.json +23 -17
  114. package/src/ColorArea.tsx +7 -6
  115. package/src/ColorEditor.tsx +63 -0
  116. package/src/ColorField.tsx +67 -14
  117. package/src/ColorPicker.tsx +122 -0
  118. package/src/ColorSlider.tsx +6 -4
  119. package/src/ColorSwatch.tsx +102 -0
  120. package/src/ColorSwatchPicker.tsx +118 -0
  121. package/src/ColorThumb.tsx +72 -25
  122. package/src/ColorWheel.tsx +5 -2
  123. package/src/index.ts +10 -0
  124. package/dist/main.css +0 -1
@@ -0,0 +1,98 @@
1
+ var $2b9adc23f6c7cae1$exports = require("./ColorThumb.main.js");
2
+ require("./vars.6fa9fa04.css");
3
+ var $d4b4e0a63f9ca8c1$exports = require("./colorarea_vars_css.main.js");
4
+ var $6Gwd1$reactspectrumutils = require("@react-spectrum/utils");
5
+ var $6Gwd1$reactariacomponents = require("react-aria-components");
6
+ var $6Gwd1$reactariautils = require("@react-aria/utils");
7
+ var $6Gwd1$react = require("react");
8
+ var $6Gwd1$reactariacolor = require("@react-aria/color");
9
+ var $6Gwd1$reactstatelycolor = require("@react-stately/color");
10
+ var $6Gwd1$reactariafocus = require("@react-aria/focus");
11
+ var $6Gwd1$reactspectrumprovider = require("@react-spectrum/provider");
12
+
13
+
14
+ function $parcel$interopDefault(a) {
15
+ return a && a.__esModule ? a.default : a;
16
+ }
17
+
18
+ function $parcel$export(e, n, v, s) {
19
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
20
+ }
21
+
22
+ $parcel$export(module.exports, "ColorArea", () => $5f016e950c2dc3a6$export$b2103f68a961418e);
23
+ /*
24
+ * Copyright 2021 Adobe. All rights reserved.
25
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
26
+ * you may not use this file except in compliance with the License. You may obtain a copy
27
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
28
+ *
29
+ * Unless required by applicable law or agreed to in writing, software distributed under
30
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
31
+ * OF ANY KIND, either express or implied. See the License for the specific language
32
+ * governing permissions and limitations under the License.
33
+ */
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+ function $5f016e950c2dc3a6$var$ColorArea(props, ref) {
44
+ props = (0, $6Gwd1$reactspectrumprovider.useProviderProps)(props);
45
+ let inputXRef = (0, $6Gwd1$react.useRef)(null);
46
+ let inputYRef = (0, $6Gwd1$react.useRef)(null);
47
+ let containerRef = (0, $6Gwd1$reactspectrumutils.useFocusableRef)(ref, inputXRef);
48
+ [props, containerRef] = (0, $6Gwd1$reactariacomponents.useContextProps)(props, containerRef, (0, $6Gwd1$reactariacomponents.ColorAreaContext));
49
+ let { isDisabled: isDisabled } = props;
50
+ let size = props.size && (0, $6Gwd1$reactspectrumutils.dimensionValue)(props.size);
51
+ let { styleProps: styleProps } = (0, $6Gwd1$reactspectrumutils.useStyleProps)(props);
52
+ let state = (0, $6Gwd1$reactstatelycolor.useColorAreaState)(props);
53
+ let { colorAreaProps: colorAreaProps, xInputProps: xInputProps, yInputProps: yInputProps, thumbProps: thumbProps } = (0, $6Gwd1$reactariacolor.useColorArea)({
54
+ ...props,
55
+ inputXRef: inputXRef,
56
+ inputYRef: inputYRef,
57
+ containerRef: containerRef
58
+ }, state);
59
+ let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $6Gwd1$reactariafocus.useFocusRing)();
60
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($6Gwd1$react))).createElement("div", {
61
+ ...colorAreaProps,
62
+ className: (0, $6Gwd1$reactspectrumutils.classNames)((0, ($parcel$interopDefault($d4b4e0a63f9ca8c1$exports))), "spectrum-ColorArea", {
63
+ "is-disabled": isDisabled
64
+ }, styleProps.className),
65
+ ref: containerRef,
66
+ style: {
67
+ ...isDisabled ? {} : colorAreaProps.style,
68
+ ...styleProps.style,
69
+ // Workaround around https://github.com/adobe/spectrum-css/issues/1032
70
+ width: size,
71
+ height: size
72
+ }
73
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($6Gwd1$react))).createElement((0, $2b9adc23f6c7cae1$exports.ColorThumb), {
74
+ value: state.getDisplayColor(),
75
+ isFocused: isFocusVisible,
76
+ isDisabled: isDisabled,
77
+ isDragging: state.isDragging,
78
+ containerRef: containerRef,
79
+ className: (0, $6Gwd1$reactspectrumutils.classNames)((0, ($parcel$interopDefault($d4b4e0a63f9ca8c1$exports))), "spectrum-ColorArea-handle"),
80
+ ...thumbProps
81
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($6Gwd1$react))).createElement("div", {
82
+ role: "presentation"
83
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($6Gwd1$react))).createElement("input", {
84
+ className: (0, $6Gwd1$reactspectrumutils.classNames)((0, ($parcel$interopDefault($d4b4e0a63f9ca8c1$exports))), "spectrum-ColorArea-slider"),
85
+ ...(0, $6Gwd1$reactariautils.mergeProps)(xInputProps, focusProps),
86
+ ref: inputXRef
87
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($6Gwd1$react))).createElement("input", {
88
+ className: (0, $6Gwd1$reactspectrumutils.classNames)((0, ($parcel$interopDefault($d4b4e0a63f9ca8c1$exports))), "spectrum-ColorArea-slider"),
89
+ ...(0, $6Gwd1$reactariautils.mergeProps)(yInputProps, focusProps),
90
+ ref: inputYRef
91
+ }))));
92
+ }
93
+ /**
94
+ * ColorArea allows users to adjust two channels of an RGB, HSL or HSB color value against a two-dimensional gradient background.
95
+ */ let $5f016e950c2dc3a6$export$b2103f68a961418e = /*#__PURE__*/ (0, ($parcel$interopDefault($6Gwd1$react))).forwardRef($5f016e950c2dc3a6$var$ColorArea);
96
+
97
+
98
+ //# sourceMappingURL=ColorArea.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAeD,SAAS,gCAAU,KAA6B,EAAE,GAAiC;IACjF,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,IAAI,eAAe,CAAA,GAAA,yCAAc,EAAE,KAAK;IACxC,CAAC,OAAO,aAAa,GAAG,CAAA,GAAA,0CAAc,EAAE,OAAO,cAAc,CAAA,GAAA,2CAAe;IAE5E,IAAI,cAAC,UAAU,EAAC,GAAG;IACnB,IAAI,OAAO,MAAM,IAAI,IAAI,CAAA,GAAA,wCAAa,EAAE,MAAM,IAAI;IAClD,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IAGjC,IAAI,QAAQ,CAAA,GAAA,0CAAgB,EAAE;IAE9B,IAAI,kBACF,cAAc,eACd,WAAW,eACX,WAAW,cACX,UAAU,EACX,GAAG,CAAA,GAAA,kCAAW,EAAE;QAAC,GAAG,KAAK;mBAAE;mBAAW;sBAAW;IAAY,GAAG;IACjE,IAAI,cAAC,UAAU,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,kCAAW;IAE9C,qBACE,0DAAC;QACE,GAAG,cAAc;QAClB,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,sBACA;YACE,eAAe;QACjB,GACA,WAAW,SAAS;QAGxB,KAAK;QACL,OAAO;YACL,GAAI,aAAa,CAAC,IAAI,eAAe,KAAK;YAC1C,GAAG,WAAW,KAAK;YACnB,sEAAsE;YACtE,OAAO;YACP,QAAQ;QACV;qBACA,0DAAC,CAAA,GAAA,oCAAS;QACR,OAAO,MAAM,eAAe;QAC5B,WAAW;QACX,YAAY;QACZ,YAAY,MAAM,UAAU;QAC5B,cAAc;QACd,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC7B,GAAG,UAAU;qBACd,0DAAC;QAAI,MAAK;qBACR,0DAAC;QAAM,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAA+B,GAAG,CAAA,GAAA,gCAAS,EAAE,aAAa,WAAW;QAAE,KAAK;sBACjH,0DAAC;QAAM,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAA+B,GAAG,CAAA,GAAA,gCAAS,EAAE,aAAa,WAAW;QAAE,KAAK;;AAK3H;AAEA;;CAEC,GACD,IAAI,0DAAa,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/color/src/ColorArea.tsx"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, dimensionValue, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {ColorAreaContext, useContextProps} from 'react-aria-components';\nimport {ColorThumb} from './ColorThumb';\nimport {FocusableRef} from '@react-types/shared';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumColorAreaProps} from '@react-types/color';\nimport styles from '@adobe/spectrum-css-temp/components/colorarea/vars.css';\nimport {useColorArea} from '@react-aria/color';\nimport {useColorAreaState} from '@react-stately/color';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nfunction ColorArea(props: SpectrumColorAreaProps, ref: FocusableRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let inputXRef = useRef(null);\n let inputYRef = useRef(null);\n let containerRef = useFocusableRef(ref, inputXRef);\n [props, containerRef] = useContextProps(props, containerRef, ColorAreaContext);\n\n let {isDisabled} = props;\n let size = props.size && dimensionValue(props.size);\n let {styleProps} = useStyleProps(props);\n\n\n let state = useColorAreaState(props);\n\n let {\n colorAreaProps,\n xInputProps,\n yInputProps,\n thumbProps\n } = useColorArea({...props, inputXRef, inputYRef, containerRef}, state);\n let {focusProps, isFocusVisible} = useFocusRing();\n\n return (\n <div\n {...colorAreaProps}\n className={\n classNames(\n styles,\n 'spectrum-ColorArea',\n {\n 'is-disabled': isDisabled\n },\n styleProps.className\n )\n }\n ref={containerRef}\n style={{\n ...(isDisabled ? {} : colorAreaProps.style),\n ...styleProps.style,\n // Workaround around https://github.com/adobe/spectrum-css/issues/1032\n width: size,\n height: size\n }}>\n <ColorThumb\n value={state.getDisplayColor()}\n isFocused={isFocusVisible}\n isDisabled={isDisabled}\n isDragging={state.isDragging}\n containerRef={containerRef}\n className={classNames(styles, 'spectrum-ColorArea-handle')}\n {...thumbProps}>\n <div role=\"presentation\">\n <input className={classNames(styles, 'spectrum-ColorArea-slider')} {...mergeProps(xInputProps, focusProps)} ref={inputXRef} />\n <input className={classNames(styles, 'spectrum-ColorArea-slider')} {...mergeProps(yInputProps, focusProps)} ref={inputYRef} />\n </div>\n </ColorThumb>\n </div>\n );\n}\n\n/**\n * ColorArea allows users to adjust two channels of an RGB, HSL or HSB color value against a two-dimensional gradient background.\n */\nlet _ColorArea = React.forwardRef(ColorArea) as (props: SpectrumColorAreaProps & {ref?: FocusableRef<HTMLDivElement>}) => ReactElement;\nexport {_ColorArea as ColorArea};\n"],"names":[],"version":3,"file":"ColorArea.main.js.map"}
@@ -0,0 +1,93 @@
1
+ import {ColorThumb as $3a90e89d07d7bbd5$export$a3cc47cee1c1ccc} from "./ColorThumb.mjs";
2
+ import "./vars.6fa9fa04.css";
3
+ import $4eSry$colorarea_vars_cssmodulejs from "./colorarea_vars_css.mjs";
4
+ import {useFocusableRef as $4eSry$useFocusableRef, dimensionValue as $4eSry$dimensionValue, useStyleProps as $4eSry$useStyleProps, classNames as $4eSry$classNames} from "@react-spectrum/utils";
5
+ import {useContextProps as $4eSry$useContextProps, ColorAreaContext as $4eSry$ColorAreaContext} from "react-aria-components";
6
+ import {mergeProps as $4eSry$mergeProps} from "@react-aria/utils";
7
+ import $4eSry$react, {useRef as $4eSry$useRef} from "react";
8
+ import {useColorArea as $4eSry$useColorArea} from "@react-aria/color";
9
+ import {useColorAreaState as $4eSry$useColorAreaState} from "@react-stately/color";
10
+ import {useFocusRing as $4eSry$useFocusRing} from "@react-aria/focus";
11
+ import {useProviderProps as $4eSry$useProviderProps} from "@react-spectrum/provider";
12
+
13
+
14
+ function $parcel$interopDefault(a) {
15
+ return a && a.__esModule ? a.default : a;
16
+ }
17
+ /*
18
+ * Copyright 2021 Adobe. All rights reserved.
19
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
20
+ * you may not use this file except in compliance with the License. You may obtain a copy
21
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
22
+ *
23
+ * Unless required by applicable law or agreed to in writing, software distributed under
24
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
25
+ * OF ANY KIND, either express or implied. See the License for the specific language
26
+ * governing permissions and limitations under the License.
27
+ */
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+ function $40046aa1a7ccb226$var$ColorArea(props, ref) {
38
+ props = (0, $4eSry$useProviderProps)(props);
39
+ let inputXRef = (0, $4eSry$useRef)(null);
40
+ let inputYRef = (0, $4eSry$useRef)(null);
41
+ let containerRef = (0, $4eSry$useFocusableRef)(ref, inputXRef);
42
+ [props, containerRef] = (0, $4eSry$useContextProps)(props, containerRef, (0, $4eSry$ColorAreaContext));
43
+ let { isDisabled: isDisabled } = props;
44
+ let size = props.size && (0, $4eSry$dimensionValue)(props.size);
45
+ let { styleProps: styleProps } = (0, $4eSry$useStyleProps)(props);
46
+ let state = (0, $4eSry$useColorAreaState)(props);
47
+ let { colorAreaProps: colorAreaProps, xInputProps: xInputProps, yInputProps: yInputProps, thumbProps: thumbProps } = (0, $4eSry$useColorArea)({
48
+ ...props,
49
+ inputXRef: inputXRef,
50
+ inputYRef: inputYRef,
51
+ containerRef: containerRef
52
+ }, state);
53
+ let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $4eSry$useFocusRing)();
54
+ return /*#__PURE__*/ (0, $4eSry$react).createElement("div", {
55
+ ...colorAreaProps,
56
+ className: (0, $4eSry$classNames)((0, ($parcel$interopDefault($4eSry$colorarea_vars_cssmodulejs))), "spectrum-ColorArea", {
57
+ "is-disabled": isDisabled
58
+ }, styleProps.className),
59
+ ref: containerRef,
60
+ style: {
61
+ ...isDisabled ? {} : colorAreaProps.style,
62
+ ...styleProps.style,
63
+ // Workaround around https://github.com/adobe/spectrum-css/issues/1032
64
+ width: size,
65
+ height: size
66
+ }
67
+ }, /*#__PURE__*/ (0, $4eSry$react).createElement((0, $3a90e89d07d7bbd5$export$a3cc47cee1c1ccc), {
68
+ value: state.getDisplayColor(),
69
+ isFocused: isFocusVisible,
70
+ isDisabled: isDisabled,
71
+ isDragging: state.isDragging,
72
+ containerRef: containerRef,
73
+ className: (0, $4eSry$classNames)((0, ($parcel$interopDefault($4eSry$colorarea_vars_cssmodulejs))), "spectrum-ColorArea-handle"),
74
+ ...thumbProps
75
+ }, /*#__PURE__*/ (0, $4eSry$react).createElement("div", {
76
+ role: "presentation"
77
+ }, /*#__PURE__*/ (0, $4eSry$react).createElement("input", {
78
+ className: (0, $4eSry$classNames)((0, ($parcel$interopDefault($4eSry$colorarea_vars_cssmodulejs))), "spectrum-ColorArea-slider"),
79
+ ...(0, $4eSry$mergeProps)(xInputProps, focusProps),
80
+ ref: inputXRef
81
+ }), /*#__PURE__*/ (0, $4eSry$react).createElement("input", {
82
+ className: (0, $4eSry$classNames)((0, ($parcel$interopDefault($4eSry$colorarea_vars_cssmodulejs))), "spectrum-ColorArea-slider"),
83
+ ...(0, $4eSry$mergeProps)(yInputProps, focusProps),
84
+ ref: inputYRef
85
+ }))));
86
+ }
87
+ /**
88
+ * ColorArea allows users to adjust two channels of an RGB, HSL or HSB color value against a two-dimensional gradient background.
89
+ */ let $40046aa1a7ccb226$export$b2103f68a961418e = /*#__PURE__*/ (0, $4eSry$react).forwardRef($40046aa1a7ccb226$var$ColorArea);
90
+
91
+
92
+ export {$40046aa1a7ccb226$export$b2103f68a961418e as ColorArea};
93
+ //# sourceMappingURL=ColorArea.mjs.map
@@ -0,0 +1,93 @@
1
+ import {ColorThumb as $3a90e89d07d7bbd5$export$a3cc47cee1c1ccc} from "./ColorThumb.module.js";
2
+ import "./vars.6fa9fa04.css";
3
+ import $4eSry$colorarea_vars_cssmodulejs from "./colorarea_vars_css.module.js";
4
+ import {useFocusableRef as $4eSry$useFocusableRef, dimensionValue as $4eSry$dimensionValue, useStyleProps as $4eSry$useStyleProps, classNames as $4eSry$classNames} from "@react-spectrum/utils";
5
+ import {useContextProps as $4eSry$useContextProps, ColorAreaContext as $4eSry$ColorAreaContext} from "react-aria-components";
6
+ import {mergeProps as $4eSry$mergeProps} from "@react-aria/utils";
7
+ import $4eSry$react, {useRef as $4eSry$useRef} from "react";
8
+ import {useColorArea as $4eSry$useColorArea} from "@react-aria/color";
9
+ import {useColorAreaState as $4eSry$useColorAreaState} from "@react-stately/color";
10
+ import {useFocusRing as $4eSry$useFocusRing} from "@react-aria/focus";
11
+ import {useProviderProps as $4eSry$useProviderProps} from "@react-spectrum/provider";
12
+
13
+
14
+ function $parcel$interopDefault(a) {
15
+ return a && a.__esModule ? a.default : a;
16
+ }
17
+ /*
18
+ * Copyright 2021 Adobe. All rights reserved.
19
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
20
+ * you may not use this file except in compliance with the License. You may obtain a copy
21
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
22
+ *
23
+ * Unless required by applicable law or agreed to in writing, software distributed under
24
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
25
+ * OF ANY KIND, either express or implied. See the License for the specific language
26
+ * governing permissions and limitations under the License.
27
+ */
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+ function $40046aa1a7ccb226$var$ColorArea(props, ref) {
38
+ props = (0, $4eSry$useProviderProps)(props);
39
+ let inputXRef = (0, $4eSry$useRef)(null);
40
+ let inputYRef = (0, $4eSry$useRef)(null);
41
+ let containerRef = (0, $4eSry$useFocusableRef)(ref, inputXRef);
42
+ [props, containerRef] = (0, $4eSry$useContextProps)(props, containerRef, (0, $4eSry$ColorAreaContext));
43
+ let { isDisabled: isDisabled } = props;
44
+ let size = props.size && (0, $4eSry$dimensionValue)(props.size);
45
+ let { styleProps: styleProps } = (0, $4eSry$useStyleProps)(props);
46
+ let state = (0, $4eSry$useColorAreaState)(props);
47
+ let { colorAreaProps: colorAreaProps, xInputProps: xInputProps, yInputProps: yInputProps, thumbProps: thumbProps } = (0, $4eSry$useColorArea)({
48
+ ...props,
49
+ inputXRef: inputXRef,
50
+ inputYRef: inputYRef,
51
+ containerRef: containerRef
52
+ }, state);
53
+ let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $4eSry$useFocusRing)();
54
+ return /*#__PURE__*/ (0, $4eSry$react).createElement("div", {
55
+ ...colorAreaProps,
56
+ className: (0, $4eSry$classNames)((0, ($parcel$interopDefault($4eSry$colorarea_vars_cssmodulejs))), "spectrum-ColorArea", {
57
+ "is-disabled": isDisabled
58
+ }, styleProps.className),
59
+ ref: containerRef,
60
+ style: {
61
+ ...isDisabled ? {} : colorAreaProps.style,
62
+ ...styleProps.style,
63
+ // Workaround around https://github.com/adobe/spectrum-css/issues/1032
64
+ width: size,
65
+ height: size
66
+ }
67
+ }, /*#__PURE__*/ (0, $4eSry$react).createElement((0, $3a90e89d07d7bbd5$export$a3cc47cee1c1ccc), {
68
+ value: state.getDisplayColor(),
69
+ isFocused: isFocusVisible,
70
+ isDisabled: isDisabled,
71
+ isDragging: state.isDragging,
72
+ containerRef: containerRef,
73
+ className: (0, $4eSry$classNames)((0, ($parcel$interopDefault($4eSry$colorarea_vars_cssmodulejs))), "spectrum-ColorArea-handle"),
74
+ ...thumbProps
75
+ }, /*#__PURE__*/ (0, $4eSry$react).createElement("div", {
76
+ role: "presentation"
77
+ }, /*#__PURE__*/ (0, $4eSry$react).createElement("input", {
78
+ className: (0, $4eSry$classNames)((0, ($parcel$interopDefault($4eSry$colorarea_vars_cssmodulejs))), "spectrum-ColorArea-slider"),
79
+ ...(0, $4eSry$mergeProps)(xInputProps, focusProps),
80
+ ref: inputXRef
81
+ }), /*#__PURE__*/ (0, $4eSry$react).createElement("input", {
82
+ className: (0, $4eSry$classNames)((0, ($parcel$interopDefault($4eSry$colorarea_vars_cssmodulejs))), "spectrum-ColorArea-slider"),
83
+ ...(0, $4eSry$mergeProps)(yInputProps, focusProps),
84
+ ref: inputYRef
85
+ }))));
86
+ }
87
+ /**
88
+ * ColorArea allows users to adjust two channels of an RGB, HSL or HSB color value against a two-dimensional gradient background.
89
+ */ let $40046aa1a7ccb226$export$b2103f68a961418e = /*#__PURE__*/ (0, $4eSry$react).forwardRef($40046aa1a7ccb226$var$ColorArea);
90
+
91
+
92
+ export {$40046aa1a7ccb226$export$b2103f68a961418e as ColorArea};
93
+ //# sourceMappingURL=ColorArea.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAeD,SAAS,gCAAU,KAA6B,EAAE,GAAiC;IACjF,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,IAAI,eAAe,CAAA,GAAA,sBAAc,EAAE,KAAK;IACxC,CAAC,OAAO,aAAa,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,cAAc,CAAA,GAAA,uBAAe;IAE5E,IAAI,cAAC,UAAU,EAAC,GAAG;IACnB,IAAI,OAAO,MAAM,IAAI,IAAI,CAAA,GAAA,qBAAa,EAAE,MAAM,IAAI;IAClD,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IAGjC,IAAI,QAAQ,CAAA,GAAA,wBAAgB,EAAE;IAE9B,IAAI,kBACF,cAAc,eACd,WAAW,eACX,WAAW,cACX,UAAU,EACX,GAAG,CAAA,GAAA,mBAAW,EAAE;QAAC,GAAG,KAAK;mBAAE;mBAAW;sBAAW;IAAY,GAAG;IACjE,IAAI,cAAC,UAAU,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW;IAE9C,qBACE,gCAAC;QACE,GAAG,cAAc;QAClB,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,2DAAK,GACL,sBACA;YACE,eAAe;QACjB,GACA,WAAW,SAAS;QAGxB,KAAK;QACL,OAAO;YACL,GAAI,aAAa,CAAC,IAAI,eAAe,KAAK;YAC1C,GAAG,WAAW,KAAK;YACnB,sEAAsE;YACtE,OAAO;YACP,QAAQ;QACV;qBACA,gCAAC,CAAA,GAAA,wCAAS;QACR,OAAO,MAAM,eAAe;QAC5B,WAAW;QACX,YAAY;QACZ,YAAY,MAAM,UAAU;QAC5B,cAAc;QACd,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,2DAAK,GAAG;QAC7B,GAAG,UAAU;qBACd,gCAAC;QAAI,MAAK;qBACR,gCAAC;QAAM,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,2DAAK,GAAG;QAA+B,GAAG,CAAA,GAAA,iBAAS,EAAE,aAAa,WAAW;QAAE,KAAK;sBACjH,gCAAC;QAAM,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,2DAAK,GAAG;QAA+B,GAAG,CAAA,GAAA,iBAAS,EAAE,aAAa,WAAW;QAAE,KAAK;;AAK3H;AAEA;;CAEC,GACD,IAAI,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/color/src/ColorArea.tsx"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, dimensionValue, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {ColorAreaContext, useContextProps} from 'react-aria-components';\nimport {ColorThumb} from './ColorThumb';\nimport {FocusableRef} from '@react-types/shared';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumColorAreaProps} from '@react-types/color';\nimport styles from '@adobe/spectrum-css-temp/components/colorarea/vars.css';\nimport {useColorArea} from '@react-aria/color';\nimport {useColorAreaState} from '@react-stately/color';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nfunction ColorArea(props: SpectrumColorAreaProps, ref: FocusableRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let inputXRef = useRef(null);\n let inputYRef = useRef(null);\n let containerRef = useFocusableRef(ref, inputXRef);\n [props, containerRef] = useContextProps(props, containerRef, ColorAreaContext);\n\n let {isDisabled} = props;\n let size = props.size && dimensionValue(props.size);\n let {styleProps} = useStyleProps(props);\n\n\n let state = useColorAreaState(props);\n\n let {\n colorAreaProps,\n xInputProps,\n yInputProps,\n thumbProps\n } = useColorArea({...props, inputXRef, inputYRef, containerRef}, state);\n let {focusProps, isFocusVisible} = useFocusRing();\n\n return (\n <div\n {...colorAreaProps}\n className={\n classNames(\n styles,\n 'spectrum-ColorArea',\n {\n 'is-disabled': isDisabled\n },\n styleProps.className\n )\n }\n ref={containerRef}\n style={{\n ...(isDisabled ? {} : colorAreaProps.style),\n ...styleProps.style,\n // Workaround around https://github.com/adobe/spectrum-css/issues/1032\n width: size,\n height: size\n }}>\n <ColorThumb\n value={state.getDisplayColor()}\n isFocused={isFocusVisible}\n isDisabled={isDisabled}\n isDragging={state.isDragging}\n containerRef={containerRef}\n className={classNames(styles, 'spectrum-ColorArea-handle')}\n {...thumbProps}>\n <div role=\"presentation\">\n <input className={classNames(styles, 'spectrum-ColorArea-slider')} {...mergeProps(xInputProps, focusProps)} ref={inputXRef} />\n <input className={classNames(styles, 'spectrum-ColorArea-slider')} {...mergeProps(yInputProps, focusProps)} ref={inputYRef} />\n </div>\n </ColorThumb>\n </div>\n );\n}\n\n/**\n * ColorArea allows users to adjust two channels of an RGB, HSL or HSB color value against a two-dimensional gradient background.\n */\nlet _ColorArea = React.forwardRef(ColorArea) as (props: SpectrumColorAreaProps & {ref?: FocusableRef<HTMLDivElement>}) => ReactElement;\nexport {_ColorArea as ColorArea};\n"],"names":[],"version":3,"file":"ColorArea.module.js.map"}
@@ -0,0 +1,20 @@
1
+ @layer a {
2
+ ._Zb {
3
+ flex-direction: column;
4
+ }
5
+
6
+ ._Sd {
7
+ display: flex;
8
+ }
9
+
10
+ .le {
11
+ row-gap: 1rem;
12
+ }
13
+
14
+ .me {
15
+ column-gap: 1rem;
16
+ }
17
+ }
18
+
19
+ @layer b;
20
+ /*# sourceMappingURL=ColorEditor.32e497e8.css.map */
@@ -0,0 +1 @@
1
+ {"mappings":"ACAA;EASE;;;;EANA;;;;EAMA;;;;EAMA;;;;;AAfF","sources":["831a302ce8de66a2","packages/@react-spectrum/color/src/ColorEditor.tsx"],"sourcesContent":["@import \"61db59ad802e5cd4\";\n@import \"4bcaf5321f340d0a\";\n@import \"76e53872e9d29f42\";\n","@layer a, b;\n\n@layer a {\n ._Sd {\n display: flex;\n }\n}\n\n@layer a {\n ._Zb {\n flex-direction: column;\n }\n}\n\n@layer a {\n .le {\n row-gap: 1rem;\n }\n}\n\n@layer a {\n .me {\n column-gap: 1rem;\n }\n}\n\n"],"names":[],"version":3,"file":"ColorEditor.32e497e8.css.map"}
@@ -0,0 +1,116 @@
1
+ require("./ColorEditor.32e497e8.css");
2
+ var $5f016e950c2dc3a6$exports = require("./ColorArea.main.js");
3
+ var $8bdb9bc27ff3debb$exports = require("./ColorField.main.js");
4
+ var $4537dec0de08c277$exports = require("./ColorSlider.main.js");
5
+ var $54ac9df6f63399af$exports = require("./intlStrings.main.js");
6
+ var $2H14s$reactstatelycolor = require("@react-stately/color");
7
+ var $2H14s$reactspectrumpicker = require("@react-spectrum/picker");
8
+ var $2H14s$react = require("react");
9
+ var $2H14s$reactspectrumutils = require("@react-spectrum/utils");
10
+ var $2H14s$reactariai18n = require("@react-aria/i18n");
11
+
12
+
13
+ function $parcel$interopDefault(a) {
14
+ return a && a.__esModule ? a.default : a;
15
+ }
16
+
17
+ function $parcel$export(e, n, v, s) {
18
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
19
+ }
20
+
21
+ $parcel$export(module.exports, "ColorEditor", () => $ecaab91cad36cb44$export$5aa54fd21eb08d23);
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+ function $ecaab91cad36cb44$var$ColorEditor(props, ref) {
32
+ let [format, setFormat] = (0, $2H14s$react.useState)("hex");
33
+ let domRef = (0, $2H14s$reactspectrumutils.useDOMRef)(ref);
34
+ let formatter = (0, $2H14s$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($54ac9df6f63399af$exports))), "@react-spectrum/color");
35
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement("div", {
36
+ className: function anonymous(props) {
37
+ let rules = "";
38
+ rules += " _Sd";
39
+ rules += " _Zb";
40
+ rules += " le";
41
+ rules += " me";
42
+ return rules;
43
+ }(),
44
+ ref: domRef
45
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement("div", {
46
+ className: function anonymous(props) {
47
+ let rules = "";
48
+ rules += " _Sd";
49
+ rules += " le";
50
+ rules += " me";
51
+ return rules;
52
+ }()
53
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement((0, $5f016e950c2dc3a6$exports.ColorArea), {
54
+ colorSpace: "hsb",
55
+ xChannel: "saturation",
56
+ yChannel: "brightness"
57
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement((0, $4537dec0de08c277$exports.ColorSlider), {
58
+ colorSpace: "hsb",
59
+ channel: "hue",
60
+ orientation: "vertical"
61
+ }), !props.hideAlphaChannel && /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement((0, $4537dec0de08c277$exports.ColorSlider), {
62
+ channel: "alpha",
63
+ orientation: "vertical"
64
+ })), /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement("div", {
65
+ className: function anonymous(props) {
66
+ let rules = "";
67
+ rules += " _Sd";
68
+ rules += " le";
69
+ rules += " me";
70
+ return rules;
71
+ }()
72
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement((0, $2H14s$reactspectrumpicker.Picker), {
73
+ "aria-label": formatter.format("colorFormat"),
74
+ isQuiet: true,
75
+ width: "size-700",
76
+ menuWidth: "size-1000",
77
+ selectedKey: format,
78
+ onSelectionChange: (f)=>setFormat(f)
79
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement((0, $2H14s$reactspectrumpicker.Item), {
80
+ key: "hex"
81
+ }, formatter.format("hex")), /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement((0, $2H14s$reactspectrumpicker.Item), {
82
+ key: "rgb"
83
+ }, formatter.format("rgb")), /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement((0, $2H14s$reactspectrumpicker.Item), {
84
+ key: "hsl"
85
+ }, formatter.format("hsl")), /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement((0, $2H14s$reactspectrumpicker.Item), {
86
+ key: "hsb"
87
+ }, formatter.format("hsb"))), format === "hex" ? /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement((0, $8bdb9bc27ff3debb$exports.ColorField), {
88
+ isQuiet: true,
89
+ width: "size-1000",
90
+ "aria-label": formatter.format("hex")
91
+ }) : (0, $2H14s$reactstatelycolor.getColorChannels)(format).map((channel)=>/*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement((0, $8bdb9bc27ff3debb$exports.ColorField), {
92
+ key: channel,
93
+ colorSpace: format === "hex" ? "rgb" : format,
94
+ channel: channel,
95
+ isQuiet: true,
96
+ width: "size-400",
97
+ flex: true,
98
+ UNSAFE_style: {
99
+ "--spectrum-textfield-min-width": 0
100
+ }
101
+ })), !props.hideAlphaChannel && /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement((0, $8bdb9bc27ff3debb$exports.ColorField), {
102
+ channel: "alpha",
103
+ isQuiet: true,
104
+ width: "size-400",
105
+ flex: true,
106
+ UNSAFE_style: {
107
+ "--spectrum-textfield-min-width": 0
108
+ }
109
+ })));
110
+ }
111
+ /**
112
+ * ColorEditor provides a default UI for editing colors within a ColorPicker.
113
+ */ let $ecaab91cad36cb44$export$5aa54fd21eb08d23 = /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).forwardRef($ecaab91cad36cb44$var$ColorEditor);
114
+
115
+
116
+ //# sourceMappingURL=ColorEditor.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,SAAS,kCAAY,KAA+B,EAAE,GAA2B;IAC/E,IAAI,CAAC,QAAQ,UAAU,GAAG,CAAA,GAAA,qBAAO,EAAsB;IACvD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,YAAY,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAE1D,qBACE,0DAAC;QAAI,WAAW;;;;;;;;QAA6D,KAAK;qBAChF,0DAAC;QAAI,WAAW;;;;;;;qBACd,0DAAC,CAAA,GAAA,mCAAQ;QAAE,YAAW;QAAM,UAAS;QAAa,UAAS;sBAC3D,0DAAC,CAAA,GAAA,qCAAU;QAAE,YAAW;QAAM,SAAQ;QAAM,aAAY;QACvD,CAAC,MAAM,gBAAgB,kBACtB,0DAAC,CAAA,GAAA,qCAAU;QAAE,SAAQ;QAAQ,aAAY;uBAG7C,0DAAC;QAAI,WAAW;;;;;;;qBACd,0DAAC,CAAA,GAAA,iCAAK;QACJ,cAAY,UAAU,MAAM,CAAC;QAC7B,SAAA;QACA,OAAM;QACN,WAAU;QACV,aAAa;QACb,mBAAmB,CAAA,IAAK,UAAU;qBAClC,0DAAC,CAAA,GAAA,+BAAG;QAAE,KAAI;OAAO,UAAU,MAAM,CAAC,uBAClC,0DAAC,CAAA,GAAA,+BAAG;QAAE,KAAI;OAAO,UAAU,MAAM,CAAC,uBAClC,0DAAC,CAAA,GAAA,+BAAG;QAAE,KAAI;OAAO,UAAU,MAAM,CAAC,uBAClC,0DAAC,CAAA,GAAA,+BAAG;QAAE,KAAI;OAAO,UAAU,MAAM,CAAC,UAEnC,WAAW,sBACR,0DAAC,CAAA,GAAA,oCAAS;QAAE,SAAA;QAAQ,OAAM;QAAY,cAAY,UAAU,MAAM,CAAC;SACnE,CAAA,GAAA,yCAAe,EAAE,QAAQ,GAAG,CAAC,CAAA,wBAC7B,0DAAC,CAAA,GAAA,oCAAS;YAAE,KAAK;YAAS,YAAY,WAAW,QAAQ,QAAQ;YAAQ,SAAS;YAAS,SAAA;YAAQ,OAAM;YAAW,MAAA;YAAK,cAAc;gBAAC,kCAAkC;YAAC;aAE9K,CAAC,MAAM,gBAAgB,kBACtB,0DAAC,CAAA,GAAA,oCAAS;QAAE,SAAQ;QAAQ,SAAA;QAAQ,OAAM;QAAW,MAAA;QAAK,cAAc;YAAC,kCAAkC;QAAC;;AAItH;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/color/src/ColorEditor.tsx"],"sourcesContent":["import {ColorArea} from './ColorArea';\nimport {ColorField} from './ColorField';\nimport {ColorSlider} from './ColorSlider';\nimport {ColorSpace} from '@react-types/color';\nimport {DOMRef} from '@react-types/shared';\nimport {getColorChannels} from '@react-stately/color';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {Item, Picker} from '@react-spectrum/picker';\nimport React, {CSSProperties, useState} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface SpectrumColorEditorProps {\n /** Whether to hide the alpha channel color slider and color field. */\n hideAlphaChannel?: boolean\n}\n\nfunction ColorEditor(props: SpectrumColorEditorProps, ref: DOMRef<HTMLDivElement>) {\n let [format, setFormat] = useState<ColorSpace | 'hex'>('hex');\n let domRef = useDOMRef(ref);\n let formatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/color');\n\n return (\n <div className={style({display: 'flex', flexDirection: 'column', gap: 4})()} ref={domRef}>\n <div className={style({display: 'flex', gap: 4})()}>\n <ColorArea colorSpace=\"hsb\" xChannel=\"saturation\" yChannel=\"brightness\" />\n <ColorSlider colorSpace=\"hsb\" channel=\"hue\" orientation=\"vertical\" />\n {!props.hideAlphaChannel &&\n <ColorSlider channel=\"alpha\" orientation=\"vertical\" />\n }\n </div>\n <div className={style({display: 'flex', gap: 4})()}>\n <Picker \n aria-label={formatter.format('colorFormat')}\n isQuiet\n width=\"size-700\"\n menuWidth=\"size-1000\"\n selectedKey={format}\n onSelectionChange={f => setFormat(f as typeof format)}>\n <Item key=\"hex\">{formatter.format('hex')}</Item>\n <Item key=\"rgb\">{formatter.format('rgb')}</Item>\n <Item key=\"hsl\">{formatter.format('hsl')}</Item>\n <Item key=\"hsb\">{formatter.format('hsb')}</Item>\n </Picker>\n {format === 'hex'\n ? <ColorField isQuiet width=\"size-1000\" aria-label={formatter.format('hex')} />\n : getColorChannels(format).map(channel => (\n <ColorField key={channel} colorSpace={format === 'hex' ? 'rgb' : format} channel={channel} isQuiet width=\"size-400\" flex UNSAFE_style={{'--spectrum-textfield-min-width': 0} as CSSProperties} />\n ))}\n {!props.hideAlphaChannel &&\n <ColorField channel=\"alpha\" isQuiet width=\"size-400\" flex UNSAFE_style={{'--spectrum-textfield-min-width': 0} as CSSProperties} />}\n </div>\n </div>\n );\n}\n\n/**\n * ColorEditor provides a default UI for editing colors within a ColorPicker.\n */\nlet _ColorEditor = React.forwardRef(ColorEditor);\nexport {_ColorEditor as ColorEditor};\n"],"names":[],"version":3,"file":"ColorEditor.main.js.map"}
@@ -0,0 +1,111 @@
1
+ import "./ColorEditor.32e497e8.css";
2
+ import {ColorArea as $40046aa1a7ccb226$export$b2103f68a961418e} from "./ColorArea.mjs";
3
+ import {ColorField as $0077d47e004328f0$export$b865d4358897bb17} from "./ColorField.mjs";
4
+ import {ColorSlider as $3870e4ce67ed7ee1$export$44fd664bcca5b6fb} from "./ColorSlider.mjs";
5
+ import $3Vio4$intlStringsmodulejs from "./intlStrings.mjs";
6
+ import {getColorChannels as $3Vio4$getColorChannels} from "@react-stately/color";
7
+ import {Picker as $3Vio4$Picker, Item as $3Vio4$Item} from "@react-spectrum/picker";
8
+ import $3Vio4$react, {useState as $3Vio4$useState} from "react";
9
+ import {useDOMRef as $3Vio4$useDOMRef} from "@react-spectrum/utils";
10
+ import {useLocalizedStringFormatter as $3Vio4$useLocalizedStringFormatter} from "@react-aria/i18n";
11
+
12
+
13
+ function $parcel$interopDefault(a) {
14
+ return a && a.__esModule ? a.default : a;
15
+ }
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+ function $49352c629f2d8349$var$ColorEditor(props, ref) {
26
+ let [format, setFormat] = (0, $3Vio4$useState)("hex");
27
+ let domRef = (0, $3Vio4$useDOMRef)(ref);
28
+ let formatter = (0, $3Vio4$useLocalizedStringFormatter)((0, ($parcel$interopDefault($3Vio4$intlStringsmodulejs))), "@react-spectrum/color");
29
+ return /*#__PURE__*/ (0, $3Vio4$react).createElement("div", {
30
+ className: function anonymous(props) {
31
+ let rules = "";
32
+ rules += " _Sd";
33
+ rules += " _Zb";
34
+ rules += " le";
35
+ rules += " me";
36
+ return rules;
37
+ }(),
38
+ ref: domRef
39
+ }, /*#__PURE__*/ (0, $3Vio4$react).createElement("div", {
40
+ className: function anonymous(props) {
41
+ let rules = "";
42
+ rules += " _Sd";
43
+ rules += " le";
44
+ rules += " me";
45
+ return rules;
46
+ }()
47
+ }, /*#__PURE__*/ (0, $3Vio4$react).createElement((0, $40046aa1a7ccb226$export$b2103f68a961418e), {
48
+ colorSpace: "hsb",
49
+ xChannel: "saturation",
50
+ yChannel: "brightness"
51
+ }), /*#__PURE__*/ (0, $3Vio4$react).createElement((0, $3870e4ce67ed7ee1$export$44fd664bcca5b6fb), {
52
+ colorSpace: "hsb",
53
+ channel: "hue",
54
+ orientation: "vertical"
55
+ }), !props.hideAlphaChannel && /*#__PURE__*/ (0, $3Vio4$react).createElement((0, $3870e4ce67ed7ee1$export$44fd664bcca5b6fb), {
56
+ channel: "alpha",
57
+ orientation: "vertical"
58
+ })), /*#__PURE__*/ (0, $3Vio4$react).createElement("div", {
59
+ className: function anonymous(props) {
60
+ let rules = "";
61
+ rules += " _Sd";
62
+ rules += " le";
63
+ rules += " me";
64
+ return rules;
65
+ }()
66
+ }, /*#__PURE__*/ (0, $3Vio4$react).createElement((0, $3Vio4$Picker), {
67
+ "aria-label": formatter.format("colorFormat"),
68
+ isQuiet: true,
69
+ width: "size-700",
70
+ menuWidth: "size-1000",
71
+ selectedKey: format,
72
+ onSelectionChange: (f)=>setFormat(f)
73
+ }, /*#__PURE__*/ (0, $3Vio4$react).createElement((0, $3Vio4$Item), {
74
+ key: "hex"
75
+ }, formatter.format("hex")), /*#__PURE__*/ (0, $3Vio4$react).createElement((0, $3Vio4$Item), {
76
+ key: "rgb"
77
+ }, formatter.format("rgb")), /*#__PURE__*/ (0, $3Vio4$react).createElement((0, $3Vio4$Item), {
78
+ key: "hsl"
79
+ }, formatter.format("hsl")), /*#__PURE__*/ (0, $3Vio4$react).createElement((0, $3Vio4$Item), {
80
+ key: "hsb"
81
+ }, formatter.format("hsb"))), format === "hex" ? /*#__PURE__*/ (0, $3Vio4$react).createElement((0, $0077d47e004328f0$export$b865d4358897bb17), {
82
+ isQuiet: true,
83
+ width: "size-1000",
84
+ "aria-label": formatter.format("hex")
85
+ }) : (0, $3Vio4$getColorChannels)(format).map((channel)=>/*#__PURE__*/ (0, $3Vio4$react).createElement((0, $0077d47e004328f0$export$b865d4358897bb17), {
86
+ key: channel,
87
+ colorSpace: format === "hex" ? "rgb" : format,
88
+ channel: channel,
89
+ isQuiet: true,
90
+ width: "size-400",
91
+ flex: true,
92
+ UNSAFE_style: {
93
+ "--spectrum-textfield-min-width": 0
94
+ }
95
+ })), !props.hideAlphaChannel && /*#__PURE__*/ (0, $3Vio4$react).createElement((0, $0077d47e004328f0$export$b865d4358897bb17), {
96
+ channel: "alpha",
97
+ isQuiet: true,
98
+ width: "size-400",
99
+ flex: true,
100
+ UNSAFE_style: {
101
+ "--spectrum-textfield-min-width": 0
102
+ }
103
+ })));
104
+ }
105
+ /**
106
+ * ColorEditor provides a default UI for editing colors within a ColorPicker.
107
+ */ let $49352c629f2d8349$export$5aa54fd21eb08d23 = /*#__PURE__*/ (0, $3Vio4$react).forwardRef($49352c629f2d8349$var$ColorEditor);
108
+
109
+
110
+ export {$49352c629f2d8349$export$5aa54fd21eb08d23 as ColorEditor};
111
+ //# sourceMappingURL=ColorEditor.mjs.map