@react-spectrum/color 3.1.7 → 3.2.0
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/import.mjs +9 -11
- package/dist/main.js +18 -20
- package/dist/main.js.map +1 -1
- package/dist/module.js +9 -11
- package/dist/module.js.map +1 -1
- package/dist/types/src/index.d.ts +16 -0
- package/package.json +14 -41
- package/src/index.ts +17 -15
- package/dist/ColorArea.main.js +0 -95
- package/dist/ColorArea.main.js.map +0 -1
- package/dist/ColorArea.mjs +0 -90
- package/dist/ColorArea.module.js +0 -90
- package/dist/ColorArea.module.js.map +0 -1
- package/dist/ColorEditor.main.js +0 -113
- package/dist/ColorEditor.main.js.map +0 -1
- package/dist/ColorEditor.mjs +0 -108
- package/dist/ColorEditor.module.js +0 -108
- package/dist/ColorEditor.module.js.map +0 -1
- package/dist/ColorField.main.js +0 -105
- package/dist/ColorField.main.js.map +0 -1
- package/dist/ColorField.mjs +0 -100
- package/dist/ColorField.module.js +0 -100
- package/dist/ColorField.module.js.map +0 -1
- package/dist/ColorPicker.main.js +0 -123
- package/dist/ColorPicker.main.js.map +0 -1
- package/dist/ColorPicker.mjs +0 -114
- package/dist/ColorPicker.module.js +0 -114
- package/dist/ColorPicker.module.js.map +0 -1
- package/dist/ColorSlider.main.js +0 -126
- package/dist/ColorSlider.main.js.map +0 -1
- package/dist/ColorSlider.mjs +0 -121
- package/dist/ColorSlider.module.js +0 -121
- package/dist/ColorSlider.module.js.map +0 -1
- package/dist/ColorSwatch.main.js +0 -91
- package/dist/ColorSwatch.main.js.map +0 -1
- package/dist/ColorSwatch.mjs +0 -81
- package/dist/ColorSwatch.module.js +0 -81
- package/dist/ColorSwatch.module.js.map +0 -1
- package/dist/ColorSwatchPicker.main.js +0 -112
- package/dist/ColorSwatchPicker.main.js.map +0 -1
- package/dist/ColorSwatchPicker.mjs +0 -103
- package/dist/ColorSwatchPicker.module.js +0 -103
- package/dist/ColorSwatchPicker.module.js.map +0 -1
- package/dist/ColorThumb.main.js +0 -146
- package/dist/ColorThumb.main.js.map +0 -1
- package/dist/ColorThumb.mjs +0 -141
- package/dist/ColorThumb.module.js +0 -141
- package/dist/ColorThumb.module.js.map +0 -1
- package/dist/ColorWheel.main.js +0 -114
- package/dist/ColorWheel.main.js.map +0 -1
- package/dist/ColorWheel.mjs +0 -109
- package/dist/ColorWheel.module.js +0 -109
- package/dist/ColorWheel.module.js.map +0 -1
- package/dist/ar-AE.main.js +0 -10
- package/dist/ar-AE.main.js.map +0 -1
- package/dist/ar-AE.mjs +0 -12
- package/dist/ar-AE.module.js +0 -12
- package/dist/ar-AE.module.js.map +0 -1
- package/dist/bg-BG.main.js +0 -10
- package/dist/bg-BG.main.js.map +0 -1
- package/dist/bg-BG.mjs +0 -12
- package/dist/bg-BG.module.js +0 -12
- package/dist/bg-BG.module.js.map +0 -1
- package/dist/color.0da417e8.css +0 -93
- package/dist/color.0da417e8.css.map +0 -1
- package/dist/color.4034864f.css +0 -120
- package/dist/color.4034864f.css.map +0 -1
- package/dist/color.51750948.css +0 -356
- package/dist/color.51750948.css.map +0 -1
- package/dist/color.6dfdb0cd.css +0 -260
- package/dist/color.6dfdb0cd.css.map +0 -1
- package/dist/color.85d29c28.css +0 -12
- package/dist/color.85d29c28.css.map +0 -1
- package/dist/color.8e3b650f.css +0 -93
- package/dist/color.8e3b650f.css.map +0 -1
- package/dist/color.a5310285.css +0 -206
- package/dist/color.a5310285.css.map +0 -1
- package/dist/color.decac5a6.css +0 -20
- package/dist/color.decac5a6.css.map +0 -1
- package/dist/color.f801bfa3.css +0 -75
- package/dist/color.f801bfa3.css.map +0 -1
- package/dist/color.ff589589.css +0 -41
- package/dist/color.ff589589.css.map +0 -1
- package/dist/colorarea_vars_css.main.js +0 -29
- package/dist/colorarea_vars_css.main.js.map +0 -1
- package/dist/colorarea_vars_css.mjs +0 -31
- package/dist/colorarea_vars_css.module.js +0 -31
- package/dist/colorarea_vars_css.module.js.map +0 -1
- package/dist/colorfield_css.main.js +0 -11
- package/dist/colorfield_css.main.js.map +0 -1
- package/dist/colorfield_css.mjs +0 -13
- package/dist/colorfield_css.module.js +0 -13
- package/dist/colorfield_css.module.js.map +0 -1
- package/dist/colorhandle_vars_css.main.js +0 -26
- package/dist/colorhandle_vars_css.main.js.map +0 -1
- package/dist/colorhandle_vars_css.mjs +0 -28
- package/dist/colorhandle_vars_css.module.js +0 -28
- package/dist/colorhandle_vars_css.module.js.map +0 -1
- package/dist/colorloupe_vars_css.main.js +0 -23
- package/dist/colorloupe_vars_css.main.js.map +0 -1
- package/dist/colorloupe_vars_css.mjs +0 -25
- package/dist/colorloupe_vars_css.module.js +0 -25
- package/dist/colorloupe_vars_css.module.js.map +0 -1
- package/dist/colorslider_vars_css.main.js +0 -53
- package/dist/colorslider_vars_css.main.js.map +0 -1
- package/dist/colorslider_vars_css.mjs +0 -55
- package/dist/colorslider_vars_css.module.js +0 -55
- package/dist/colorslider_vars_css.module.js.map +0 -1
- package/dist/colorwheel_vars_css.main.js +0 -35
- package/dist/colorwheel_vars_css.main.js.map +0 -1
- package/dist/colorwheel_vars_css.mjs +0 -37
- package/dist/colorwheel_vars_css.module.js +0 -37
- package/dist/colorwheel_vars_css.module.js.map +0 -1
- package/dist/cs-CZ.main.js +0 -10
- package/dist/cs-CZ.main.js.map +0 -1
- package/dist/cs-CZ.mjs +0 -12
- package/dist/cs-CZ.module.js +0 -12
- package/dist/cs-CZ.module.js.map +0 -1
- package/dist/da-DK.main.js +0 -10
- package/dist/da-DK.main.js.map +0 -1
- package/dist/da-DK.mjs +0 -12
- package/dist/da-DK.module.js +0 -12
- package/dist/da-DK.module.js.map +0 -1
- package/dist/de-DE.main.js +0 -10
- package/dist/de-DE.main.js.map +0 -1
- package/dist/de-DE.mjs +0 -12
- package/dist/de-DE.module.js +0 -12
- package/dist/de-DE.module.js.map +0 -1
- package/dist/el-GR.main.js +0 -10
- package/dist/el-GR.main.js.map +0 -1
- package/dist/el-GR.mjs +0 -12
- package/dist/el-GR.module.js +0 -12
- package/dist/el-GR.module.js.map +0 -1
- package/dist/en-US.main.js +0 -10
- package/dist/en-US.main.js.map +0 -1
- package/dist/en-US.mjs +0 -12
- package/dist/en-US.module.js +0 -12
- package/dist/en-US.module.js.map +0 -1
- package/dist/es-ES.main.js +0 -10
- package/dist/es-ES.main.js.map +0 -1
- package/dist/es-ES.mjs +0 -12
- package/dist/es-ES.module.js +0 -12
- package/dist/es-ES.module.js.map +0 -1
- package/dist/et-EE.main.js +0 -10
- package/dist/et-EE.main.js.map +0 -1
- package/dist/et-EE.mjs +0 -12
- package/dist/et-EE.module.js +0 -12
- package/dist/et-EE.module.js.map +0 -1
- package/dist/fi-FI.main.js +0 -10
- package/dist/fi-FI.main.js.map +0 -1
- package/dist/fi-FI.mjs +0 -12
- package/dist/fi-FI.module.js +0 -12
- package/dist/fi-FI.module.js.map +0 -1
- package/dist/fr-FR.main.js +0 -10
- package/dist/fr-FR.main.js.map +0 -1
- package/dist/fr-FR.mjs +0 -12
- package/dist/fr-FR.module.js +0 -12
- package/dist/fr-FR.module.js.map +0 -1
- package/dist/he-IL.main.js +0 -10
- package/dist/he-IL.main.js.map +0 -1
- package/dist/he-IL.mjs +0 -12
- package/dist/he-IL.module.js +0 -12
- package/dist/he-IL.module.js.map +0 -1
- package/dist/hr-HR.main.js +0 -10
- package/dist/hr-HR.main.js.map +0 -1
- package/dist/hr-HR.mjs +0 -12
- package/dist/hr-HR.module.js +0 -12
- package/dist/hr-HR.module.js.map +0 -1
- package/dist/hu-HU.main.js +0 -10
- package/dist/hu-HU.main.js.map +0 -1
- package/dist/hu-HU.mjs +0 -12
- package/dist/hu-HU.module.js +0 -12
- package/dist/hu-HU.module.js.map +0 -1
- package/dist/intlStrings.main.js +0 -108
- package/dist/intlStrings.main.js.map +0 -1
- package/dist/intlStrings.mjs +0 -110
- package/dist/intlStrings.module.js +0 -110
- package/dist/intlStrings.module.js.map +0 -1
- package/dist/it-IT.main.js +0 -10
- package/dist/it-IT.main.js.map +0 -1
- package/dist/it-IT.mjs +0 -12
- package/dist/it-IT.module.js +0 -12
- package/dist/it-IT.module.js.map +0 -1
- package/dist/ja-JP.main.js +0 -10
- package/dist/ja-JP.main.js.map +0 -1
- package/dist/ja-JP.mjs +0 -12
- package/dist/ja-JP.module.js +0 -12
- package/dist/ja-JP.module.js.map +0 -1
- package/dist/ko-KR.main.js +0 -10
- package/dist/ko-KR.main.js.map +0 -1
- package/dist/ko-KR.mjs +0 -12
- package/dist/ko-KR.module.js +0 -12
- package/dist/ko-KR.module.js.map +0 -1
- package/dist/lt-LT.main.js +0 -10
- package/dist/lt-LT.main.js.map +0 -1
- package/dist/lt-LT.mjs +0 -12
- package/dist/lt-LT.module.js +0 -12
- package/dist/lt-LT.module.js.map +0 -1
- package/dist/lv-LV.main.js +0 -10
- package/dist/lv-LV.main.js.map +0 -1
- package/dist/lv-LV.mjs +0 -12
- package/dist/lv-LV.module.js +0 -12
- package/dist/lv-LV.module.js.map +0 -1
- package/dist/nb-NO.main.js +0 -10
- package/dist/nb-NO.main.js.map +0 -1
- package/dist/nb-NO.mjs +0 -12
- package/dist/nb-NO.module.js +0 -12
- package/dist/nb-NO.module.js.map +0 -1
- package/dist/nl-NL.main.js +0 -10
- package/dist/nl-NL.main.js.map +0 -1
- package/dist/nl-NL.mjs +0 -12
- package/dist/nl-NL.module.js +0 -12
- package/dist/nl-NL.module.js.map +0 -1
- package/dist/pl-PL.main.js +0 -10
- package/dist/pl-PL.main.js.map +0 -1
- package/dist/pl-PL.mjs +0 -12
- package/dist/pl-PL.module.js +0 -12
- package/dist/pl-PL.module.js.map +0 -1
- package/dist/pt-BR.main.js +0 -10
- package/dist/pt-BR.main.js.map +0 -1
- package/dist/pt-BR.mjs +0 -12
- package/dist/pt-BR.module.js +0 -12
- package/dist/pt-BR.module.js.map +0 -1
- package/dist/pt-PT.main.js +0 -10
- package/dist/pt-PT.main.js.map +0 -1
- package/dist/pt-PT.mjs +0 -12
- package/dist/pt-PT.module.js +0 -12
- package/dist/pt-PT.module.js.map +0 -1
- package/dist/ro-RO.main.js +0 -10
- package/dist/ro-RO.main.js.map +0 -1
- package/dist/ro-RO.mjs +0 -12
- package/dist/ro-RO.module.js +0 -12
- package/dist/ro-RO.module.js.map +0 -1
- package/dist/ru-RU.main.js +0 -10
- package/dist/ru-RU.main.js.map +0 -1
- package/dist/ru-RU.mjs +0 -12
- package/dist/ru-RU.module.js +0 -12
- package/dist/ru-RU.module.js.map +0 -1
- package/dist/sk-SK.main.js +0 -10
- package/dist/sk-SK.main.js.map +0 -1
- package/dist/sk-SK.mjs +0 -12
- package/dist/sk-SK.module.js +0 -12
- package/dist/sk-SK.module.js.map +0 -1
- package/dist/sl-SI.main.js +0 -10
- package/dist/sl-SI.main.js.map +0 -1
- package/dist/sl-SI.mjs +0 -12
- package/dist/sl-SI.module.js +0 -12
- package/dist/sl-SI.module.js.map +0 -1
- package/dist/sr-SP.main.js +0 -10
- package/dist/sr-SP.main.js.map +0 -1
- package/dist/sr-SP.mjs +0 -12
- package/dist/sr-SP.module.js +0 -12
- package/dist/sr-SP.module.js.map +0 -1
- package/dist/sv-SE.main.js +0 -10
- package/dist/sv-SE.main.js.map +0 -1
- package/dist/sv-SE.mjs +0 -12
- package/dist/sv-SE.module.js +0 -12
- package/dist/sv-SE.module.js.map +0 -1
- package/dist/tr-TR.main.js +0 -10
- package/dist/tr-TR.main.js.map +0 -1
- package/dist/tr-TR.mjs +0 -12
- package/dist/tr-TR.module.js +0 -12
- package/dist/tr-TR.module.js.map +0 -1
- package/dist/types.d.ts +0 -96
- package/dist/types.d.ts.map +0 -1
- package/dist/uk-UA.main.js +0 -10
- package/dist/uk-UA.main.js.map +0 -1
- package/dist/uk-UA.mjs +0 -12
- package/dist/uk-UA.module.js +0 -12
- package/dist/uk-UA.module.js.map +0 -1
- package/dist/zh-CN.main.js +0 -10
- package/dist/zh-CN.main.js.map +0 -1
- package/dist/zh-CN.mjs +0 -12
- package/dist/zh-CN.module.js +0 -12
- package/dist/zh-CN.module.js.map +0 -1
- package/dist/zh-TW.main.js +0 -10
- package/dist/zh-TW.main.js.map +0 -1
- package/dist/zh-TW.mjs +0 -12
- package/dist/zh-TW.module.js +0 -12
- package/dist/zh-TW.module.js.map +0 -1
- package/src/ColorArea.tsx +0 -87
- package/src/ColorEditor.tsx +0 -60
- package/src/ColorField.tsx +0 -111
- package/src/ColorPicker.tsx +0 -120
- package/src/ColorSlider.tsx +0 -142
- package/src/ColorSwatch.tsx +0 -99
- package/src/ColorSwatchPicker.tsx +0 -115
- package/src/ColorThumb.tsx +0 -114
- package/src/ColorWheel.tsx +0 -110
- package/src/colorfield.css +0 -18
package/dist/ColorEditor.main.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
require("./color.decac5a6.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 $5cb66132bfdb0a33$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
|
-
const $ecaab91cad36cb44$export$5aa54fd21eb08d23 = /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).forwardRef(function 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($5cb66132bfdb0a33$exports))), '@react-spectrum/color');
|
|
35
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($2H14s$react))).createElement("div", {
|
|
36
|
-
className: function anonymous(props) {
|
|
37
|
-
let rules = "";
|
|
38
|
-
rules += ' s1-_Ts1-d';
|
|
39
|
-
rules += ' s1-_0s1-b';
|
|
40
|
-
rules += ' s1-ls1-e';
|
|
41
|
-
rules += ' s1-ms1-e';
|
|
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 += ' s1-_Ts1-d';
|
|
49
|
-
rules += ' s1-ls1-e';
|
|
50
|
-
rules += ' s1-ms1-e';
|
|
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 += ' s1-_Ts1-d';
|
|
68
|
-
rules += ' s1-ls1-e';
|
|
69
|
-
rules += ' s1-ms1-e';
|
|
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,
|
|
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
|
-
|
|
113
|
-
//# sourceMappingURL=ColorEditor.main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBO,MAAM,0DAAc,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,YAAY,KAA+B,EAAE,GAA2B;IAC3H,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;YAAQ,SAAS;YAAS,SAAA;YAAQ,OAAM;YAAW,MAAA;YAAK,cAAc;gBAAC,kCAAkC;YAAC;aAEnJ,CAAC,MAAM,gBAAgB,kBACtB,0DAAC,CAAA,GAAA,oCAAS;QAAE,SAAQ;QAAQ,SAAA;QAAQ,OAAM;QAAW,MAAA;QAAK,cAAc;YAAC,kCAAkC;QAAC;;AAItH","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\n/**\n * ColorEditor provides a default UI for editing colors within a ColorPicker.\n */\nexport const ColorEditor = React.forwardRef(function 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} 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"],"names":[],"version":3,"file":"ColorEditor.main.js.map"}
|
package/dist/ColorEditor.mjs
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import "./color.decac5a6.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
|
-
const $49352c629f2d8349$export$5aa54fd21eb08d23 = /*#__PURE__*/ (0, $3Vio4$react).forwardRef(function 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 += ' s1-_Ts1-d';
|
|
33
|
-
rules += ' s1-_0s1-b';
|
|
34
|
-
rules += ' s1-ls1-e';
|
|
35
|
-
rules += ' s1-ms1-e';
|
|
36
|
-
return rules;
|
|
37
|
-
}(),
|
|
38
|
-
ref: domRef
|
|
39
|
-
}, /*#__PURE__*/ (0, $3Vio4$react).createElement("div", {
|
|
40
|
-
className: function anonymous(props) {
|
|
41
|
-
let rules = "";
|
|
42
|
-
rules += ' s1-_Ts1-d';
|
|
43
|
-
rules += ' s1-ls1-e';
|
|
44
|
-
rules += ' s1-ms1-e';
|
|
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 += ' s1-_Ts1-d';
|
|
62
|
-
rules += ' s1-ls1-e';
|
|
63
|
-
rules += ' s1-ms1-e';
|
|
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,
|
|
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
|
-
|
|
107
|
-
export {$49352c629f2d8349$export$5aa54fd21eb08d23 as ColorEditor};
|
|
108
|
-
//# sourceMappingURL=ColorEditor.module.js.map
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import "./color.decac5a6.css";
|
|
2
|
-
import {ColorArea as $40046aa1a7ccb226$export$b2103f68a961418e} from "./ColorArea.module.js";
|
|
3
|
-
import {ColorField as $0077d47e004328f0$export$b865d4358897bb17} from "./ColorField.module.js";
|
|
4
|
-
import {ColorSlider as $3870e4ce67ed7ee1$export$44fd664bcca5b6fb} from "./ColorSlider.module.js";
|
|
5
|
-
import $3Vio4$intlStringsmodulejs from "./intlStrings.module.js";
|
|
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
|
-
const $49352c629f2d8349$export$5aa54fd21eb08d23 = /*#__PURE__*/ (0, $3Vio4$react).forwardRef(function 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 += ' s1-_Ts1-d';
|
|
33
|
-
rules += ' s1-_0s1-b';
|
|
34
|
-
rules += ' s1-ls1-e';
|
|
35
|
-
rules += ' s1-ms1-e';
|
|
36
|
-
return rules;
|
|
37
|
-
}(),
|
|
38
|
-
ref: domRef
|
|
39
|
-
}, /*#__PURE__*/ (0, $3Vio4$react).createElement("div", {
|
|
40
|
-
className: function anonymous(props) {
|
|
41
|
-
let rules = "";
|
|
42
|
-
rules += ' s1-_Ts1-d';
|
|
43
|
-
rules += ' s1-ls1-e';
|
|
44
|
-
rules += ' s1-ms1-e';
|
|
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 += ' s1-_Ts1-d';
|
|
62
|
-
rules += ' s1-ls1-e';
|
|
63
|
-
rules += ' s1-ms1-e';
|
|
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,
|
|
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
|
-
|
|
107
|
-
export {$49352c629f2d8349$export$5aa54fd21eb08d23 as ColorEditor};
|
|
108
|
-
//# sourceMappingURL=ColorEditor.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAsBO,MAAM,0DAAc,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,YAAY,KAA+B,EAAE,GAA2B;IAC3H,IAAI,CAAC,QAAQ,UAAU,GAAG,CAAA,GAAA,eAAO,EAAsB;IACvD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,YAAY,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAE1D,qBACE,gCAAC;QAAI,WAAW;;;;;;;;QAA6D,KAAK;qBAChF,gCAAC;QAAI,WAAW;;;;;;;qBACd,gCAAC,CAAA,GAAA,yCAAQ;QAAE,YAAW;QAAM,UAAS;QAAa,UAAS;sBAC3D,gCAAC,CAAA,GAAA,yCAAU;QAAE,YAAW;QAAM,SAAQ;QAAM,aAAY;QACvD,CAAC,MAAM,gBAAgB,kBACtB,gCAAC,CAAA,GAAA,yCAAU;QAAE,SAAQ;QAAQ,aAAY;uBAG7C,gCAAC;QAAI,WAAW;;;;;;;qBACd,gCAAC,CAAA,GAAA,aAAK;QACJ,cAAY,UAAU,MAAM,CAAC;QAC7B,SAAA;QACA,OAAM;QACN,WAAU;QACV,aAAa;QACb,mBAAmB,CAAA,IAAK,UAAU;qBAClC,gCAAC,CAAA,GAAA,WAAG;QAAE,KAAI;OAAO,UAAU,MAAM,CAAC,uBAClC,gCAAC,CAAA,GAAA,WAAG;QAAE,KAAI;OAAO,UAAU,MAAM,CAAC,uBAClC,gCAAC,CAAA,GAAA,WAAG;QAAE,KAAI;OAAO,UAAU,MAAM,CAAC,uBAClC,gCAAC,CAAA,GAAA,WAAG;QAAE,KAAI;OAAO,UAAU,MAAM,CAAC,UAEnC,WAAW,sBACR,gCAAC,CAAA,GAAA,yCAAS;QAAE,SAAA;QAAQ,OAAM;QAAY,cAAY,UAAU,MAAM,CAAC;SACnE,CAAA,GAAA,uBAAe,EAAE,QAAQ,GAAG,CAAC,CAAA,wBAC7B,gCAAC,CAAA,GAAA,yCAAS;YAAE,KAAK;YAAS,YAAY;YAAQ,SAAS;YAAS,SAAA;YAAQ,OAAM;YAAW,MAAA;YAAK,cAAc;gBAAC,kCAAkC;YAAC;aAEnJ,CAAC,MAAM,gBAAgB,kBACtB,gCAAC,CAAA,GAAA,yCAAS;QAAE,SAAQ;QAAQ,SAAA;QAAQ,OAAM;QAAW,MAAA;QAAK,cAAc;YAAC,kCAAkC;QAAC;;AAItH","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\n/**\n * ColorEditor provides a default UI for editing colors within a ColorPicker.\n */\nexport const ColorEditor = React.forwardRef(function 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} 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"],"names":[],"version":3,"file":"ColorEditor.module.js.map"}
|
package/dist/ColorField.main.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
require("./color.85d29c28.css");
|
|
2
|
-
var $ddec4d6aa21146c4$exports = require("./colorfield_css.main.js");
|
|
3
|
-
var $4ivT8$reactspectrumutils = require("@react-spectrum/utils");
|
|
4
|
-
var $4ivT8$reactariacomponents = require("react-aria-components");
|
|
5
|
-
var $4ivT8$react = require("react");
|
|
6
|
-
var $4ivT8$reactspectrumtextfield = require("@react-spectrum/textfield");
|
|
7
|
-
var $4ivT8$reactariacolor = require("@react-aria/color");
|
|
8
|
-
var $4ivT8$reactstatelycolor = require("@react-stately/color");
|
|
9
|
-
var $4ivT8$reactspectrumform = require("@react-spectrum/form");
|
|
10
|
-
var $4ivT8$reactariai18n = require("@react-aria/i18n");
|
|
11
|
-
var $4ivT8$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, "ColorField", () => $8bdb9bc27ff3debb$export$b865d4358897bb17);
|
|
23
|
-
/*
|
|
24
|
-
* Copyright 2020 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
|
-
const $8bdb9bc27ff3debb$export$b865d4358897bb17 = /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).forwardRef(function ColorField(props, ref) {
|
|
44
|
-
props = (0, $4ivT8$reactspectrumprovider.useProviderProps)(props);
|
|
45
|
-
props = (0, $4ivT8$reactspectrumform.useFormProps)(props);
|
|
46
|
-
[props] = (0, $4ivT8$reactariacomponents.useContextProps)(props, null, (0, $4ivT8$reactariacomponents.ColorFieldContext));
|
|
47
|
-
let hasWarned = (0, $4ivT8$react.useRef)(false);
|
|
48
|
-
(0, $4ivT8$react.useEffect)(()=>{
|
|
49
|
-
if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {
|
|
50
|
-
console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text');
|
|
51
|
-
hasWarned.current = true;
|
|
52
|
-
}
|
|
53
|
-
}, [
|
|
54
|
-
props.placeholder
|
|
55
|
-
]);
|
|
56
|
-
if (props.channel) return /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).createElement($8bdb9bc27ff3debb$var$ColorChannelField, {
|
|
57
|
-
...props,
|
|
58
|
-
channel: props.channel,
|
|
59
|
-
forwardedRef: ref
|
|
60
|
-
});
|
|
61
|
-
else return /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).createElement($8bdb9bc27ff3debb$var$HexColorField, {
|
|
62
|
-
...props,
|
|
63
|
-
forwardedRef: ref
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
function $8bdb9bc27ff3debb$var$ColorChannelField(props) {
|
|
67
|
-
let { value: // These disabled props are handled by the state hook
|
|
68
|
-
value, defaultValue: defaultValue, onChange: onChange, validate: validate, forwardedRef: forwardedRef, ...otherProps } = props;
|
|
69
|
-
let { locale: locale } = (0, $4ivT8$reactariai18n.useLocale)();
|
|
70
|
-
let state = (0, $4ivT8$reactstatelycolor.useColorChannelFieldState)({
|
|
71
|
-
...props,
|
|
72
|
-
locale: locale
|
|
73
|
-
});
|
|
74
|
-
let inputRef = (0, $4ivT8$react.useRef)(null);
|
|
75
|
-
let result = (0, $4ivT8$reactariacolor.useColorChannelField)(otherProps, state, inputRef);
|
|
76
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).createElement((0, ($parcel$interopDefault($4ivT8$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).createElement((0, $4ivT8$reactspectrumtextfield.TextFieldBase), {
|
|
77
|
-
...otherProps,
|
|
78
|
-
ref: forwardedRef,
|
|
79
|
-
inputRef: inputRef,
|
|
80
|
-
...result,
|
|
81
|
-
inputClassName: (0, $4ivT8$reactspectrumutils.classNames)((0, ($parcel$interopDefault($ddec4d6aa21146c4$exports))), 'react-spectrum-ColorField-input')
|
|
82
|
-
}), props.name && /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).createElement("input", {
|
|
83
|
-
type: "hidden",
|
|
84
|
-
name: props.name,
|
|
85
|
-
form: props.form,
|
|
86
|
-
value: isNaN(state.numberValue) ? '' : state.numberValue
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
89
|
-
function $8bdb9bc27ff3debb$var$HexColorField(props) {
|
|
90
|
-
let { value: // These disabled props are handled by the state hook
|
|
91
|
-
value, defaultValue: defaultValue, onChange: onChange, forwardedRef: forwardedRef, ...otherProps } = props;
|
|
92
|
-
let state = (0, $4ivT8$reactstatelycolor.useColorFieldState)(props);
|
|
93
|
-
let inputRef = (0, $4ivT8$react.useRef)(null);
|
|
94
|
-
let result = (0, $4ivT8$reactariacolor.useColorField)(otherProps, state, inputRef);
|
|
95
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).createElement((0, $4ivT8$reactspectrumtextfield.TextFieldBase), {
|
|
96
|
-
...otherProps,
|
|
97
|
-
ref: forwardedRef,
|
|
98
|
-
inputRef: inputRef,
|
|
99
|
-
...result,
|
|
100
|
-
inputClassName: (0, $4ivT8$reactspectrumutils.classNames)((0, ($parcel$interopDefault($ddec4d6aa21146c4$exports))), 'react-spectrum-ColorField-input')
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
//# sourceMappingURL=ColorField.main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAkBM,MAAM,0DAAa,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,WAAW,KAA8B,EAAE,GAAsB;IACnH,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,CAAC,MAAM,GAAG,CAAA,GAAA,0CAAc,EAAE,OAAO,MAAM,CAAA,GAAA,4CAAgB;IAEvD,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,MAAM,WAAW,IAAI,CAAC,UAAU,OAAO,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAAc;YACpF,QAAQ,IAAI,CAAC;YACb,UAAU,OAAO,GAAG;QACtB;IACF,GAAG;QAAC,MAAM,WAAW;KAAC;IAEtB,IAAI,MAAM,OAAO,EACf,qBAAO,0DAAC;QAAmB,GAAG,KAAK;QAAE,SAAS,MAAM,OAAO;QAAE,cAAc;;SAE3E,qBAAO,0DAAC;QAAe,GAAG,KAAK;QAAE,cAAc;;AAEnD;AAOA,SAAS,wCAAkB,KAA6B;IACtD,IAAI,SACF,qDAAqD;IACrD,KAAK,gBACL,YAAY,YACZ,QAAQ,YACR,QAAQ,gBACR,YAAY,EACZ,GAAG,YACJ,GAAG;IACJ,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,8BAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,kDAAwB,EAAE;QACpC,GAAG,KAAK;gBACR;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA0C;IAC9D,IAAI,SAAS,CAAA,GAAA,0CAAmB,EAAE,YAAY,OAAO;IAErD,qBACE,oIACE,0DAAC,CAAA,GAAA,2CAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QACpC,MAAM,IAAI,kBAAI,0DAAC;QAAM,MAAK;QAAS,MAAM,MAAM,IAAI;QAAE,MAAM,MAAM,IAAI;QAAE,OAAO,MAAM,MAAM,WAAW,IAAI,KAAK,MAAM,WAAW;;AAGtI;AAMA,SAAS,oCAAc,KAAyB;IAC9C,IAAI,SACF,qDAAqD;IACrD,KAAK,gBACL,YAAY,YACZ,QAAQ,gBACR,YAAY,EACZ,GAAG,YACJ,GAAG;IACJ,IAAI,QAAQ,CAAA,GAAA,2CAAiB,EAAE;IAC/B,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA0C;IAC9D,IAAI,SAAS,CAAA,GAAA,mCAAY,EAAE,YAAY,OAAO;IAE9C,qBACE,0DAAC,CAAA,GAAA,2CAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;;AAEzC","sources":["packages/@react-spectrum/color/src/ColorField.tsx"],"sourcesContent":["/*\n * Copyright 2020 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} from '@react-spectrum/utils';\nimport {ColorChannel, SpectrumColorFieldProps} from '@react-types/color';\nimport {ColorFieldContext, useContextProps} from 'react-aria-components';\nimport React, {Ref, useEffect, useRef} from 'react';\nimport styles from './colorfield.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useColorChannelField, useColorField} from '@react-aria/color';\nimport {useColorChannelFieldState, useColorFieldState} from '@react-stately/color';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n/**\n * A color field allows users to edit a hex color or individual color channel value.\n */\nexport const ColorField = React.forwardRef(function ColorField(props: SpectrumColorFieldProps, ref: Ref<TextFieldRef>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n [props] = useContextProps(props, null, ColorFieldContext);\n \n let hasWarned = useRef(false);\n useEffect(() => {\n if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text');\n hasWarned.current = true;\n }\n }, [props.placeholder]);\n\n if (props.channel) {\n return <ColorChannelField {...props} channel={props.channel} forwardedRef={ref} />;\n } else {\n return <HexColorField {...props} forwardedRef={ref} />;\n }\n});\n\ninterface ColorChannelFieldProps extends Omit<SpectrumColorFieldProps, 'channel'> {\n channel: ColorChannel,\n forwardedRef: Ref<TextFieldRef>\n}\n\nfunction ColorChannelField(props: ColorChannelFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n validate, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let {locale} = useLocale();\n let state = useColorChannelFieldState({\n ...props,\n locale\n });\n\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorChannelField(otherProps, state, inputRef);\n\n return (\n <>\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')} />\n {props.name && <input type=\"hidden\" name={props.name} form={props.form} value={isNaN(state.numberValue) ? '' : state.numberValue} />}\n </>\n );\n}\n\ninterface HexColorFieldProps extends SpectrumColorFieldProps {\n forwardedRef: Ref<TextFieldRef>\n}\n\nfunction HexColorField(props: HexColorFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let state = useColorFieldState(props);\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorField(otherProps, state, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')} />\n );\n}\n"],"names":[],"version":3,"file":"ColorField.main.js.map"}
|
package/dist/ColorField.mjs
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import "./color.85d29c28.css";
|
|
2
|
-
import $b4uus$colorfield_cssmodulejs from "./colorfield_css.mjs";
|
|
3
|
-
import {classNames as $b4uus$classNames} from "@react-spectrum/utils";
|
|
4
|
-
import {useContextProps as $b4uus$useContextProps, ColorFieldContext as $b4uus$ColorFieldContext} from "react-aria-components";
|
|
5
|
-
import $b4uus$react, {useRef as $b4uus$useRef, useEffect as $b4uus$useEffect} from "react";
|
|
6
|
-
import {TextFieldBase as $b4uus$TextFieldBase} from "@react-spectrum/textfield";
|
|
7
|
-
import {useColorChannelField as $b4uus$useColorChannelField, useColorField as $b4uus$useColorField} from "@react-aria/color";
|
|
8
|
-
import {useColorChannelFieldState as $b4uus$useColorChannelFieldState, useColorFieldState as $b4uus$useColorFieldState} from "@react-stately/color";
|
|
9
|
-
import {useFormProps as $b4uus$useFormProps} from "@react-spectrum/form";
|
|
10
|
-
import {useLocale as $b4uus$useLocale} from "@react-aria/i18n";
|
|
11
|
-
import {useProviderProps as $b4uus$useProviderProps} from "@react-spectrum/provider";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function $parcel$interopDefault(a) {
|
|
15
|
-
return a && a.__esModule ? a.default : a;
|
|
16
|
-
}
|
|
17
|
-
/*
|
|
18
|
-
* Copyright 2020 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
|
-
const $0077d47e004328f0$export$b865d4358897bb17 = /*#__PURE__*/ (0, $b4uus$react).forwardRef(function ColorField(props, ref) {
|
|
38
|
-
props = (0, $b4uus$useProviderProps)(props);
|
|
39
|
-
props = (0, $b4uus$useFormProps)(props);
|
|
40
|
-
[props] = (0, $b4uus$useContextProps)(props, null, (0, $b4uus$ColorFieldContext));
|
|
41
|
-
let hasWarned = (0, $b4uus$useRef)(false);
|
|
42
|
-
(0, $b4uus$useEffect)(()=>{
|
|
43
|
-
if (props.placeholder && !hasWarned.current && process.env.NODE_ENV !== 'production') {
|
|
44
|
-
console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text');
|
|
45
|
-
hasWarned.current = true;
|
|
46
|
-
}
|
|
47
|
-
}, [
|
|
48
|
-
props.placeholder
|
|
49
|
-
]);
|
|
50
|
-
if (props.channel) return /*#__PURE__*/ (0, $b4uus$react).createElement($0077d47e004328f0$var$ColorChannelField, {
|
|
51
|
-
...props,
|
|
52
|
-
channel: props.channel,
|
|
53
|
-
forwardedRef: ref
|
|
54
|
-
});
|
|
55
|
-
else return /*#__PURE__*/ (0, $b4uus$react).createElement($0077d47e004328f0$var$HexColorField, {
|
|
56
|
-
...props,
|
|
57
|
-
forwardedRef: ref
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
function $0077d47e004328f0$var$ColorChannelField(props) {
|
|
61
|
-
let { value: // These disabled props are handled by the state hook
|
|
62
|
-
value, defaultValue: defaultValue, onChange: onChange, validate: validate, forwardedRef: forwardedRef, ...otherProps } = props;
|
|
63
|
-
let { locale: locale } = (0, $b4uus$useLocale)();
|
|
64
|
-
let state = (0, $b4uus$useColorChannelFieldState)({
|
|
65
|
-
...props,
|
|
66
|
-
locale: locale
|
|
67
|
-
});
|
|
68
|
-
let inputRef = (0, $b4uus$useRef)(null);
|
|
69
|
-
let result = (0, $b4uus$useColorChannelField)(otherProps, state, inputRef);
|
|
70
|
-
return /*#__PURE__*/ (0, $b4uus$react).createElement((0, $b4uus$react).Fragment, null, /*#__PURE__*/ (0, $b4uus$react).createElement((0, $b4uus$TextFieldBase), {
|
|
71
|
-
...otherProps,
|
|
72
|
-
ref: forwardedRef,
|
|
73
|
-
inputRef: inputRef,
|
|
74
|
-
...result,
|
|
75
|
-
inputClassName: (0, $b4uus$classNames)((0, ($parcel$interopDefault($b4uus$colorfield_cssmodulejs))), 'react-spectrum-ColorField-input')
|
|
76
|
-
}), props.name && /*#__PURE__*/ (0, $b4uus$react).createElement("input", {
|
|
77
|
-
type: "hidden",
|
|
78
|
-
name: props.name,
|
|
79
|
-
form: props.form,
|
|
80
|
-
value: isNaN(state.numberValue) ? '' : state.numberValue
|
|
81
|
-
}));
|
|
82
|
-
}
|
|
83
|
-
function $0077d47e004328f0$var$HexColorField(props) {
|
|
84
|
-
let { value: // These disabled props are handled by the state hook
|
|
85
|
-
value, defaultValue: defaultValue, onChange: onChange, forwardedRef: forwardedRef, ...otherProps } = props;
|
|
86
|
-
let state = (0, $b4uus$useColorFieldState)(props);
|
|
87
|
-
let inputRef = (0, $b4uus$useRef)(null);
|
|
88
|
-
let result = (0, $b4uus$useColorField)(otherProps, state, inputRef);
|
|
89
|
-
return /*#__PURE__*/ (0, $b4uus$react).createElement((0, $b4uus$TextFieldBase), {
|
|
90
|
-
...otherProps,
|
|
91
|
-
ref: forwardedRef,
|
|
92
|
-
inputRef: inputRef,
|
|
93
|
-
...result,
|
|
94
|
-
inputClassName: (0, $b4uus$classNames)((0, ($parcel$interopDefault($b4uus$colorfield_cssmodulejs))), 'react-spectrum-ColorField-input')
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
export {$0077d47e004328f0$export$b865d4358897bb17 as ColorField};
|
|
100
|
-
//# sourceMappingURL=ColorField.module.js.map
|