@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.
Files changed (290) hide show
  1. package/dist/import.mjs +9 -11
  2. package/dist/main.js +18 -20
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +9 -11
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +16 -0
  7. package/package.json +14 -41
  8. package/src/index.ts +17 -15
  9. package/dist/ColorArea.main.js +0 -95
  10. package/dist/ColorArea.main.js.map +0 -1
  11. package/dist/ColorArea.mjs +0 -90
  12. package/dist/ColorArea.module.js +0 -90
  13. package/dist/ColorArea.module.js.map +0 -1
  14. package/dist/ColorEditor.main.js +0 -113
  15. package/dist/ColorEditor.main.js.map +0 -1
  16. package/dist/ColorEditor.mjs +0 -108
  17. package/dist/ColorEditor.module.js +0 -108
  18. package/dist/ColorEditor.module.js.map +0 -1
  19. package/dist/ColorField.main.js +0 -105
  20. package/dist/ColorField.main.js.map +0 -1
  21. package/dist/ColorField.mjs +0 -100
  22. package/dist/ColorField.module.js +0 -100
  23. package/dist/ColorField.module.js.map +0 -1
  24. package/dist/ColorPicker.main.js +0 -123
  25. package/dist/ColorPicker.main.js.map +0 -1
  26. package/dist/ColorPicker.mjs +0 -114
  27. package/dist/ColorPicker.module.js +0 -114
  28. package/dist/ColorPicker.module.js.map +0 -1
  29. package/dist/ColorSlider.main.js +0 -126
  30. package/dist/ColorSlider.main.js.map +0 -1
  31. package/dist/ColorSlider.mjs +0 -121
  32. package/dist/ColorSlider.module.js +0 -121
  33. package/dist/ColorSlider.module.js.map +0 -1
  34. package/dist/ColorSwatch.main.js +0 -91
  35. package/dist/ColorSwatch.main.js.map +0 -1
  36. package/dist/ColorSwatch.mjs +0 -81
  37. package/dist/ColorSwatch.module.js +0 -81
  38. package/dist/ColorSwatch.module.js.map +0 -1
  39. package/dist/ColorSwatchPicker.main.js +0 -112
  40. package/dist/ColorSwatchPicker.main.js.map +0 -1
  41. package/dist/ColorSwatchPicker.mjs +0 -103
  42. package/dist/ColorSwatchPicker.module.js +0 -103
  43. package/dist/ColorSwatchPicker.module.js.map +0 -1
  44. package/dist/ColorThumb.main.js +0 -146
  45. package/dist/ColorThumb.main.js.map +0 -1
  46. package/dist/ColorThumb.mjs +0 -141
  47. package/dist/ColorThumb.module.js +0 -141
  48. package/dist/ColorThumb.module.js.map +0 -1
  49. package/dist/ColorWheel.main.js +0 -114
  50. package/dist/ColorWheel.main.js.map +0 -1
  51. package/dist/ColorWheel.mjs +0 -109
  52. package/dist/ColorWheel.module.js +0 -109
  53. package/dist/ColorWheel.module.js.map +0 -1
  54. package/dist/ar-AE.main.js +0 -10
  55. package/dist/ar-AE.main.js.map +0 -1
  56. package/dist/ar-AE.mjs +0 -12
  57. package/dist/ar-AE.module.js +0 -12
  58. package/dist/ar-AE.module.js.map +0 -1
  59. package/dist/bg-BG.main.js +0 -10
  60. package/dist/bg-BG.main.js.map +0 -1
  61. package/dist/bg-BG.mjs +0 -12
  62. package/dist/bg-BG.module.js +0 -12
  63. package/dist/bg-BG.module.js.map +0 -1
  64. package/dist/color.0da417e8.css +0 -93
  65. package/dist/color.0da417e8.css.map +0 -1
  66. package/dist/color.4034864f.css +0 -120
  67. package/dist/color.4034864f.css.map +0 -1
  68. package/dist/color.51750948.css +0 -356
  69. package/dist/color.51750948.css.map +0 -1
  70. package/dist/color.6dfdb0cd.css +0 -260
  71. package/dist/color.6dfdb0cd.css.map +0 -1
  72. package/dist/color.85d29c28.css +0 -12
  73. package/dist/color.85d29c28.css.map +0 -1
  74. package/dist/color.8e3b650f.css +0 -93
  75. package/dist/color.8e3b650f.css.map +0 -1
  76. package/dist/color.a5310285.css +0 -206
  77. package/dist/color.a5310285.css.map +0 -1
  78. package/dist/color.decac5a6.css +0 -20
  79. package/dist/color.decac5a6.css.map +0 -1
  80. package/dist/color.f801bfa3.css +0 -75
  81. package/dist/color.f801bfa3.css.map +0 -1
  82. package/dist/color.ff589589.css +0 -41
  83. package/dist/color.ff589589.css.map +0 -1
  84. package/dist/colorarea_vars_css.main.js +0 -29
  85. package/dist/colorarea_vars_css.main.js.map +0 -1
  86. package/dist/colorarea_vars_css.mjs +0 -31
  87. package/dist/colorarea_vars_css.module.js +0 -31
  88. package/dist/colorarea_vars_css.module.js.map +0 -1
  89. package/dist/colorfield_css.main.js +0 -11
  90. package/dist/colorfield_css.main.js.map +0 -1
  91. package/dist/colorfield_css.mjs +0 -13
  92. package/dist/colorfield_css.module.js +0 -13
  93. package/dist/colorfield_css.module.js.map +0 -1
  94. package/dist/colorhandle_vars_css.main.js +0 -26
  95. package/dist/colorhandle_vars_css.main.js.map +0 -1
  96. package/dist/colorhandle_vars_css.mjs +0 -28
  97. package/dist/colorhandle_vars_css.module.js +0 -28
  98. package/dist/colorhandle_vars_css.module.js.map +0 -1
  99. package/dist/colorloupe_vars_css.main.js +0 -23
  100. package/dist/colorloupe_vars_css.main.js.map +0 -1
  101. package/dist/colorloupe_vars_css.mjs +0 -25
  102. package/dist/colorloupe_vars_css.module.js +0 -25
  103. package/dist/colorloupe_vars_css.module.js.map +0 -1
  104. package/dist/colorslider_vars_css.main.js +0 -53
  105. package/dist/colorslider_vars_css.main.js.map +0 -1
  106. package/dist/colorslider_vars_css.mjs +0 -55
  107. package/dist/colorslider_vars_css.module.js +0 -55
  108. package/dist/colorslider_vars_css.module.js.map +0 -1
  109. package/dist/colorwheel_vars_css.main.js +0 -35
  110. package/dist/colorwheel_vars_css.main.js.map +0 -1
  111. package/dist/colorwheel_vars_css.mjs +0 -37
  112. package/dist/colorwheel_vars_css.module.js +0 -37
  113. package/dist/colorwheel_vars_css.module.js.map +0 -1
  114. package/dist/cs-CZ.main.js +0 -10
  115. package/dist/cs-CZ.main.js.map +0 -1
  116. package/dist/cs-CZ.mjs +0 -12
  117. package/dist/cs-CZ.module.js +0 -12
  118. package/dist/cs-CZ.module.js.map +0 -1
  119. package/dist/da-DK.main.js +0 -10
  120. package/dist/da-DK.main.js.map +0 -1
  121. package/dist/da-DK.mjs +0 -12
  122. package/dist/da-DK.module.js +0 -12
  123. package/dist/da-DK.module.js.map +0 -1
  124. package/dist/de-DE.main.js +0 -10
  125. package/dist/de-DE.main.js.map +0 -1
  126. package/dist/de-DE.mjs +0 -12
  127. package/dist/de-DE.module.js +0 -12
  128. package/dist/de-DE.module.js.map +0 -1
  129. package/dist/el-GR.main.js +0 -10
  130. package/dist/el-GR.main.js.map +0 -1
  131. package/dist/el-GR.mjs +0 -12
  132. package/dist/el-GR.module.js +0 -12
  133. package/dist/el-GR.module.js.map +0 -1
  134. package/dist/en-US.main.js +0 -10
  135. package/dist/en-US.main.js.map +0 -1
  136. package/dist/en-US.mjs +0 -12
  137. package/dist/en-US.module.js +0 -12
  138. package/dist/en-US.module.js.map +0 -1
  139. package/dist/es-ES.main.js +0 -10
  140. package/dist/es-ES.main.js.map +0 -1
  141. package/dist/es-ES.mjs +0 -12
  142. package/dist/es-ES.module.js +0 -12
  143. package/dist/es-ES.module.js.map +0 -1
  144. package/dist/et-EE.main.js +0 -10
  145. package/dist/et-EE.main.js.map +0 -1
  146. package/dist/et-EE.mjs +0 -12
  147. package/dist/et-EE.module.js +0 -12
  148. package/dist/et-EE.module.js.map +0 -1
  149. package/dist/fi-FI.main.js +0 -10
  150. package/dist/fi-FI.main.js.map +0 -1
  151. package/dist/fi-FI.mjs +0 -12
  152. package/dist/fi-FI.module.js +0 -12
  153. package/dist/fi-FI.module.js.map +0 -1
  154. package/dist/fr-FR.main.js +0 -10
  155. package/dist/fr-FR.main.js.map +0 -1
  156. package/dist/fr-FR.mjs +0 -12
  157. package/dist/fr-FR.module.js +0 -12
  158. package/dist/fr-FR.module.js.map +0 -1
  159. package/dist/he-IL.main.js +0 -10
  160. package/dist/he-IL.main.js.map +0 -1
  161. package/dist/he-IL.mjs +0 -12
  162. package/dist/he-IL.module.js +0 -12
  163. package/dist/he-IL.module.js.map +0 -1
  164. package/dist/hr-HR.main.js +0 -10
  165. package/dist/hr-HR.main.js.map +0 -1
  166. package/dist/hr-HR.mjs +0 -12
  167. package/dist/hr-HR.module.js +0 -12
  168. package/dist/hr-HR.module.js.map +0 -1
  169. package/dist/hu-HU.main.js +0 -10
  170. package/dist/hu-HU.main.js.map +0 -1
  171. package/dist/hu-HU.mjs +0 -12
  172. package/dist/hu-HU.module.js +0 -12
  173. package/dist/hu-HU.module.js.map +0 -1
  174. package/dist/intlStrings.main.js +0 -108
  175. package/dist/intlStrings.main.js.map +0 -1
  176. package/dist/intlStrings.mjs +0 -110
  177. package/dist/intlStrings.module.js +0 -110
  178. package/dist/intlStrings.module.js.map +0 -1
  179. package/dist/it-IT.main.js +0 -10
  180. package/dist/it-IT.main.js.map +0 -1
  181. package/dist/it-IT.mjs +0 -12
  182. package/dist/it-IT.module.js +0 -12
  183. package/dist/it-IT.module.js.map +0 -1
  184. package/dist/ja-JP.main.js +0 -10
  185. package/dist/ja-JP.main.js.map +0 -1
  186. package/dist/ja-JP.mjs +0 -12
  187. package/dist/ja-JP.module.js +0 -12
  188. package/dist/ja-JP.module.js.map +0 -1
  189. package/dist/ko-KR.main.js +0 -10
  190. package/dist/ko-KR.main.js.map +0 -1
  191. package/dist/ko-KR.mjs +0 -12
  192. package/dist/ko-KR.module.js +0 -12
  193. package/dist/ko-KR.module.js.map +0 -1
  194. package/dist/lt-LT.main.js +0 -10
  195. package/dist/lt-LT.main.js.map +0 -1
  196. package/dist/lt-LT.mjs +0 -12
  197. package/dist/lt-LT.module.js +0 -12
  198. package/dist/lt-LT.module.js.map +0 -1
  199. package/dist/lv-LV.main.js +0 -10
  200. package/dist/lv-LV.main.js.map +0 -1
  201. package/dist/lv-LV.mjs +0 -12
  202. package/dist/lv-LV.module.js +0 -12
  203. package/dist/lv-LV.module.js.map +0 -1
  204. package/dist/nb-NO.main.js +0 -10
  205. package/dist/nb-NO.main.js.map +0 -1
  206. package/dist/nb-NO.mjs +0 -12
  207. package/dist/nb-NO.module.js +0 -12
  208. package/dist/nb-NO.module.js.map +0 -1
  209. package/dist/nl-NL.main.js +0 -10
  210. package/dist/nl-NL.main.js.map +0 -1
  211. package/dist/nl-NL.mjs +0 -12
  212. package/dist/nl-NL.module.js +0 -12
  213. package/dist/nl-NL.module.js.map +0 -1
  214. package/dist/pl-PL.main.js +0 -10
  215. package/dist/pl-PL.main.js.map +0 -1
  216. package/dist/pl-PL.mjs +0 -12
  217. package/dist/pl-PL.module.js +0 -12
  218. package/dist/pl-PL.module.js.map +0 -1
  219. package/dist/pt-BR.main.js +0 -10
  220. package/dist/pt-BR.main.js.map +0 -1
  221. package/dist/pt-BR.mjs +0 -12
  222. package/dist/pt-BR.module.js +0 -12
  223. package/dist/pt-BR.module.js.map +0 -1
  224. package/dist/pt-PT.main.js +0 -10
  225. package/dist/pt-PT.main.js.map +0 -1
  226. package/dist/pt-PT.mjs +0 -12
  227. package/dist/pt-PT.module.js +0 -12
  228. package/dist/pt-PT.module.js.map +0 -1
  229. package/dist/ro-RO.main.js +0 -10
  230. package/dist/ro-RO.main.js.map +0 -1
  231. package/dist/ro-RO.mjs +0 -12
  232. package/dist/ro-RO.module.js +0 -12
  233. package/dist/ro-RO.module.js.map +0 -1
  234. package/dist/ru-RU.main.js +0 -10
  235. package/dist/ru-RU.main.js.map +0 -1
  236. package/dist/ru-RU.mjs +0 -12
  237. package/dist/ru-RU.module.js +0 -12
  238. package/dist/ru-RU.module.js.map +0 -1
  239. package/dist/sk-SK.main.js +0 -10
  240. package/dist/sk-SK.main.js.map +0 -1
  241. package/dist/sk-SK.mjs +0 -12
  242. package/dist/sk-SK.module.js +0 -12
  243. package/dist/sk-SK.module.js.map +0 -1
  244. package/dist/sl-SI.main.js +0 -10
  245. package/dist/sl-SI.main.js.map +0 -1
  246. package/dist/sl-SI.mjs +0 -12
  247. package/dist/sl-SI.module.js +0 -12
  248. package/dist/sl-SI.module.js.map +0 -1
  249. package/dist/sr-SP.main.js +0 -10
  250. package/dist/sr-SP.main.js.map +0 -1
  251. package/dist/sr-SP.mjs +0 -12
  252. package/dist/sr-SP.module.js +0 -12
  253. package/dist/sr-SP.module.js.map +0 -1
  254. package/dist/sv-SE.main.js +0 -10
  255. package/dist/sv-SE.main.js.map +0 -1
  256. package/dist/sv-SE.mjs +0 -12
  257. package/dist/sv-SE.module.js +0 -12
  258. package/dist/sv-SE.module.js.map +0 -1
  259. package/dist/tr-TR.main.js +0 -10
  260. package/dist/tr-TR.main.js.map +0 -1
  261. package/dist/tr-TR.mjs +0 -12
  262. package/dist/tr-TR.module.js +0 -12
  263. package/dist/tr-TR.module.js.map +0 -1
  264. package/dist/types.d.ts +0 -96
  265. package/dist/types.d.ts.map +0 -1
  266. package/dist/uk-UA.main.js +0 -10
  267. package/dist/uk-UA.main.js.map +0 -1
  268. package/dist/uk-UA.mjs +0 -12
  269. package/dist/uk-UA.module.js +0 -12
  270. package/dist/uk-UA.module.js.map +0 -1
  271. package/dist/zh-CN.main.js +0 -10
  272. package/dist/zh-CN.main.js.map +0 -1
  273. package/dist/zh-CN.mjs +0 -12
  274. package/dist/zh-CN.module.js +0 -12
  275. package/dist/zh-CN.module.js.map +0 -1
  276. package/dist/zh-TW.main.js +0 -10
  277. package/dist/zh-TW.main.js.map +0 -1
  278. package/dist/zh-TW.mjs +0 -12
  279. package/dist/zh-TW.module.js +0 -12
  280. package/dist/zh-TW.module.js.map +0 -1
  281. package/src/ColorArea.tsx +0 -87
  282. package/src/ColorEditor.tsx +0 -60
  283. package/src/ColorField.tsx +0 -111
  284. package/src/ColorPicker.tsx +0 -120
  285. package/src/ColorSlider.tsx +0 -142
  286. package/src/ColorSwatch.tsx +0 -99
  287. package/src/ColorSwatchPicker.tsx +0 -115
  288. package/src/ColorThumb.tsx +0 -114
  289. package/src/ColorWheel.tsx +0 -110
  290. package/src/colorfield.css +0 -18
