@react-spectrum/color 3.0.0-nightly.4555 → 3.0.0-nightly.4558

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 (79) hide show
  1. package/dist/ColorArea.main.js +97 -0
  2. package/dist/ColorArea.main.js.map +1 -0
  3. package/dist/ColorArea.mjs +92 -0
  4. package/dist/ColorArea.module.js +92 -0
  5. package/dist/ColorArea.module.js.map +1 -0
  6. package/dist/ColorField.main.js +61 -0
  7. package/dist/ColorField.main.js.map +1 -0
  8. package/dist/ColorField.mjs +56 -0
  9. package/dist/ColorField.module.js +56 -0
  10. package/dist/ColorField.module.js.map +1 -0
  11. package/dist/ColorSlider.main.js +125 -0
  12. package/dist/ColorSlider.main.js.map +1 -0
  13. package/dist/ColorSlider.mjs +120 -0
  14. package/dist/ColorSlider.module.js +120 -0
  15. package/dist/ColorSlider.module.js.map +1 -0
  16. package/dist/ColorThumb.main.js +94 -0
  17. package/dist/ColorThumb.main.js.map +1 -0
  18. package/dist/ColorThumb.mjs +89 -0
  19. package/dist/ColorThumb.module.js +89 -0
  20. package/dist/ColorThumb.module.js.map +1 -0
  21. package/dist/ColorWheel.main.js +114 -0
  22. package/dist/ColorWheel.main.js.map +1 -0
  23. package/dist/ColorWheel.mjs +109 -0
  24. package/dist/ColorWheel.module.js +109 -0
  25. package/dist/ColorWheel.module.js.map +1 -0
  26. package/dist/colorarea_vars_css.main.js +32 -0
  27. package/dist/colorarea_vars_css.main.js.map +1 -0
  28. package/dist/colorarea_vars_css.mjs +34 -0
  29. package/dist/colorarea_vars_css.module.js +34 -0
  30. package/dist/colorarea_vars_css.module.js.map +1 -0
  31. package/dist/colorfield.faeff3c2.css +12 -0
  32. package/dist/colorfield.faeff3c2.css.map +1 -0
  33. package/dist/colorfield_css.main.js +11 -0
  34. package/dist/colorfield_css.main.js.map +1 -0
  35. package/dist/colorfield_css.mjs +13 -0
  36. package/dist/colorfield_css.module.js +13 -0
  37. package/dist/colorfield_css.module.js.map +1 -0
  38. package/dist/colorhandle_vars_css.main.js +26 -0
  39. package/dist/colorhandle_vars_css.main.js.map +1 -0
  40. package/dist/colorhandle_vars_css.mjs +28 -0
  41. package/dist/colorhandle_vars_css.module.js +28 -0
  42. package/dist/colorhandle_vars_css.module.js.map +1 -0
  43. package/dist/colorloupe_vars_css.main.js +23 -0
  44. package/dist/colorloupe_vars_css.main.js.map +1 -0
  45. package/dist/colorloupe_vars_css.mjs +25 -0
  46. package/dist/colorloupe_vars_css.module.js +25 -0
  47. package/dist/colorloupe_vars_css.module.js.map +1 -0
  48. package/dist/colorslider_vars_css.main.js +53 -0
  49. package/dist/colorslider_vars_css.main.js.map +1 -0
  50. package/dist/colorslider_vars_css.mjs +55 -0
  51. package/dist/colorslider_vars_css.module.js +55 -0
  52. package/dist/colorslider_vars_css.module.js.map +1 -0
  53. package/dist/colorwheel_vars_css.main.js +35 -0
  54. package/dist/colorwheel_vars_css.main.js.map +1 -0
  55. package/dist/colorwheel_vars_css.mjs +37 -0
  56. package/dist/colorwheel_vars_css.module.js +37 -0
  57. package/dist/colorwheel_vars_css.module.js.map +1 -0
  58. package/dist/import.mjs +4 -550
  59. package/dist/main.js +8 -550
  60. package/dist/main.js.map +1 -1
  61. package/dist/module.js +4 -550
  62. package/dist/module.js.map +1 -1
  63. package/dist/types.d.ts +3 -3
  64. package/dist/types.d.ts.map +1 -1
  65. package/dist/vars.08ba4b4c.css +76 -0
  66. package/dist/vars.08ba4b4c.css.map +1 -0
  67. package/dist/vars.571f903e.css +120 -0
  68. package/dist/vars.571f903e.css.map +1 -0
  69. package/dist/vars.6f3d3943.css +105 -0
  70. package/dist/vars.6f3d3943.css.map +1 -0
  71. package/dist/vars.ac235018.css +93 -0
  72. package/dist/vars.ac235018.css.map +1 -0
  73. package/dist/vars.ef2c01b8.css +41 -0
  74. package/dist/vars.ef2c01b8.css.map +1 -0
  75. package/package.json +16 -16
  76. package/dist/main.css +0 -447
  77. package/dist/main.css.map +0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AS,EAAE,CAAA,GAAA,mDAAK,GAAG;;AAK9F;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/color/src/ColorSlider.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, SlotProvider, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {ColorThumb} from './ColorThumb';\nimport {FocusableRef} from '@react-types/shared';\nimport {Label} from '@react-spectrum/label';\nimport React, {useRef, useState} from 'react';\nimport {SpectrumColorSliderProps} from '@react-types/color';\nimport styles from '@adobe/spectrum-css-temp/components/colorslider/vars.css';\nimport {useColorSlider} from '@react-aria/color';\nimport {useColorSliderState} from '@react-stately/color';\nimport {useFocus, useFocusVisible} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nfunction ColorSlider(props: SpectrumColorSliderProps, ref: FocusableRef<HTMLDivElement>) {\n props = useProviderProps(props);\n\n let {\n isDisabled,\n channel,\n orientation,\n label,\n showValueLabel,\n 'aria-label': ariaLabel\n } = props;\n let vertical = orientation === 'vertical';\n\n let {styleProps} = useStyleProps(props);\n let {locale} = useLocale();\n\n let inputRef = useRef(null);\n let trackRef = useRef(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let state = useColorSliderState({...props, locale});\n\n // If vertical and a label is provided, use it as an aria-label instead.\n if (vertical && label) {\n ariaLabel = ariaLabel || (typeof label === 'string' ? label : undefined);\n label = null;\n }\n\n // If no external label, aria-label or aria-labelledby is provided,\n // default to displaying the localized channel value.\n // Specifically check if label is undefined. If label is `null` then display no visible label.\n // A default aria-label is provided by useColorSlider in that case.\n if (label === undefined && !ariaLabel && !props['aria-labelledby'] && !vertical) {\n label = state.value.getChannelName(channel, locale);\n }\n\n // Show the value label by default if there is a visible label\n if (showValueLabel == null) {\n showValueLabel = !!label;\n }\n\n let {inputProps, thumbProps, trackProps, labelProps, outputProps} = useColorSlider({\n ...props,\n label,\n 'aria-label': ariaLabel,\n trackRef,\n inputRef\n }, state);\n\n let {isFocusVisible} = useFocusVisible();\n let [isFocused, setIsFocused] = useState(false);\n let {focusProps} = useFocus({\n isDisabled,\n onFocusChange: setIsFocused\n });\n\n return (\n <div\n ref={domRef}\n {...styleProps}\n className={classNames(\n styles,\n {\n 'spectrum-ColorSlider-container--horizontal': !vertical,\n 'spectrum-ColorSlider-container--vertical': vertical\n }\n )}>\n {label &&\n <div className={classNames(styles, 'spectrum-ColorSlider-labelContainer')}>\n <Label {...labelProps}>{label}</Label>\n {props.contextualHelp &&\n <SlotProvider\n slots={{\n actionButton: {\n UNSAFE_className: classNames(styles, 'spectrum-ColorSlider-contextualHelp')\n }\n }}>\n {props.contextualHelp}\n </SlotProvider>\n }\n {showValueLabel && (\n <Label elementType=\"span\" UNSAFE_className={classNames(styles, 'spectrum-ColorSlider-valueLabel')}>\n <output {...outputProps}>{state.value.formatChannelValue(channel, locale)}</output>\n </Label>\n )}\n </div>\n }\n <div\n {...trackProps}\n ref={trackRef}\n className={classNames(\n styles,\n 'spectrum-ColorSlider', {\n 'is-disabled': isDisabled,\n 'spectrum-ColorSlider--vertical': vertical\n }\n )\n }>\n <ColorThumb\n value={state.getDisplayColor()}\n isFocused={isFocused && isFocusVisible}\n isDisabled={isDisabled}\n isDragging={state.isThumbDragging(0)}\n className={classNames(styles, 'spectrum-ColorSlider-handle')}\n {...thumbProps}>\n <input {...inputProps} {...focusProps} ref={inputRef} className={classNames(styles, 'spectrum-ColorSlider-slider')} />\n </ColorThumb>\n </div>\n </div>\n );\n}\n\n/**\n * ColorSliders allow users to adjust an individual channel of a color value.\n */\nlet _ColorSlider = React.forwardRef(ColorSlider);\nexport {_ColorSlider as ColorSlider};\n"],"names":[],"version":3,"file":"ColorSlider.main.js.map"}
@@ -0,0 +1,120 @@
1
+ import {ColorThumb as $3a90e89d07d7bbd5$export$a3cc47cee1c1ccc} from "./ColorThumb.mjs";
2
+ import "./vars.571f903e.css";
3
+ import $fxUYb$colorslider_vars_cssmodulejs from "./colorslider_vars_css.mjs";
4
+ import {useStyleProps as $fxUYb$useStyleProps, useFocusableRef as $fxUYb$useFocusableRef, classNames as $fxUYb$classNames, SlotProvider as $fxUYb$SlotProvider} from "@react-spectrum/utils";
5
+ import {Label as $fxUYb$Label} from "@react-spectrum/label";
6
+ import $fxUYb$react, {useRef as $fxUYb$useRef, useState as $fxUYb$useState} from "react";
7
+ import {useColorSlider as $fxUYb$useColorSlider} from "@react-aria/color";
8
+ import {useColorSliderState as $fxUYb$useColorSliderState} from "@react-stately/color";
9
+ import {useFocusVisible as $fxUYb$useFocusVisible, useFocus as $fxUYb$useFocus} from "@react-aria/interactions";
10
+ import {useLocale as $fxUYb$useLocale} from "@react-aria/i18n";
11
+ import {useProviderProps as $fxUYb$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
+ function $3870e4ce67ed7ee1$var$ColorSlider(props, ref) {
38
+ props = (0, $fxUYb$useProviderProps)(props);
39
+ let { isDisabled: isDisabled, channel: channel, orientation: orientation, label: label, showValueLabel: showValueLabel, "aria-label": ariaLabel } = props;
40
+ let vertical = orientation === "vertical";
41
+ let { styleProps: styleProps } = (0, $fxUYb$useStyleProps)(props);
42
+ let { locale: locale } = (0, $fxUYb$useLocale)();
43
+ let inputRef = (0, $fxUYb$useRef)(null);
44
+ let trackRef = (0, $fxUYb$useRef)(null);
45
+ let domRef = (0, $fxUYb$useFocusableRef)(ref, inputRef);
46
+ let state = (0, $fxUYb$useColorSliderState)({
47
+ ...props,
48
+ locale: locale
49
+ });
50
+ // If vertical and a label is provided, use it as an aria-label instead.
51
+ if (vertical && label) {
52
+ ariaLabel = ariaLabel || (typeof label === "string" ? label : undefined);
53
+ label = null;
54
+ }
55
+ // If no external label, aria-label or aria-labelledby is provided,
56
+ // default to displaying the localized channel value.
57
+ // Specifically check if label is undefined. If label is `null` then display no visible label.
58
+ // A default aria-label is provided by useColorSlider in that case.
59
+ if (label === undefined && !ariaLabel && !props["aria-labelledby"] && !vertical) label = state.value.getChannelName(channel, locale);
60
+ // Show the value label by default if there is a visible label
61
+ if (showValueLabel == null) showValueLabel = !!label;
62
+ let { inputProps: inputProps, thumbProps: thumbProps, trackProps: trackProps, labelProps: labelProps, outputProps: outputProps } = (0, $fxUYb$useColorSlider)({
63
+ ...props,
64
+ label: label,
65
+ "aria-label": ariaLabel,
66
+ trackRef: trackRef,
67
+ inputRef: inputRef
68
+ }, state);
69
+ let { isFocusVisible: isFocusVisible } = (0, $fxUYb$useFocusVisible)();
70
+ let [isFocused, setIsFocused] = (0, $fxUYb$useState)(false);
71
+ let { focusProps: focusProps } = (0, $fxUYb$useFocus)({
72
+ isDisabled: isDisabled,
73
+ onFocusChange: setIsFocused
74
+ });
75
+ return /*#__PURE__*/ (0, $fxUYb$react).createElement("div", {
76
+ ref: domRef,
77
+ ...styleProps,
78
+ className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), {
79
+ "spectrum-ColorSlider-container--horizontal": !vertical,
80
+ "spectrum-ColorSlider-container--vertical": vertical
81
+ })
82
+ }, label && /*#__PURE__*/ (0, $fxUYb$react).createElement("div", {
83
+ className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), "spectrum-ColorSlider-labelContainer")
84
+ }, /*#__PURE__*/ (0, $fxUYb$react).createElement((0, $fxUYb$Label), labelProps, label), props.contextualHelp && /*#__PURE__*/ (0, $fxUYb$react).createElement((0, $fxUYb$SlotProvider), {
85
+ slots: {
86
+ actionButton: {
87
+ UNSAFE_className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), "spectrum-ColorSlider-contextualHelp")
88
+ }
89
+ }
90
+ }, props.contextualHelp), showValueLabel && /*#__PURE__*/ (0, $fxUYb$react).createElement((0, $fxUYb$Label), {
91
+ elementType: "span",
92
+ UNSAFE_className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), "spectrum-ColorSlider-valueLabel")
93
+ }, /*#__PURE__*/ (0, $fxUYb$react).createElement("output", outputProps, state.value.formatChannelValue(channel, locale)))), /*#__PURE__*/ (0, $fxUYb$react).createElement("div", {
94
+ ...trackProps,
95
+ ref: trackRef,
96
+ className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), "spectrum-ColorSlider", {
97
+ "is-disabled": isDisabled,
98
+ "spectrum-ColorSlider--vertical": vertical
99
+ })
100
+ }, /*#__PURE__*/ (0, $fxUYb$react).createElement((0, $3a90e89d07d7bbd5$export$a3cc47cee1c1ccc), {
101
+ value: state.getDisplayColor(),
102
+ isFocused: isFocused && isFocusVisible,
103
+ isDisabled: isDisabled,
104
+ isDragging: state.isThumbDragging(0),
105
+ className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), "spectrum-ColorSlider-handle"),
106
+ ...thumbProps
107
+ }, /*#__PURE__*/ (0, $fxUYb$react).createElement("input", {
108
+ ...inputProps,
109
+ ...focusProps,
110
+ ref: inputRef,
111
+ className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), "spectrum-ColorSlider-slider")
112
+ }))));
113
+ }
114
+ /**
115
+ * ColorSliders allow users to adjust an individual channel of a color value.
116
+ */ let $3870e4ce67ed7ee1$export$44fd664bcca5b6fb = /*#__PURE__*/ (0, $fxUYb$react).forwardRef($3870e4ce67ed7ee1$var$ColorSlider);
117
+
118
+
119
+ export {$3870e4ce67ed7ee1$export$44fd664bcca5b6fb as ColorSlider};
120
+ //# sourceMappingURL=ColorSlider.mjs.map
@@ -0,0 +1,120 @@
1
+ import {ColorThumb as $3a90e89d07d7bbd5$export$a3cc47cee1c1ccc} from "./ColorThumb.module.js";
2
+ import "./vars.571f903e.css";
3
+ import $fxUYb$colorslider_vars_cssmodulejs from "./colorslider_vars_css.module.js";
4
+ import {useStyleProps as $fxUYb$useStyleProps, useFocusableRef as $fxUYb$useFocusableRef, classNames as $fxUYb$classNames, SlotProvider as $fxUYb$SlotProvider} from "@react-spectrum/utils";
5
+ import {Label as $fxUYb$Label} from "@react-spectrum/label";
6
+ import $fxUYb$react, {useRef as $fxUYb$useRef, useState as $fxUYb$useState} from "react";
7
+ import {useColorSlider as $fxUYb$useColorSlider} from "@react-aria/color";
8
+ import {useColorSliderState as $fxUYb$useColorSliderState} from "@react-stately/color";
9
+ import {useFocusVisible as $fxUYb$useFocusVisible, useFocus as $fxUYb$useFocus} from "@react-aria/interactions";
10
+ import {useLocale as $fxUYb$useLocale} from "@react-aria/i18n";
11
+ import {useProviderProps as $fxUYb$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
+ function $3870e4ce67ed7ee1$var$ColorSlider(props, ref) {
38
+ props = (0, $fxUYb$useProviderProps)(props);
39
+ let { isDisabled: isDisabled, channel: channel, orientation: orientation, label: label, showValueLabel: showValueLabel, "aria-label": ariaLabel } = props;
40
+ let vertical = orientation === "vertical";
41
+ let { styleProps: styleProps } = (0, $fxUYb$useStyleProps)(props);
42
+ let { locale: locale } = (0, $fxUYb$useLocale)();
43
+ let inputRef = (0, $fxUYb$useRef)(null);
44
+ let trackRef = (0, $fxUYb$useRef)(null);
45
+ let domRef = (0, $fxUYb$useFocusableRef)(ref, inputRef);
46
+ let state = (0, $fxUYb$useColorSliderState)({
47
+ ...props,
48
+ locale: locale
49
+ });
50
+ // If vertical and a label is provided, use it as an aria-label instead.
51
+ if (vertical && label) {
52
+ ariaLabel = ariaLabel || (typeof label === "string" ? label : undefined);
53
+ label = null;
54
+ }
55
+ // If no external label, aria-label or aria-labelledby is provided,
56
+ // default to displaying the localized channel value.
57
+ // Specifically check if label is undefined. If label is `null` then display no visible label.
58
+ // A default aria-label is provided by useColorSlider in that case.
59
+ if (label === undefined && !ariaLabel && !props["aria-labelledby"] && !vertical) label = state.value.getChannelName(channel, locale);
60
+ // Show the value label by default if there is a visible label
61
+ if (showValueLabel == null) showValueLabel = !!label;
62
+ let { inputProps: inputProps, thumbProps: thumbProps, trackProps: trackProps, labelProps: labelProps, outputProps: outputProps } = (0, $fxUYb$useColorSlider)({
63
+ ...props,
64
+ label: label,
65
+ "aria-label": ariaLabel,
66
+ trackRef: trackRef,
67
+ inputRef: inputRef
68
+ }, state);
69
+ let { isFocusVisible: isFocusVisible } = (0, $fxUYb$useFocusVisible)();
70
+ let [isFocused, setIsFocused] = (0, $fxUYb$useState)(false);
71
+ let { focusProps: focusProps } = (0, $fxUYb$useFocus)({
72
+ isDisabled: isDisabled,
73
+ onFocusChange: setIsFocused
74
+ });
75
+ return /*#__PURE__*/ (0, $fxUYb$react).createElement("div", {
76
+ ref: domRef,
77
+ ...styleProps,
78
+ className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), {
79
+ "spectrum-ColorSlider-container--horizontal": !vertical,
80
+ "spectrum-ColorSlider-container--vertical": vertical
81
+ })
82
+ }, label && /*#__PURE__*/ (0, $fxUYb$react).createElement("div", {
83
+ className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), "spectrum-ColorSlider-labelContainer")
84
+ }, /*#__PURE__*/ (0, $fxUYb$react).createElement((0, $fxUYb$Label), labelProps, label), props.contextualHelp && /*#__PURE__*/ (0, $fxUYb$react).createElement((0, $fxUYb$SlotProvider), {
85
+ slots: {
86
+ actionButton: {
87
+ UNSAFE_className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), "spectrum-ColorSlider-contextualHelp")
88
+ }
89
+ }
90
+ }, props.contextualHelp), showValueLabel && /*#__PURE__*/ (0, $fxUYb$react).createElement((0, $fxUYb$Label), {
91
+ elementType: "span",
92
+ UNSAFE_className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), "spectrum-ColorSlider-valueLabel")
93
+ }, /*#__PURE__*/ (0, $fxUYb$react).createElement("output", outputProps, state.value.formatChannelValue(channel, locale)))), /*#__PURE__*/ (0, $fxUYb$react).createElement("div", {
94
+ ...trackProps,
95
+ ref: trackRef,
96
+ className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), "spectrum-ColorSlider", {
97
+ "is-disabled": isDisabled,
98
+ "spectrum-ColorSlider--vertical": vertical
99
+ })
100
+ }, /*#__PURE__*/ (0, $fxUYb$react).createElement((0, $3a90e89d07d7bbd5$export$a3cc47cee1c1ccc), {
101
+ value: state.getDisplayColor(),
102
+ isFocused: isFocused && isFocusVisible,
103
+ isDisabled: isDisabled,
104
+ isDragging: state.isThumbDragging(0),
105
+ className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), "spectrum-ColorSlider-handle"),
106
+ ...thumbProps
107
+ }, /*#__PURE__*/ (0, $fxUYb$react).createElement("input", {
108
+ ...inputProps,
109
+ ...focusProps,
110
+ ref: inputRef,
111
+ className: (0, $fxUYb$classNames)((0, ($parcel$interopDefault($fxUYb$colorslider_vars_cssmodulejs))), "spectrum-ColorSlider-slider")
112
+ }))));
113
+ }
114
+ /**
115
+ * ColorSliders allow users to adjust an individual channel of a color value.
116
+ */ let $3870e4ce67ed7ee1$export$44fd664bcca5b6fb = /*#__PURE__*/ (0, $fxUYb$react).forwardRef($3870e4ce67ed7ee1$var$ColorSlider);
117
+
118
+
119
+ export {$3870e4ce67ed7ee1$export$44fd664bcca5b6fb as ColorSlider};
120
+ //# sourceMappingURL=ColorSlider.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAeD,SAAS,kCAAY,KAA+B,EAAE,GAAiC;IACrF,QAAQ,CAAA,GAAA,uBAAe,EAAE;IAEzB,IAAI,cACF,UAAU,WACV,OAAO,eACP,WAAW,SACX,KAAK,kBACL,cAAc,EACd,cAAc,SAAS,EACxB,GAAG;IACJ,IAAI,WAAW,gBAAgB;IAE/B,IAAI,cAAC,UAAU,EAAC,G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E,CAAA,GAAA,6DAAK,GAAG;qBACjC,gCAAC,CAAA,GAAA,YAAI,GAAM,YAAa,QACvB,MAAM,cAAc,kBACnB,gCAAC,CAAA,GAAA,mBAAW;QACV,OAAO;YACL,cAAc;gBACZ,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,6DAAK,GAAG;YACvC;QACF;OACC,MAAM,cAAc,GAGxB,gCACC,gCAAC,CAAA,GAAA,YAAI;QAAE,aAAY;QAAO,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,6DAAK,GAAG;qBAC7D,gCAAC,UAAW,aAAc,MAAM,KAAK,CAAC,kBAAkB,CAAC,SAAS,0BAK1E,gCAAC;QACE,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAClB,CAAA,GAAA,6DAAK,GACL,wBAAwB;YACtB,eAAe;YACf,kCAAkC;QACpC;qBAGF,gCAAC,CAAA,GAAA,wCAAS;QACR,OAAO,MAAM,eAAe;QAC5B,WAAW,aAAa;QACxB,YAAY;QACZ,YAAY,MAAM,eAAe,CAAC;QAClC,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,6DAAK,GAAG;QAC7B,GAAG,UAAU;qBACd,gCAAC;QAAO,GAAG,UAAU;QAAG,GAAG,UAAU;QAAE,KAAK;QAAU,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,6DAAK,GAAG;;AAK9F;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/color/src/ColorSlider.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, SlotProvider, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport {ColorThumb} from './ColorThumb';\nimport {FocusableRef} from '@react-types/shared';\nimport {Label} from '@react-spectrum/label';\nimport React, {useRef, useState} from 'react';\nimport {SpectrumColorSliderProps} from '@react-types/color';\nimport styles from '@adobe/spectrum-css-temp/components/colorslider/vars.css';\nimport {useColorSlider} from '@react-aria/color';\nimport {useColorSliderState} from '@react-stately/color';\nimport {useFocus, useFocusVisible} from '@react-aria/interactions';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nfunction ColorSlider(props: SpectrumColorSliderProps, ref: FocusableRef<HTMLDivElement>) {\n props = useProviderProps(props);\n\n let {\n isDisabled,\n channel,\n orientation,\n label,\n showValueLabel,\n 'aria-label': ariaLabel\n } = props;\n let vertical = orientation === 'vertical';\n\n let {styleProps} = useStyleProps(props);\n let {locale} = useLocale();\n\n let inputRef = useRef(null);\n let trackRef = useRef(null);\n let domRef = useFocusableRef(ref, inputRef);\n\n let state = useColorSliderState({...props, locale});\n\n // If vertical and a label is provided, use it as an aria-label instead.\n if (vertical && label) {\n ariaLabel = ariaLabel || (typeof label === 'string' ? label : undefined);\n label = null;\n }\n\n // If no external label, aria-label or aria-labelledby is provided,\n // default to displaying the localized channel value.\n // Specifically check if label is undefined. If label is `null` then display no visible label.\n // A default aria-label is provided by useColorSlider in that case.\n if (label === undefined && !ariaLabel && !props['aria-labelledby'] && !vertical) {\n label = state.value.getChannelName(channel, locale);\n }\n\n // Show the value label by default if there is a visible label\n if (showValueLabel == null) {\n showValueLabel = !!label;\n }\n\n let {inputProps, thumbProps, trackProps, labelProps, outputProps} = useColorSlider({\n ...props,\n label,\n 'aria-label': ariaLabel,\n trackRef,\n inputRef\n }, state);\n\n let {isFocusVisible} = useFocusVisible();\n let [isFocused, setIsFocused] = useState(false);\n let {focusProps} = useFocus({\n isDisabled,\n onFocusChange: setIsFocused\n });\n\n return (\n <div\n ref={domRef}\n {...styleProps}\n className={classNames(\n styles,\n {\n 'spectrum-ColorSlider-container--horizontal': !vertical,\n 'spectrum-ColorSlider-container--vertical': vertical\n }\n )}>\n {label &&\n <div className={classNames(styles, 'spectrum-ColorSlider-labelContainer')}>\n <Label {...labelProps}>{label}</Label>\n {props.contextualHelp &&\n <SlotProvider\n slots={{\n actionButton: {\n UNSAFE_className: classNames(styles, 'spectrum-ColorSlider-contextualHelp')\n }\n }}>\n {props.contextualHelp}\n </SlotProvider>\n }\n {showValueLabel && (\n <Label elementType=\"span\" UNSAFE_className={classNames(styles, 'spectrum-ColorSlider-valueLabel')}>\n <output {...outputProps}>{state.value.formatChannelValue(channel, locale)}</output>\n </Label>\n )}\n </div>\n }\n <div\n {...trackProps}\n ref={trackRef}\n className={classNames(\n styles,\n 'spectrum-ColorSlider', {\n 'is-disabled': isDisabled,\n 'spectrum-ColorSlider--vertical': vertical\n }\n )\n }>\n <ColorThumb\n value={state.getDisplayColor()}\n isFocused={isFocused && isFocusVisible}\n isDisabled={isDisabled}\n isDragging={state.isThumbDragging(0)}\n className={classNames(styles, 'spectrum-ColorSlider-handle')}\n {...thumbProps}>\n <input {...inputProps} {...focusProps} ref={inputRef} className={classNames(styles, 'spectrum-ColorSlider-slider')} />\n </ColorThumb>\n </div>\n </div>\n );\n}\n\n/**\n * ColorSliders allow users to adjust an individual channel of a color value.\n */\nlet _ColorSlider = React.forwardRef(ColorSlider);\nexport {_ColorSlider as ColorSlider};\n"],"names":[],"version":3,"file":"ColorSlider.module.js.map"}
@@ -0,0 +1,94 @@
1
+ require("./vars.08ba4b4c.css");
2
+ var $f61d632765728b2e$exports = require("./colorhandle_vars_css.main.js");
3
+ require("./vars.ef2c01b8.css");
4
+ var $f65977ae56facfaa$exports = require("./colorloupe_vars_css.main.js");
5
+ var $bRwD9$reactspectrumutils = require("@react-spectrum/utils");
6
+ var $bRwD9$react = require("react");
7
+ var $bRwD9$reactariautils = require("@react-aria/utils");
8
+
9
+
10
+ function $parcel$interopDefault(a) {
11
+ return a && a.__esModule ? a.default : a;
12
+ }
13
+
14
+ function $parcel$export(e, n, v, s) {
15
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
16
+ }
17
+
18
+ $parcel$export(module.exports, "ColorThumb", () => $2b9adc23f6c7cae1$export$a3cc47cee1c1ccc);
19
+ /*
20
+ * Copyright 2020 Adobe. All rights reserved.
21
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
22
+ * you may not use this file except in compliance with the License. You may obtain a copy
23
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
24
+ *
25
+ * Unless required by applicable law or agreed to in writing, software distributed under
26
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
27
+ * OF ANY KIND, either express or implied. See the License for the specific language
28
+ * governing permissions and limitations under the License.
29
+ */
30
+
31
+
32
+
33
+
34
+ function $2b9adc23f6c7cae1$export$a3cc47cee1c1ccc(props) {
35
+ let { value: value, isDisabled: isDisabled, isDragging: isDragging, isFocused: isFocused, children: children, className: className = "", ...otherProps } = props;
36
+ let patternId = (0, $bRwD9$reactariautils.useId)();
37
+ let valueCSS = value.toString("css");
38
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($bRwD9$react))).createElement("div", {
39
+ className: (0, $bRwD9$reactspectrumutils.classNames)((0, ($parcel$interopDefault($f61d632765728b2e$exports))), "spectrum-ColorHandle", {
40
+ "is-focused": isFocused,
41
+ "is-disabled": isDisabled
42
+ }) + " " + className,
43
+ ...otherProps
44
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($bRwD9$react))).createElement("div", {
45
+ className: (0, $bRwD9$reactspectrumutils.classNames)((0, ($parcel$interopDefault($f61d632765728b2e$exports))), "spectrum-ColorHandle-color"),
46
+ style: {
47
+ backgroundColor: valueCSS
48
+ }
49
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($bRwD9$react))).createElement("svg", {
50
+ className: (0, $bRwD9$reactspectrumutils.classNames)((0, ($parcel$interopDefault($f65977ae56facfaa$exports))), "spectrum-ColorLoupe", {
51
+ "is-open": isDragging
52
+ }),
53
+ "aria-hidden": "true"
54
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($bRwD9$react))).createElement("pattern", {
55
+ id: patternId,
56
+ x: "0",
57
+ y: "0",
58
+ width: "16",
59
+ height: "16",
60
+ patternUnits: "userSpaceOnUse"
61
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($bRwD9$react))).createElement("rect", {
62
+ className: (0, $bRwD9$reactspectrumutils.classNames)((0, ($parcel$interopDefault($f65977ae56facfaa$exports))), "spectrum-ColorLoupe-inner-background"),
63
+ x: "0",
64
+ y: "0",
65
+ width: "16",
66
+ height: "16"
67
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($bRwD9$react))).createElement("rect", {
68
+ className: (0, $bRwD9$reactspectrumutils.classNames)((0, ($parcel$interopDefault($f65977ae56facfaa$exports))), "spectrum-ColorLoupe-inner-checker"),
69
+ x: "0",
70
+ y: "0",
71
+ width: "8",
72
+ height: "8"
73
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($bRwD9$react))).createElement("rect", {
74
+ className: (0, $bRwD9$reactspectrumutils.classNames)((0, ($parcel$interopDefault($f65977ae56facfaa$exports))), "spectrum-ColorLoupe-inner-checker"),
75
+ x: "8",
76
+ y: "8",
77
+ width: "8",
78
+ height: "8"
79
+ })), /*#__PURE__*/ (0, ($parcel$interopDefault($bRwD9$react))).createElement("path", {
80
+ className: (0, $bRwD9$reactspectrumutils.classNames)((0, ($parcel$interopDefault($f65977ae56facfaa$exports))), "spectrum-ColorLoupe-inner"),
81
+ d: "M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z",
82
+ fill: `url(#${patternId})`
83
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($bRwD9$react))).createElement("path", {
84
+ className: (0, $bRwD9$reactspectrumutils.classNames)((0, ($parcel$interopDefault($f65977ae56facfaa$exports))), "spectrum-ColorLoupe-inner"),
85
+ d: "M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z",
86
+ fill: valueCSS
87
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($bRwD9$react))).createElement("path", {
88
+ className: (0, $bRwD9$reactspectrumutils.classNames)((0, ($parcel$interopDefault($f65977ae56facfaa$exports))), "spectrum-ColorLoupe-outer"),
89
+ d: "M25 3A21.98 21.98 0 003 25c0 6.2 4 14.794 11.568 24.853A144.233 144.233 0 0025 62.132a144.085 144.085 0 0010.4-12.239C42.99 39.816 47 31.209 47 25A21.98 21.98 0 0025 3m0-2a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z"
90
+ })), children);
91
+ }
92
+
93
+
94
+ //# sourceMappingURL=ColorThumb.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAmBD,SAAS,yCAAW,KAAsB;IACxC,IAAI,SAAC,KAAK,cAAE,UAAU,cAAE,UAAU,aAAE,SAAS,YAAE,QAAQ,aAAE,YAAY,IAAI,GAAG,YAAW,GAAG;IAE1F,IAAI,YAAY,CAAA,GAAA,2BAAI;IAEpB,IAAI,WAAW,MAAM,QAAQ,CAAC;IAE9B,qBACE,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG,wBAAwB;YAAC,cAAc;YAAW,eAAe;QAAU,KAAK,MAAM;QAAY,GAAG,UAAU;qBACtJ,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAW,GAAG;QAA+B,OAAO;YAAC,iBAAiB;QAAQ;sBACzG,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAU,GAAG,uBAAwB;YAAC,WAAW;QAAU;QAAI,eAAY;qBACpG,0DAAC;QAAQ,IAAI;QAAW,GAAE;QAAI,GAAE;QAAI,OAAM;QAAK,QAAO;QAAK,cAAa;qBACtE,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAU,GAAG;QAAyC,GAAE;QAAI,GAAE;QAAI,OAAM;QAAK,QAAO;sBAChH,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAU,GAAG;QAAsC,GAAE;QAAI,GAAE;QAAI,OAAM;QAAI,QAAO;sBAC5G,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAU,GAAG;QAAsC,GAAE;QAAI,GAAE;QAAI,OAAM;QAAI,QAAO;uBAE9G,0DAAC;QACC,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAU,GAAG;QACnC,GAAE;QACF,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;sBAC5B,0DAAC;QACC,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAU,GAAG;QACnC,GAAE;QACF,MAAM;sBACR,0DAAC;QACC,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAU,GAAG;QACnC,GAAE;SAEL;AAGP","sources":["packages/@react-spectrum/color/src/ColorThumb.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 {Color} from '@react-types/color';\nimport {DOMProps} from '@react-types/shared';\nimport React, {ReactElement} from 'react';\nimport stylesHandle from '@adobe/spectrum-css-temp/components/colorhandle/vars.css';\nimport stylesLoupe from '@adobe/spectrum-css-temp/components/colorloupe/vars.css';\nimport {useId} from '@react-aria/utils';\n\ninterface ColorThumbProps extends DOMProps {\n value: Color,\n isDisabled?: boolean,\n isDragging?: boolean, // shows the color loupe\n isFocused?: boolean, // makes the circle larger\n className?: string,\n children?: ReactElement\n}\n\nfunction ColorThumb(props: ColorThumbProps) {\n let {value, isDisabled, isDragging, isFocused, children, className = '', ...otherProps} = props;\n\n let patternId = useId();\n\n let valueCSS = value.toString('css');\n\n return (\n <div className={classNames(stylesHandle, 'spectrum-ColorHandle', {'is-focused': isFocused, 'is-disabled': isDisabled}) + ' ' + className} {...otherProps}>\n <div className={classNames(stylesHandle, 'spectrum-ColorHandle-color')} style={{backgroundColor: valueCSS}} />\n <svg className={classNames(stylesLoupe, 'spectrum-ColorLoupe', {'is-open': isDragging})} aria-hidden=\"true\">\n <pattern id={patternId} x=\"0\" y=\"0\" width=\"16\" height=\"16\" patternUnits=\"userSpaceOnUse\">\n <rect className={classNames(stylesLoupe, 'spectrum-ColorLoupe-inner-background')} x=\"0\" y=\"0\" width=\"16\" height=\"16\" />\n <rect className={classNames(stylesLoupe, 'spectrum-ColorLoupe-inner-checker')} x=\"0\" y=\"0\" width=\"8\" height=\"8\" />\n <rect className={classNames(stylesLoupe, 'spectrum-ColorLoupe-inner-checker')} x=\"8\" y=\"8\" width=\"8\" height=\"8\" />\n </pattern>\n <path\n className={classNames(stylesLoupe, 'spectrum-ColorLoupe-inner')}\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={`url(#${patternId})`} />\n <path\n className={classNames(stylesLoupe, 'spectrum-ColorLoupe-inner')}\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={valueCSS} />\n <path\n className={classNames(stylesLoupe, 'spectrum-ColorLoupe-outer')}\n d=\"M25 3A21.98 21.98 0 003 25c0 6.2 4 14.794 11.568 24.853A144.233 144.233 0 0025 62.132a144.085 144.085 0 0010.4-12.239C42.99 39.816 47 31.209 47 25A21.98 21.98 0 0025 3m0-2a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\" />\n </svg>\n {children}\n </div>\n );\n}\n\nexport {ColorThumb};\n"],"names":[],"version":3,"file":"ColorThumb.main.js.map"}
@@ -0,0 +1,89 @@
1
+ import "./vars.08ba4b4c.css";
2
+ import $1UQoL$colorhandle_vars_cssmodulejs from "./colorhandle_vars_css.mjs";
3
+ import "./vars.ef2c01b8.css";
4
+ import $1UQoL$colorloupe_vars_cssmodulejs from "./colorloupe_vars_css.mjs";
5
+ import {classNames as $1UQoL$classNames} from "@react-spectrum/utils";
6
+ import $1UQoL$react from "react";
7
+ import {useId as $1UQoL$useId} from "@react-aria/utils";
8
+
9
+
10
+ function $parcel$interopDefault(a) {
11
+ return a && a.__esModule ? a.default : a;
12
+ }
13
+ /*
14
+ * Copyright 2020 Adobe. All rights reserved.
15
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
16
+ * you may not use this file except in compliance with the License. You may obtain a copy
17
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
18
+ *
19
+ * Unless required by applicable law or agreed to in writing, software distributed under
20
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
21
+ * OF ANY KIND, either express or implied. See the License for the specific language
22
+ * governing permissions and limitations under the License.
23
+ */
24
+
25
+
26
+
27
+
28
+ function $3a90e89d07d7bbd5$export$a3cc47cee1c1ccc(props) {
29
+ let { value: value, isDisabled: isDisabled, isDragging: isDragging, isFocused: isFocused, children: children, className: className = "", ...otherProps } = props;
30
+ let patternId = (0, $1UQoL$useId)();
31
+ let valueCSS = value.toString("css");
32
+ return /*#__PURE__*/ (0, $1UQoL$react).createElement("div", {
33
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorhandle_vars_cssmodulejs))), "spectrum-ColorHandle", {
34
+ "is-focused": isFocused,
35
+ "is-disabled": isDisabled
36
+ }) + " " + className,
37
+ ...otherProps
38
+ }, /*#__PURE__*/ (0, $1UQoL$react).createElement("div", {
39
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorhandle_vars_cssmodulejs))), "spectrum-ColorHandle-color"),
40
+ style: {
41
+ backgroundColor: valueCSS
42
+ }
43
+ }), /*#__PURE__*/ (0, $1UQoL$react).createElement("svg", {
44
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorloupe_vars_cssmodulejs))), "spectrum-ColorLoupe", {
45
+ "is-open": isDragging
46
+ }),
47
+ "aria-hidden": "true"
48
+ }, /*#__PURE__*/ (0, $1UQoL$react).createElement("pattern", {
49
+ id: patternId,
50
+ x: "0",
51
+ y: "0",
52
+ width: "16",
53
+ height: "16",
54
+ patternUnits: "userSpaceOnUse"
55
+ }, /*#__PURE__*/ (0, $1UQoL$react).createElement("rect", {
56
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorloupe_vars_cssmodulejs))), "spectrum-ColorLoupe-inner-background"),
57
+ x: "0",
58
+ y: "0",
59
+ width: "16",
60
+ height: "16"
61
+ }), /*#__PURE__*/ (0, $1UQoL$react).createElement("rect", {
62
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorloupe_vars_cssmodulejs))), "spectrum-ColorLoupe-inner-checker"),
63
+ x: "0",
64
+ y: "0",
65
+ width: "8",
66
+ height: "8"
67
+ }), /*#__PURE__*/ (0, $1UQoL$react).createElement("rect", {
68
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorloupe_vars_cssmodulejs))), "spectrum-ColorLoupe-inner-checker"),
69
+ x: "8",
70
+ y: "8",
71
+ width: "8",
72
+ height: "8"
73
+ })), /*#__PURE__*/ (0, $1UQoL$react).createElement("path", {
74
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorloupe_vars_cssmodulejs))), "spectrum-ColorLoupe-inner"),
75
+ d: "M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z",
76
+ fill: `url(#${patternId})`
77
+ }), /*#__PURE__*/ (0, $1UQoL$react).createElement("path", {
78
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorloupe_vars_cssmodulejs))), "spectrum-ColorLoupe-inner"),
79
+ d: "M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z",
80
+ fill: valueCSS
81
+ }), /*#__PURE__*/ (0, $1UQoL$react).createElement("path", {
82
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorloupe_vars_cssmodulejs))), "spectrum-ColorLoupe-outer"),
83
+ d: "M25 3A21.98 21.98 0 003 25c0 6.2 4 14.794 11.568 24.853A144.233 144.233 0 0025 62.132a144.085 144.085 0 0010.4-12.239C42.99 39.816 47 31.209 47 25A21.98 21.98 0 0025 3m0-2a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z"
84
+ })), children);
85
+ }
86
+
87
+
88
+ export {$3a90e89d07d7bbd5$export$a3cc47cee1c1ccc as ColorThumb};
89
+ //# sourceMappingURL=ColorThumb.mjs.map
@@ -0,0 +1,89 @@
1
+ import "./vars.08ba4b4c.css";
2
+ import $1UQoL$colorhandle_vars_cssmodulejs from "./colorhandle_vars_css.module.js";
3
+ import "./vars.ef2c01b8.css";
4
+ import $1UQoL$colorloupe_vars_cssmodulejs from "./colorloupe_vars_css.module.js";
5
+ import {classNames as $1UQoL$classNames} from "@react-spectrum/utils";
6
+ import $1UQoL$react from "react";
7
+ import {useId as $1UQoL$useId} from "@react-aria/utils";
8
+
9
+
10
+ function $parcel$interopDefault(a) {
11
+ return a && a.__esModule ? a.default : a;
12
+ }
13
+ /*
14
+ * Copyright 2020 Adobe. All rights reserved.
15
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
16
+ * you may not use this file except in compliance with the License. You may obtain a copy
17
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
18
+ *
19
+ * Unless required by applicable law or agreed to in writing, software distributed under
20
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
21
+ * OF ANY KIND, either express or implied. See the License for the specific language
22
+ * governing permissions and limitations under the License.
23
+ */
24
+
25
+
26
+
27
+
28
+ function $3a90e89d07d7bbd5$export$a3cc47cee1c1ccc(props) {
29
+ let { value: value, isDisabled: isDisabled, isDragging: isDragging, isFocused: isFocused, children: children, className: className = "", ...otherProps } = props;
30
+ let patternId = (0, $1UQoL$useId)();
31
+ let valueCSS = value.toString("css");
32
+ return /*#__PURE__*/ (0, $1UQoL$react).createElement("div", {
33
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorhandle_vars_cssmodulejs))), "spectrum-ColorHandle", {
34
+ "is-focused": isFocused,
35
+ "is-disabled": isDisabled
36
+ }) + " " + className,
37
+ ...otherProps
38
+ }, /*#__PURE__*/ (0, $1UQoL$react).createElement("div", {
39
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorhandle_vars_cssmodulejs))), "spectrum-ColorHandle-color"),
40
+ style: {
41
+ backgroundColor: valueCSS
42
+ }
43
+ }), /*#__PURE__*/ (0, $1UQoL$react).createElement("svg", {
44
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorloupe_vars_cssmodulejs))), "spectrum-ColorLoupe", {
45
+ "is-open": isDragging
46
+ }),
47
+ "aria-hidden": "true"
48
+ }, /*#__PURE__*/ (0, $1UQoL$react).createElement("pattern", {
49
+ id: patternId,
50
+ x: "0",
51
+ y: "0",
52
+ width: "16",
53
+ height: "16",
54
+ patternUnits: "userSpaceOnUse"
55
+ }, /*#__PURE__*/ (0, $1UQoL$react).createElement("rect", {
56
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorloupe_vars_cssmodulejs))), "spectrum-ColorLoupe-inner-background"),
57
+ x: "0",
58
+ y: "0",
59
+ width: "16",
60
+ height: "16"
61
+ }), /*#__PURE__*/ (0, $1UQoL$react).createElement("rect", {
62
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorloupe_vars_cssmodulejs))), "spectrum-ColorLoupe-inner-checker"),
63
+ x: "0",
64
+ y: "0",
65
+ width: "8",
66
+ height: "8"
67
+ }), /*#__PURE__*/ (0, $1UQoL$react).createElement("rect", {
68
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorloupe_vars_cssmodulejs))), "spectrum-ColorLoupe-inner-checker"),
69
+ x: "8",
70
+ y: "8",
71
+ width: "8",
72
+ height: "8"
73
+ })), /*#__PURE__*/ (0, $1UQoL$react).createElement("path", {
74
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorloupe_vars_cssmodulejs))), "spectrum-ColorLoupe-inner"),
75
+ d: "M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z",
76
+ fill: `url(#${patternId})`
77
+ }), /*#__PURE__*/ (0, $1UQoL$react).createElement("path", {
78
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorloupe_vars_cssmodulejs))), "spectrum-ColorLoupe-inner"),
79
+ d: "M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z",
80
+ fill: valueCSS
81
+ }), /*#__PURE__*/ (0, $1UQoL$react).createElement("path", {
82
+ className: (0, $1UQoL$classNames)((0, ($parcel$interopDefault($1UQoL$colorloupe_vars_cssmodulejs))), "spectrum-ColorLoupe-outer"),
83
+ d: "M25 3A21.98 21.98 0 003 25c0 6.2 4 14.794 11.568 24.853A144.233 144.233 0 0025 62.132a144.085 144.085 0 0010.4-12.239C42.99 39.816 47 31.209 47 25A21.98 21.98 0 0025 3m0-2a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z"
84
+ })), children);
85
+ }
86
+
87
+
88
+ export {$3a90e89d07d7bbd5$export$a3cc47cee1c1ccc as ColorThumb};
89
+ //# sourceMappingURL=ColorThumb.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAmBD,SAAS,yCAAW,KAAsB;IACxC,IAAI,SAAC,KAAK,cAAE,UAAU,cAAE,UAAU,aAAE,SAAS,YAAE,QAAQ,aAAE,YAAY,IAAI,GAAG,YAAW,GAAG;IAE1F,IAAI,YAAY,CAAA,GAAA,YAAI;IAEpB,IAAI,WAAW,MAAM,QAAQ,CAAC;IAE9B,qBACE,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,6DAAW,GAAG,wBAAwB;YAAC,cAAc;YAAW,eAAe;QAAU,KAAK,MAAM;QAAY,GAAG,UAAU;qBACtJ,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,6DAAW,GAAG;QAA+B,OAAO;YAAC,iBAAiB;QAAQ;sBACzG,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,4DAAU,GAAG,uBAAwB;YAAC,WAAW;QAAU;QAAI,eAAY;qBACpG,gCAAC;QAAQ,IAAI;QAAW,GAAE;QAAI,GAAE;QAAI,OAAM;QAAK,QAAO;QAAK,cAAa;qBACtE,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,4DAAU,GAAG;QAAyC,GAAE;QAAI,GAAE;QAAI,OAAM;QAAK,QAAO;sBAChH,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,4DAAU,GAAG;QAAsC,GAAE;QAAI,GAAE;QAAI,OAAM;QAAI,QAAO;sBAC5G,gCAAC;QAAK,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,4DAAU,GAAG;QAAsC,GAAE;QAAI,GAAE;QAAI,OAAM;QAAI,QAAO;uBAE9G,gCAAC;QACC,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,4DAAU,GAAG;QACnC,GAAE;QACF,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;sBAC5B,gCAAC;QACC,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,4DAAU,GAAG;QACnC,GAAE;QACF,MAAM;sBACR,gCAAC;QACC,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,4DAAU,GAAG;QACnC,GAAE;SAEL;AAGP","sources":["packages/@react-spectrum/color/src/ColorThumb.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 {Color} from '@react-types/color';\nimport {DOMProps} from '@react-types/shared';\nimport React, {ReactElement} from 'react';\nimport stylesHandle from '@adobe/spectrum-css-temp/components/colorhandle/vars.css';\nimport stylesLoupe from '@adobe/spectrum-css-temp/components/colorloupe/vars.css';\nimport {useId} from '@react-aria/utils';\n\ninterface ColorThumbProps extends DOMProps {\n value: Color,\n isDisabled?: boolean,\n isDragging?: boolean, // shows the color loupe\n isFocused?: boolean, // makes the circle larger\n className?: string,\n children?: ReactElement\n}\n\nfunction ColorThumb(props: ColorThumbProps) {\n let {value, isDisabled, isDragging, isFocused, children, className = '', ...otherProps} = props;\n\n let patternId = useId();\n\n let valueCSS = value.toString('css');\n\n return (\n <div className={classNames(stylesHandle, 'spectrum-ColorHandle', {'is-focused': isFocused, 'is-disabled': isDisabled}) + ' ' + className} {...otherProps}>\n <div className={classNames(stylesHandle, 'spectrum-ColorHandle-color')} style={{backgroundColor: valueCSS}} />\n <svg className={classNames(stylesLoupe, 'spectrum-ColorLoupe', {'is-open': isDragging})} aria-hidden=\"true\">\n <pattern id={patternId} x=\"0\" y=\"0\" width=\"16\" height=\"16\" patternUnits=\"userSpaceOnUse\">\n <rect className={classNames(stylesLoupe, 'spectrum-ColorLoupe-inner-background')} x=\"0\" y=\"0\" width=\"16\" height=\"16\" />\n <rect className={classNames(stylesLoupe, 'spectrum-ColorLoupe-inner-checker')} x=\"0\" y=\"0\" width=\"8\" height=\"8\" />\n <rect className={classNames(stylesLoupe, 'spectrum-ColorLoupe-inner-checker')} x=\"8\" y=\"8\" width=\"8\" height=\"8\" />\n </pattern>\n <path\n className={classNames(stylesLoupe, 'spectrum-ColorLoupe-inner')}\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={`url(#${patternId})`} />\n <path\n className={classNames(stylesLoupe, 'spectrum-ColorLoupe-inner')}\n d=\"M25 1a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\"\n fill={valueCSS} />\n <path\n className={classNames(stylesLoupe, 'spectrum-ColorLoupe-outer')}\n d=\"M25 3A21.98 21.98 0 003 25c0 6.2 4 14.794 11.568 24.853A144.233 144.233 0 0025 62.132a144.085 144.085 0 0010.4-12.239C42.99 39.816 47 31.209 47 25A21.98 21.98 0 0025 3m0-2a24 24 0 0124 24c0 16.255-24 40-24 40S1 41.255 1 25A24 24 0 0125 1z\" />\n </svg>\n {children}\n </div>\n );\n}\n\nexport {ColorThumb};\n"],"names":[],"version":3,"file":"ColorThumb.module.js.map"}