@@ -1,100 +0,0 @@
1
- import "./color.85d29c28.css";
2
- import $b4uus$colorfield_cssmodulejs from "./colorfield_css.module.js";
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
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAkBM,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,WAAW,KAA8B,EAAE,GAAsB;IACnH,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,CAAC,MAAM,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,MAAM,CAAA,GAAA,wBAAgB;IAEvD,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,CAAA,GAAA,gBAAQ,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,gCAAC;QAAmB,GAAG,KAAK;QAAE,SAAS,MAAM,OAAO;QAAE,cAAc;;SAE3E,qBAAO,gCAAC;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,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,gCAAwB,EAAE;QACpC,GAAG,KAAK;gBACR;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,aAAK,EAA0C;IAC9D,IAAI,SAAS,CAAA,GAAA,2BAAmB,EAAE,YAAY,OAAO;IAErD,qBACE,gFACE,gCAAC,CAAA,GAAA,oBAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;QACpC,MAAM,IAAI,kBAAI,gCAAC;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,yBAAiB,EAAE;IAC/B,IAAI,WAAW,CAAA,GAAA,aAAK,EAA0C;IAC9D,IAAI,SAAS,CAAA,GAAA,oBAAY,EAAE,YAAY,OAAO;IAE9C,qBACE,gCAAC,CAAA,GAAA,oBAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,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.module.js.map"}
@@ -1,123 +0,0 @@
1
- require("./color.a5310285.css");
2
- var $f076f5c85640192a$exports = require("./ColorSwatch.main.js");
3
- var $64NP6$reactariacomponents = require("react-aria-components");
4
- var $64NP6$reactspectrumview = require("@react-spectrum/view");
5
- var $64NP6$reactspectrumdialog = require("@react-spectrum/dialog");
6
- var $64NP6$react = require("react");
7
- var $64NP6$reactspectrumutils = require("@react-spectrum/utils");
8
- var $64NP6$reactariautils = require("@react-aria/utils");
9
-
10
-
11
- function $parcel$interopDefault(a) {
12
- return a && a.__esModule ? a.default : a;
13
- }
14
-
15
- function $parcel$export(e, n, v, s) {
16
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
17
- }
18
-
19
- $parcel$export(module.exports, "ColorPicker", () => $0c330b4a4fe337a6$export$9feb1bc2e5f1ccb3);
20
- /*
21
- * Copyright 2024 Adobe. All rights reserved.
22
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
23
- * you may not use this file except in compliance with the License. You may obtain a copy
24
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
25
- *
26
- * Unless required by applicable law or agreed to in writing, software distributed under
27
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
28
- * OF ANY KIND, either express or implied. See the License for the specific language
29
- * governing permissions and limitations under the License.
30
- */
31
-
32
-
33
-
34
-
35
-
36
-
37
- const $0c330b4a4fe337a6$export$9feb1bc2e5f1ccb3 = /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).forwardRef(function ColorPicker(props, ref) {
38
- let swatchRef = (0, $64NP6$react.useRef)(null);
39
- let domRef = (0, $64NP6$reactspectrumutils.useFocusableRef)(ref);
40
- let labelId = (0, $64NP6$reactariautils.useId)();
41
- return /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement((0, $64NP6$reactariacomponents.ColorPicker), props, /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement((0, $64NP6$reactspectrumdialog.DialogTrigger), {
42
- type: "popover",
43
- mobileType: "tray",
44
- targetRef: (0, $64NP6$reactspectrumutils.unwrapDOMRef)(swatchRef)
45
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement((0, $64NP6$reactariacomponents.Button), {
46
- ref: domRef,
47
- className: function anonymous(props) {
48
- let rules = "";
49
- rules += ' s1-bs1-a';
50
- rules += ' s1-As1-f';
51
- rules += ' s1-Is1-a';
52
- rules += ' s1-Js1-a';
53
- rules += ' s1-Gs1-a';
54
- rules += ' s1-Hs1-a';
55
- rules += ' s1-_Ts1-d';
56
- rules += ' s1-_Vs1-c';
57
- rules += ' s1-ls1-M';
58
- rules += ' s1-ms1-M';
59
- rules += ' s1-_Fs1-a';
60
- rules += ' s1-5-bc1l9os1-h';
61
- rules += ' s1-5-1uotwbws1-g';
62
- rules += ' s1-5-eo0c6ss1-f';
63
- rules += ' s1-5-enzzrgs1-e';
64
- rules += ' s1-5-enzykds1-d';
65
- rules += ' s1-5-enzwzjs1-c';
66
- rules += ' s1-5-enzrfps1-b';
67
- rules += ' s1-5s1-a';
68
- rules += ' s1-as1-___K';
69
- if (props.size === "L") rules += ' s1-6s1-d';
70
- else if (props.size === "M") rules += ' s1-6s1-c';
71
- else if (props.size === "S") rules += ' s1-6s1-b';
72
- else if (props.size === "XS") rules += ' s1-6s1-a';
73
- return rules;
74
- }({
75
- size: props.size || 'M'
76
- })
77
- }, ({ isFocusVisible: isFocusVisible })=>/*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement((0, ($parcel$interopDefault($64NP6$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement("div", {
78
- className: function anonymous(props) {
79
- let rules = "";
80
- if (props.isFocusVisible) rules += ' s1-_Fs1-b';
81
- else rules += ' s1-_Fs1-a';
82
- rules += ' s1-ds1-as1-___D';
83
- rules += ' s1-ds1-___I';
84
- rules += ' s1-_Hs1-c';
85
- rules += ' s1-_Gs1-c';
86
- rules += ' s1-_qs1-c';
87
- rules += ' s1-_rs1-c';
88
- rules += ' s1-_ss1-c';
89
- rules += ' s1-_ts1-c';
90
- return rules;
91
- }({
92
- isFocusVisible: isFocusVisible
93
- })
94
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement((0, $f076f5c85640192a$exports.ColorSwatch), {
95
- ref: swatchRef,
96
- color: props.value,
97
- size: props.size,
98
- rounding: props.rounding,
99
- "aria-label": props['aria-label'],
100
- "aria-labelledby": props['aria-labelledby'],
101
- "aria-describedby": props['aria-describedby'],
102
- "aria-details": props['aria-details']
103
- })), props.label && /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement("span", {
104
- id: labelId
105
- }, props.label))), /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement((0, $64NP6$reactspectrumdialog.Dialog), {
106
- "aria-labelledby": props.label ? labelId : props['aria-labelledby'],
107
- "aria-label": props['aria-label'],
108
- UNSAFE_style: {
109
- width: 'fit-content',
110
- minWidth: 0,
111
- margin: '0 auto' // Center within tray.
112
- }
113
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement((0, $64NP6$reactspectrumview.Content), {
114
- UNSAFE_style: {
115
- position: 'relative',
116
- margin: 'calc(var(--spectrum-dialog-padding) * -1)',
117
- padding: 'var(--spectrum-global-dimension-size-200)'
118
- }
119
- }, props.children))));
120
- });
121
-
122
-
123
- //# sourceMappingURL=ColorPicker.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAgCM,MAAM,0DAAc,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,YAAY,KAA+B,EAAE,GAAoC;IACpI,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE;IAC7B,IAAI,UAAU,CAAA,GAAA,2BAAI;IAClB,qBACE,0DAAC,CAAA,GAAA,sCAAc,GAAM,qBACnB,0DAAC,CAAA,GAAA,wCAAY;QAAE,MAAK;QAAU,YAAW;QAAO,WAAW,CAAA,GAAA,sCAAW,EAAE;qBACtE,0DAAC,CAAA,GAAA,iCAAK;QACJ,KAAK;QACL,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;UAkBR;YAAC,MAAM,MAAM,IAAI,IAAI;QAAG;OAC1B,CAAC,kBAAC,cAAc,EAAC,iBAChB,oIACE,0DAAC;YACC,WAAW;;;;;;;;;;;;;cASR;gCAAC;YAAc;yBAClB,0DAAC,CAAA,GAAA,qCAAU;YACT,KAAK;YACL,OAAO,MAAM,KAAK;YAClB,MAAM,MAAM,IAAI;YAChB,UAAU,MAAM,QAAQ;YACxB,cAAY,KAAK,CAAC,aAAa;YAC/B,mBAAiB,KAAK,CAAC,kBAAkB;YACzC,oBAAkB,KAAK,CAAC,mBAAmB;YAC3C,gBAAc,KAAK,CAAC,eAAe;aAEtC,MAAM,KAAK,kBACV,0DAAC;YAAK,IAAI;WAAU,MAAM,KAAK,mBAKvC,0DAAC,CAAA,GAAA,iCAAK;QACJ,mBAAiB,MAAM,KAAK,GAAG,UAAU,KAAK,CAAC,kBAAkB;QACjE,cAAY,KAAK,CAAC,aAAa;QAC/B,cAAc;YACZ,OAAO;YACP,UAAU;YACV,QAAQ,SAAS,sBAAsB;QACzC;qBACA,0DAAC,CAAA,GAAA,gCAAM;QACL,cAAc;YACZ,UAAU;YACV,QAAQ;YACR,SAAS;QACX;OACC,MAAM,QAAQ;AAM3B","sources":["packages/@react-spectrum/color/src/ColorPicker.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {ColorPicker as AriaColorPicker, Button, Color} from 'react-aria-components';\nimport {AriaLabelingProps, FocusableRef, ValueBase} from '@react-types/shared';\nimport {ColorSwatch} from './ColorSwatch';\nimport {Content} from '@react-spectrum/view';\nimport {Dialog, DialogTrigger} from '@react-spectrum/dialog';\nimport React, {ReactNode, useRef} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {unwrapDOMRef, useFocusableRef} from '@react-spectrum/utils';\nimport {useId} from '@react-aria/utils';\n\nexport interface SpectrumColorPickerProps extends ValueBase<string | Color, Color>, AriaLabelingProps {\n /** A visual label for the color picker. */\n label?: ReactNode,\n /** The contents of the color picker popover, e.g. `<ColorEditor />`. */\n children?: ReactNode,\n /**\n * The size of the color swatch.\n * @default \"M\"\n */\n size?: 'XS' | 'S' | 'M' | 'L',\n /**\n * The corner rounding of the color swatch.\n * @default \"default\"\n */\n rounding?: 'default' | 'none' | 'full'\n}\n\n/**\n * A ColorPicker combines a swatch with a customizable popover for editing a color.\n */\nexport const ColorPicker = React.forwardRef(function ColorPicker(props: SpectrumColorPickerProps, ref: FocusableRef<HTMLButtonElement>) {\n let swatchRef = useRef(null);\n let domRef = useFocusableRef(ref);\n let labelId = useId();\n return (\n <AriaColorPicker {...props}>\n <DialogTrigger type=\"popover\" mobileType=\"tray\" targetRef={unwrapDOMRef(swatchRef)}>\n <Button \n ref={domRef}\n className={style({\n backgroundColor: 'transparent',\n borderStyle: 'none',\n padding: 0,\n display: 'flex',\n alignItems: 'center',\n gap: 'text-to-control',\n outlineStyle: 'none',\n fontFamily: 'sans',\n color: 'body',\n fontSize: {\n size: {\n XS: 'xs',\n S: 'sm',\n M: 'base',\n L: 'lg'\n }\n }\n })({size: props.size || 'M'})}>\n {({isFocusVisible}) => (\n <>\n <div\n className={style({\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineColor: 'focus-ring',\n outlineWidth: 2,\n outlineOffset: 2,\n borderRadius: 'default'\n })({isFocusVisible})}>\n <ColorSwatch\n ref={swatchRef}\n color={props.value}\n size={props.size}\n rounding={props.rounding}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={props['aria-describedby']}\n aria-details={props['aria-details']} />\n </div>\n {props.label && \n <span id={labelId}>{props.label}</span>\n }\n </>\n )}\n </Button>\n <Dialog \n aria-labelledby={props.label ? labelId : props['aria-labelledby']}\n aria-label={props['aria-label']}\n UNSAFE_style={{\n width: 'fit-content',\n minWidth: 0,\n margin: '0 auto' // Center within tray.\n }}>\n <Content \n UNSAFE_style={{\n position: 'relative',\n margin: 'calc(var(--spectrum-dialog-padding) * -1)',\n padding: 'var(--spectrum-global-dimension-size-200)'\n }}>\n {props.children}\n </Content>\n </Dialog>\n </DialogTrigger>\n </AriaColorPicker>\n );\n});\n"],"names":[],"version":3,"file":"ColorPicker.main.js.map"}
@@ -1,114 +0,0 @@
1
- import "./color.a5310285.css";
2
- import {ColorSwatch as $d68786ae409fa722$export$cae13e90592f246a} from "./ColorSwatch.mjs";
3
- import {ColorPicker as $5bRyn$ColorPicker, Button as $5bRyn$Button} from "react-aria-components";
4
- import {Content as $5bRyn$Content} from "@react-spectrum/view";
5
- import {DialogTrigger as $5bRyn$DialogTrigger, Dialog as $5bRyn$Dialog} from "@react-spectrum/dialog";
6
- import $5bRyn$react, {useRef as $5bRyn$useRef} from "react";
7
- import {useFocusableRef as $5bRyn$useFocusableRef, unwrapDOMRef as $5bRyn$unwrapDOMRef} from "@react-spectrum/utils";
8
- import {useId as $5bRyn$useId} from "@react-aria/utils";
9
-
10
- /*
11
- * Copyright 2024 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */
21
-
22
-
23
-
24
-
25
-
26
-
27
- const $d9654c66f3a7e70a$export$9feb1bc2e5f1ccb3 = /*#__PURE__*/ (0, $5bRyn$react).forwardRef(function ColorPicker(props, ref) {
28
- let swatchRef = (0, $5bRyn$useRef)(null);
29
- let domRef = (0, $5bRyn$useFocusableRef)(ref);
30
- let labelId = (0, $5bRyn$useId)();
31
- return /*#__PURE__*/ (0, $5bRyn$react).createElement((0, $5bRyn$ColorPicker), props, /*#__PURE__*/ (0, $5bRyn$react).createElement((0, $5bRyn$DialogTrigger), {
32
- type: "popover",
33
- mobileType: "tray",
34
- targetRef: (0, $5bRyn$unwrapDOMRef)(swatchRef)
35
- }, /*#__PURE__*/ (0, $5bRyn$react).createElement((0, $5bRyn$Button), {
36
- ref: domRef,
37
- className: function anonymous(props) {
38
- let rules = "";
39
- rules += ' s1-bs1-a';
40
- rules += ' s1-As1-f';
41
- rules += ' s1-Is1-a';
42
- rules += ' s1-Js1-a';
43
- rules += ' s1-Gs1-a';
44
- rules += ' s1-Hs1-a';
45
- rules += ' s1-_Ts1-d';
46
- rules += ' s1-_Vs1-c';
47
- rules += ' s1-ls1-M';
48
- rules += ' s1-ms1-M';
49
- rules += ' s1-_Fs1-a';
50
- rules += ' s1-5-bc1l9os1-h';
51
- rules += ' s1-5-1uotwbws1-g';
52
- rules += ' s1-5-eo0c6ss1-f';
53
- rules += ' s1-5-enzzrgs1-e';
54
- rules += ' s1-5-enzykds1-d';
55
- rules += ' s1-5-enzwzjs1-c';
56
- rules += ' s1-5-enzrfps1-b';
57
- rules += ' s1-5s1-a';
58
- rules += ' s1-as1-___K';
59
- if (props.size === "L") rules += ' s1-6s1-d';
60
- else if (props.size === "M") rules += ' s1-6s1-c';
61
- else if (props.size === "S") rules += ' s1-6s1-b';
62
- else if (props.size === "XS") rules += ' s1-6s1-a';
63
- return rules;
64
- }({
65
- size: props.size || 'M'
66
- })
67
- }, ({ isFocusVisible: isFocusVisible })=>/*#__PURE__*/ (0, $5bRyn$react).createElement((0, $5bRyn$react).Fragment, null, /*#__PURE__*/ (0, $5bRyn$react).createElement("div", {
68
- className: function anonymous(props) {
69
- let rules = "";
70
- if (props.isFocusVisible) rules += ' s1-_Fs1-b';
71
- else rules += ' s1-_Fs1-a';
72
- rules += ' s1-ds1-as1-___D';
73
- rules += ' s1-ds1-___I';
74
- rules += ' s1-_Hs1-c';
75
- rules += ' s1-_Gs1-c';
76
- rules += ' s1-_qs1-c';
77
- rules += ' s1-_rs1-c';
78
- rules += ' s1-_ss1-c';
79
- rules += ' s1-_ts1-c';
80
- return rules;
81
- }({
82
- isFocusVisible: isFocusVisible
83
- })
84
- }, /*#__PURE__*/ (0, $5bRyn$react).createElement((0, $d68786ae409fa722$export$cae13e90592f246a), {
85
- ref: swatchRef,
86
- color: props.value,
87
- size: props.size,
88
- rounding: props.rounding,
89
- "aria-label": props['aria-label'],
90
- "aria-labelledby": props['aria-labelledby'],
91
- "aria-describedby": props['aria-describedby'],
92
- "aria-details": props['aria-details']
93
- })), props.label && /*#__PURE__*/ (0, $5bRyn$react).createElement("span", {
94
- id: labelId
95
- }, props.label))), /*#__PURE__*/ (0, $5bRyn$react).createElement((0, $5bRyn$Dialog), {
96
- "aria-labelledby": props.label ? labelId : props['aria-labelledby'],
97
- "aria-label": props['aria-label'],
98
- UNSAFE_style: {
99
- width: 'fit-content',
100
- minWidth: 0,
101
- margin: '0 auto' // Center within tray.
102
- }
103
- }, /*#__PURE__*/ (0, $5bRyn$react).createElement((0, $5bRyn$Content), {
104
- UNSAFE_style: {
105
- position: 'relative',
106
- margin: 'calc(var(--spectrum-dialog-padding) * -1)',
107
- padding: 'var(--spectrum-global-dimension-size-200)'
108
- }
109
- }, props.children))));
110
- });
111
-
112
-
113
- export {$d9654c66f3a7e70a$export$9feb1bc2e5f1ccb3 as ColorPicker};
114
- //# sourceMappingURL=ColorPicker.module.js.map
@@ -1,114 +0,0 @@
1
- import "./color.a5310285.css";
2
- import {ColorSwatch as $d68786ae409fa722$export$cae13e90592f246a} from "./ColorSwatch.module.js";
3
- import {ColorPicker as $5bRyn$ColorPicker, Button as $5bRyn$Button} from "react-aria-components";
4
- import {Content as $5bRyn$Content} from "@react-spectrum/view";
5
- import {DialogTrigger as $5bRyn$DialogTrigger, Dialog as $5bRyn$Dialog} from "@react-spectrum/dialog";
6
- import $5bRyn$react, {useRef as $5bRyn$useRef} from "react";
7
- import {useFocusableRef as $5bRyn$useFocusableRef, unwrapDOMRef as $5bRyn$unwrapDOMRef} from "@react-spectrum/utils";
8
- import {useId as $5bRyn$useId} from "@react-aria/utils";
9
-
10
- /*
11
- * Copyright 2024 Adobe. All rights reserved.
12
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License. You may obtain a copy
14
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
15
- *
16
- * Unless required by applicable law or agreed to in writing, software distributed under
17
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
18
- * OF ANY KIND, either express or implied. See the License for the specific language
19
- * governing permissions and limitations under the License.
20
- */
21
-
22
-
23
-
24
-
25
-
26
-
27
- const $d9654c66f3a7e70a$export$9feb1bc2e5f1ccb3 = /*#__PURE__*/ (0, $5bRyn$react).forwardRef(function ColorPicker(props, ref) {
28
- let swatchRef = (0, $5bRyn$useRef)(null);
29
- let domRef = (0, $5bRyn$useFocusableRef)(ref);
30
- let labelId = (0, $5bRyn$useId)();
31
- return /*#__PURE__*/ (0, $5bRyn$react).createElement((0, $5bRyn$ColorPicker), props, /*#__PURE__*/ (0, $5bRyn$react).createElement((0, $5bRyn$DialogTrigger), {
32
- type: "popover",
33
- mobileType: "tray",
34
- targetRef: (0, $5bRyn$unwrapDOMRef)(swatchRef)
35
- }, /*#__PURE__*/ (0, $5bRyn$react).createElement((0, $5bRyn$Button), {
36
- ref: domRef,
37
- className: function anonymous(props) {
38
- let rules = "";
39
- rules += ' s1-bs1-a';
40
- rules += ' s1-As1-f';
41
- rules += ' s1-Is1-a';
42
- rules += ' s1-Js1-a';
43
- rules += ' s1-Gs1-a';
44
- rules += ' s1-Hs1-a';
45
- rules += ' s1-_Ts1-d';
46
- rules += ' s1-_Vs1-c';
47
- rules += ' s1-ls1-M';
48
- rules += ' s1-ms1-M';
49
- rules += ' s1-_Fs1-a';
50
- rules += ' s1-5-bc1l9os1-h';
51
- rules += ' s1-5-1uotwbws1-g';
52
- rules += ' s1-5-eo0c6ss1-f';
53
- rules += ' s1-5-enzzrgs1-e';
54
- rules += ' s1-5-enzykds1-d';
55
- rules += ' s1-5-enzwzjs1-c';
56
- rules += ' s1-5-enzrfps1-b';
57
- rules += ' s1-5s1-a';
58
- rules += ' s1-as1-___K';
59
- if (props.size === "L") rules += ' s1-6s1-d';
60
- else if (props.size === "M") rules += ' s1-6s1-c';
61
- else if (props.size === "S") rules += ' s1-6s1-b';
62
- else if (props.size === "XS") rules += ' s1-6s1-a';
63
- return rules;
64
- }({
65
- size: props.size || 'M'
66
- })
67
- }, ({ isFocusVisible: isFocusVisible })=>/*#__PURE__*/ (0, $5bRyn$react).createElement((0, $5bRyn$react).Fragment, null, /*#__PURE__*/ (0, $5bRyn$react).createElement("div", {
68
- className: function anonymous(props) {
69
- let rules = "";
70
- if (props.isFocusVisible) rules += ' s1-_Fs1-b';
71
- else rules += ' s1-_Fs1-a';
72
- rules += ' s1-ds1-as1-___D';
73
- rules += ' s1-ds1-___I';
74
- rules += ' s1-_Hs1-c';
75
- rules += ' s1-_Gs1-c';
76
- rules += ' s1-_qs1-c';
77
- rules += ' s1-_rs1-c';
78
- rules += ' s1-_ss1-c';
79
- rules += ' s1-_ts1-c';
80
- return rules;
81
- }({
82
- isFocusVisible: isFocusVisible
83
- })
84
- }, /*#__PURE__*/ (0, $5bRyn$react).createElement((0, $d68786ae409fa722$export$cae13e90592f246a), {
85
- ref: swatchRef,
86
- color: props.value,
87
- size: props.size,
88
- rounding: props.rounding,
89
- "aria-label": props['aria-label'],
90
- "aria-labelledby": props['aria-labelledby'],
91
- "aria-describedby": props['aria-describedby'],
92
- "aria-details": props['aria-details']
93
- })), props.label && /*#__PURE__*/ (0, $5bRyn$react).createElement("span", {
94
- id: labelId
95
- }, props.label))), /*#__PURE__*/ (0, $5bRyn$react).createElement((0, $5bRyn$Dialog), {
96
- "aria-labelledby": props.label ? labelId : props['aria-labelledby'],
97
- "aria-label": props['aria-label'],
98
- UNSAFE_style: {
99
- width: 'fit-content',
100
- minWidth: 0,
101
- margin: '0 auto' // Center within tray.
102
- }
103
- }, /*#__PURE__*/ (0, $5bRyn$react).createElement((0, $5bRyn$Content), {
104
- UNSAFE_style: {
105
- position: 'relative',
106
- margin: 'calc(var(--spectrum-dialog-padding) * -1)',
107
- padding: 'var(--spectrum-global-dimension-size-200)'
108
- }
109
- }, props.children))));
110
- });
111
-
112
-
113
- export {$d9654c66f3a7e70a$export$9feb1bc2e5f1ccb3 as ColorPicker};
114
- //# sourceMappingURL=ColorPicker.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAgCM,MAAM,0DAAc,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,YAAY,KAA+B,EAAE,GAAoC;IACpI,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,IAAI,SAAS,CAAA,GAAA,sBAAc,EAAE;IAC7B,IAAI,UAAU,CAAA,GAAA,YAAI;IAClB,qBACE,gCAAC,CAAA,GAAA,kBAAc,GAAM,qBACnB,gCAAC,CAAA,GAAA,oBAAY;QAAE,MAAK;QAAU,YAAW;QAAO,WAAW,CAAA,GAAA,mBAAW,EAAE;qBACtE,gCAAC,CAAA,GAAA,aAAK;QACJ,KAAK;QACL,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;UAkBR;YAAC,MAAM,MAAM,IAAI,IAAI;QAAG;OAC1B,CAAC,kBAAC,cAAc,EAAC,iBAChB,gFACE,gCAAC;YACC,WAAW;;;;;;;;;;;;;cASR;gCAAC;YAAc;yBAClB,gCAAC,CAAA,GAAA,yCAAU;YACT,KAAK;YACL,OAAO,MAAM,KAAK;YAClB,MAAM,MAAM,IAAI;YAChB,UAAU,MAAM,QAAQ;YACxB,cAAY,KAAK,CAAC,aAAa;YAC/B,mBAAiB,KAAK,CAAC,kBAAkB;YACzC,oBAAkB,KAAK,CAAC,mBAAmB;YAC3C,gBAAc,KAAK,CAAC,eAAe;aAEtC,MAAM,KAAK,kBACV,gCAAC;YAAK,IAAI;WAAU,MAAM,KAAK,mBAKvC,gCAAC,CAAA,GAAA,aAAK;QACJ,mBAAiB,MAAM,KAAK,GAAG,UAAU,KAAK,CAAC,kBAAkB;QACjE,cAAY,KAAK,CAAC,aAAa;QAC/B,cAAc;YACZ,OAAO;YACP,UAAU;YACV,QAAQ,SAAS,sBAAsB;QACzC;qBACA,gCAAC,CAAA,GAAA,cAAM;QACL,cAAc;YACZ,UAAU;YACV,QAAQ;YACR,SAAS;QACX;OACC,MAAM,QAAQ;AAM3B","sources":["packages/@react-spectrum/color/src/ColorPicker.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {ColorPicker as AriaColorPicker, Button, Color} from 'react-aria-components';\nimport {AriaLabelingProps, FocusableRef, ValueBase} from '@react-types/shared';\nimport {ColorSwatch} from './ColorSwatch';\nimport {Content} from '@react-spectrum/view';\nimport {Dialog, DialogTrigger} from '@react-spectrum/dialog';\nimport React, {ReactNode, useRef} from 'react';\nimport {style} from '@react-spectrum/style-macro-s1' with {type: 'macro'};\nimport {unwrapDOMRef, useFocusableRef} from '@react-spectrum/utils';\nimport {useId} from '@react-aria/utils';\n\nexport interface SpectrumColorPickerProps extends ValueBase<string | Color, Color>, AriaLabelingProps {\n /** A visual label for the color picker. */\n label?: ReactNode,\n /** The contents of the color picker popover, e.g. `<ColorEditor />`. */\n children?: ReactNode,\n /**\n * The size of the color swatch.\n * @default \"M\"\n */\n size?: 'XS' | 'S' | 'M' | 'L',\n /**\n * The corner rounding of the color swatch.\n * @default \"default\"\n */\n rounding?: 'default' | 'none' | 'full'\n}\n\n/**\n * A ColorPicker combines a swatch with a customizable popover for editing a color.\n */\nexport const ColorPicker = React.forwardRef(function ColorPicker(props: SpectrumColorPickerProps, ref: FocusableRef<HTMLButtonElement>) {\n let swatchRef = useRef(null);\n let domRef = useFocusableRef(ref);\n let labelId = useId();\n return (\n <AriaColorPicker {...props}>\n <DialogTrigger type=\"popover\" mobileType=\"tray\" targetRef={unwrapDOMRef(swatchRef)}>\n <Button \n ref={domRef}\n className={style({\n backgroundColor: 'transparent',\n borderStyle: 'none',\n padding: 0,\n display: 'flex',\n alignItems: 'center',\n gap: 'text-to-control',\n outlineStyle: 'none',\n fontFamily: 'sans',\n color: 'body',\n fontSize: {\n size: {\n XS: 'xs',\n S: 'sm',\n M: 'base',\n L: 'lg'\n }\n }\n })({size: props.size || 'M'})}>\n {({isFocusVisible}) => (\n <>\n <div\n className={style({\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineColor: 'focus-ring',\n outlineWidth: 2,\n outlineOffset: 2,\n borderRadius: 'default'\n })({isFocusVisible})}>\n <ColorSwatch\n ref={swatchRef}\n color={props.value}\n size={props.size}\n rounding={props.rounding}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={props['aria-describedby']}\n aria-details={props['aria-details']} />\n </div>\n {props.label && \n <span id={labelId}>{props.label}</span>\n }\n </>\n )}\n </Button>\n <Dialog \n aria-labelledby={props.label ? labelId : props['aria-labelledby']}\n aria-label={props['aria-label']}\n UNSAFE_style={{\n width: 'fit-content',\n minWidth: 0,\n margin: '0 auto' // Center within tray.\n }}>\n <Content \n UNSAFE_style={{\n position: 'relative',\n margin: 'calc(var(--spectrum-dialog-padding) * -1)',\n padding: 'var(--spectrum-global-dimension-size-200)'\n }}>\n {props.children}\n </Content>\n </Dialog>\n </DialogTrigger>\n </AriaColorPicker>\n );\n});\n"],"names":[],"version":3,"file":"ColorPicker.module.js.map"}
@@ -1,126 +0,0 @@
1
- var $2b9adc23f6c7cae1$exports = require("./ColorThumb.main.js");
2
- require("./color.4034864f.css");
3
- var $28060baf29cc5ac7$exports = require("./colorslider_vars_css.main.js");
4
- var $5EHW1$reactspectrumutils = require("@react-spectrum/utils");
5
- var $5EHW1$reactariacomponents = require("react-aria-components");
6
- var $5EHW1$reactspectrumlabel = require("@react-spectrum/label");
7
- var $5EHW1$react = require("react");
8
- var $5EHW1$reactariacolor = require("@react-aria/color");
9
- var $5EHW1$reactstatelycolor = require("@react-stately/color");
10
- var $5EHW1$reactariainteractions = require("@react-aria/interactions");
11
- var $5EHW1$reactariai18n = require("@react-aria/i18n");
12
- var $5EHW1$reactspectrumprovider = require("@react-spectrum/provider");
13
-
14
-
15
- function $parcel$interopDefault(a) {
16
- return a && a.__esModule ? a.default : a;
17
- }
18
-
19
- function $parcel$export(e, n, v, s) {
20
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
21
- }
22
-
23
- $parcel$export(module.exports, "ColorSlider", () => $4537dec0de08c277$export$44fd664bcca5b6fb);
24
- /*
25
- * Copyright 2020 Adobe. All rights reserved.
26
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
27
- * you may not use this file except in compliance with the License. You may obtain a copy
28
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
29
- *
30
- * Unless required by applicable law or agreed to in writing, software distributed under
31
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
32
- * OF ANY KIND, either express or implied. See the License for the specific language
33
- * governing permissions and limitations under the License.
34
- */
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
- const $4537dec0de08c277$export$44fd664bcca5b6fb = /*#__PURE__*/ (0, ($parcel$interopDefault($5EHW1$react))).forwardRef(function ColorSlider(props, ref) {
46
- props = (0, $5EHW1$reactspectrumprovider.useProviderProps)(props);
47
- let inputRef = (0, $5EHW1$react.useRef)(null);
48
- let trackRef = (0, $5EHW1$react.useRef)(null);
49
- let domRef = (0, $5EHW1$reactspectrumutils.useFocusableRef)(ref, inputRef);
50
- [props, domRef] = (0, $5EHW1$reactariacomponents.useContextProps)(props, domRef, (0, $5EHW1$reactariacomponents.ColorSliderContext));
51
- let { isDisabled: isDisabled, channel: channel, orientation: orientation, label: label, showValueLabel: showValueLabel, 'aria-label': ariaLabel } = props;
52
- let vertical = orientation === 'vertical';
53
- let { styleProps: styleProps } = (0, $5EHW1$reactspectrumutils.useStyleProps)(props);
54
- let { locale: locale } = (0, $5EHW1$reactariai18n.useLocale)();
55
- let state = (0, $5EHW1$reactstatelycolor.useColorSliderState)({
56
- ...props,
57
- locale: locale
58
- });
59
- // If vertical and a label is provided, use it as an aria-label instead.
60
- if (vertical && label) {
61
- ariaLabel = ariaLabel || (typeof label === 'string' ? label : undefined);
62
- label = null;
63
- }
64
- // If no external label, aria-label or aria-labelledby is provided,
65
- // default to displaying the localized channel value.
66
- // Specifically check if label is undefined. If label is `null` then display no visible label.
67
- // A default aria-label is provided by useColorSlider in that case.
68
- if (label === undefined && !ariaLabel && !props['aria-labelledby'] && !vertical) label = state.value.getChannelName(channel, locale);
69
- // Show the value label by default if there is a visible label
70
- if (showValueLabel == null) showValueLabel = !!label;
71
- let { inputProps: inputProps, thumbProps: thumbProps, trackProps: trackProps, labelProps: labelProps, outputProps: outputProps } = (0, $5EHW1$reactariacolor.useColorSlider)({
72
- ...props,
73
- label: label,
74
- 'aria-label': ariaLabel,
75
- trackRef: trackRef,
76
- inputRef: inputRef
77
- }, state);
78
- let { isFocusVisible: isFocusVisible } = (0, $5EHW1$reactariainteractions.useFocusVisible)();
79
- let [isFocused, setIsFocused] = (0, $5EHW1$react.useState)(false);
80
- let { focusProps: focusProps } = (0, $5EHW1$reactariainteractions.useFocus)({
81
- isDisabled: isDisabled,
82
- onFocusChange: setIsFocused
83
- });
84
- return /*#__PURE__*/ (0, ($parcel$interopDefault($5EHW1$react))).createElement("div", {
85
- ref: domRef,
86
- ...styleProps,
87
- className: (0, $5EHW1$reactspectrumutils.classNames)((0, ($parcel$interopDefault($28060baf29cc5ac7$exports))), {
88
- 'spectrum-ColorSlider-container--horizontal': !vertical,
89
- 'spectrum-ColorSlider-container--vertical': vertical
90
- }, styleProps.className)
91
- }, label && /*#__PURE__*/ (0, ($parcel$interopDefault($5EHW1$react))).createElement("div", {
92
- className: (0, $5EHW1$reactspectrumutils.classNames)((0, ($parcel$interopDefault($28060baf29cc5ac7$exports))), 'spectrum-ColorSlider-labelContainer')
93
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($5EHW1$react))).createElement((0, $5EHW1$reactspectrumlabel.Label), labelProps, label), props.contextualHelp && /*#__PURE__*/ (0, ($parcel$interopDefault($5EHW1$react))).createElement((0, $5EHW1$reactspectrumutils.SlotProvider), {
94
- slots: {
95
- actionButton: {
96
- UNSAFE_className: (0, $5EHW1$reactspectrumutils.classNames)((0, ($parcel$interopDefault($28060baf29cc5ac7$exports))), 'spectrum-ColorSlider-contextualHelp')
97
- }
98
- }
99
- }, props.contextualHelp), showValueLabel && /*#__PURE__*/ (0, ($parcel$interopDefault($5EHW1$react))).createElement((0, $5EHW1$reactspectrumlabel.Label), {
100
- elementType: "span",
101
- UNSAFE_className: (0, $5EHW1$reactspectrumutils.classNames)((0, ($parcel$interopDefault($28060baf29cc5ac7$exports))), 'spectrum-ColorSlider-valueLabel')
102
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($5EHW1$react))).createElement("output", outputProps, state.value.formatChannelValue(channel, locale)))), /*#__PURE__*/ (0, ($parcel$interopDefault($5EHW1$react))).createElement("div", {
103
- ...trackProps,
104
- ref: trackRef,
105
- className: (0, $5EHW1$reactspectrumutils.classNames)((0, ($parcel$interopDefault($28060baf29cc5ac7$exports))), 'spectrum-ColorSlider', {
106
- 'is-disabled': isDisabled,
107
- 'spectrum-ColorSlider--vertical': vertical
108
- })
109
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($5EHW1$react))).createElement((0, $2b9adc23f6c7cae1$exports.ColorThumb), {
110
- value: state.getDisplayColor(),
111
- isFocused: isFocused && isFocusVisible,
112
- isDisabled: isDisabled,
113
- isDragging: state.isThumbDragging(0),
114
- containerRef: trackRef,
115
- className: (0, $5EHW1$reactspectrumutils.classNames)((0, ($parcel$interopDefault($28060baf29cc5ac7$exports))), 'spectrum-ColorSlider-handle'),
116
- ...thumbProps
117
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($5EHW1$react))).createElement("input", {
118
- ...inputProps,
119
- ...focusProps,
120
- ref: inputRef,
121
- className: (0, $5EHW1$reactspectrumutils.classNames)((0, ($parcel$interopDefault($28060baf29cc5ac7$exports))), 'spectrum-ColorSlider-slider')
122
- }))));
123
- });
124
-
125
-
126
- //# sourceMappingURL=ColorSlider.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAmBM,MAAM,0DAAc,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,YAAY,KAA+B,EAAE,GAAiC;IACjI,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE,KAAK;IAClC,CAAC,OAAO,OAAO,GAAG,CAAA,GAAA,0CAAc,EAAE,OAAO,QAAQ,CAAA,GAAA,6CAAiB;IAElE,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,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,8BAAQ;IAEvB,IAAI,QAAQ,CAAA,GAAA,4CAAkB,EAAE;QAAC,GAAG,KAAK;gBAAE;IAAM;IAEjD,wEAAwE;IACxE,IAAI,YAAY,OAAO;QACrB,YAAY,aAAc,CAAA,OAAO,UAAU,WAAW,QAAQ,SAAQ;QACtE,QAAQ;IACV;IAEA,mEAAmE;IACnE,qDAAqD;IACrD,8FAA8F;IAC9F,mEAAmE;IACnE,IAAI,UAAU,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,UACrE,QAAQ,MAAM,KAAK,CAAC,cAAc,CAAC,SAAS;IAG9C,8DAA8D;IAC9D,IAAI,kBAAkB,MACpB,iBAAiB,CAAC,CAAC;IAGrB,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,cAAE,UAAU,eAAE,WAAW,EAAC,GAAG,CAAA,GAAA,oCAAa,EAAE;QACjF,GAAG,KAAK;eACR;QACA,cAAc;kBACd;kBACA;IACF,GAAG;IAEH,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,4CAAc;IACrC,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,qBAAO,EAAE;IACzC,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;oBAC1B;QACA,eAAe;IACjB;IAEA,qBACE,0DAAC;QACC,KAAK;QACJ,GAAG,UAAU;QACd,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL;YACE,8CAA8C,CAAC;YAC/C,4CAA4C;QAC9C,GACA,WAAW,SAAS;OAErB,uBACC,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBACjC,0DAAC,CAAA,GAAA,+BAAI,GAAM,YAAa,QACvB,MAAM,cAAc,kBACnB,0DAAC,CAAA,GAAA,sCAAW;QACV,OAAO;YACL,cAAc;gBACZ,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;YACvC;QACF;OACC,MAAM,cAAc,GAGxB,gCACC,0DAAC,CAAA,GAAA,+BAAI;QAAE,aAAY;QAAO,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBAC7D,0DAAC,UAAW,aAAc,MAAM,KAAK,CAAC,kBAAkB,CAAC,SAAS,0BAK1E,0DAAC;QACE,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL,wBAAwB;YACtB,eAAe;YACf,kCAAkC;QACpC;qBAGF,0DAAC,CAAA,GAAA,oCAAS;QACR,OAAO,MAAM,eAAe;QAC5B,WAAW,aAAa;QACxB,YAAY;QACZ,YAAY,MAAM,eAAe,CAAC;QAClC,cAAc;QACd,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC7B,GAAG,UAAU;qBACd,0DAAC;QAAO,GAAG,UAAU;QAAG,GAAG,UAAU;QAAE,KAAK;QAAU,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;;AAK9F","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 {ColorSliderContext, useContextProps} from 'react-aria-components';\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\n/**\n * ColorSliders allow users to adjust an individual channel of a color value.\n */\nexport const ColorSlider = React.forwardRef(function ColorSlider(props: SpectrumColorSliderProps, ref: FocusableRef<HTMLDivElement>) {\n props = useProviderProps(props);\n let inputRef = useRef(null);\n let trackRef = useRef(null);\n let domRef = useFocusableRef(ref, inputRef);\n [props, domRef] = useContextProps(props, domRef, ColorSliderContext);\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 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 styleProps.className\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 containerRef={trackRef}\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"],"names":[],"version":3,"file":"ColorSlider.main.js.map"}