@react-aria/color 3.0.0-beta.30 → 3.0.0-beta.32

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 (226) hide show
  1. package/dist/ar-AE.main.js +11 -0
  2. package/dist/ar-AE.main.js.map +1 -0
  3. package/dist/ar-AE.mjs +13 -0
  4. package/dist/ar-AE.module.js +13 -0
  5. package/dist/ar-AE.module.js.map +1 -0
  6. package/dist/bg-BG.main.js +11 -0
  7. package/dist/bg-BG.main.js.map +1 -0
  8. package/dist/bg-BG.mjs +13 -0
  9. package/dist/bg-BG.module.js +13 -0
  10. package/dist/bg-BG.module.js.map +1 -0
  11. package/dist/cs-CZ.main.js +11 -0
  12. package/dist/cs-CZ.main.js.map +1 -0
  13. package/dist/cs-CZ.mjs +13 -0
  14. package/dist/cs-CZ.module.js +13 -0
  15. package/dist/cs-CZ.module.js.map +1 -0
  16. package/dist/da-DK.main.js +11 -0
  17. package/dist/da-DK.main.js.map +1 -0
  18. package/dist/da-DK.mjs +13 -0
  19. package/dist/da-DK.module.js +13 -0
  20. package/dist/da-DK.module.js.map +1 -0
  21. package/dist/de-DE.main.js +11 -0
  22. package/dist/de-DE.main.js.map +1 -0
  23. package/dist/de-DE.mjs +13 -0
  24. package/dist/de-DE.module.js +13 -0
  25. package/dist/de-DE.module.js.map +1 -0
  26. package/dist/el-GR.main.js +11 -0
  27. package/dist/el-GR.main.js.map +1 -0
  28. package/dist/el-GR.mjs +13 -0
  29. package/dist/el-GR.module.js +13 -0
  30. package/dist/el-GR.module.js.map +1 -0
  31. package/dist/en-US.main.js +11 -0
  32. package/dist/en-US.main.js.map +1 -0
  33. package/dist/en-US.mjs +13 -0
  34. package/dist/en-US.module.js +13 -0
  35. package/dist/en-US.module.js.map +1 -0
  36. package/dist/es-ES.main.js +11 -0
  37. package/dist/es-ES.main.js.map +1 -0
  38. package/dist/es-ES.mjs +13 -0
  39. package/dist/es-ES.module.js +13 -0
  40. package/dist/es-ES.module.js.map +1 -0
  41. package/dist/et-EE.main.js +11 -0
  42. package/dist/et-EE.main.js.map +1 -0
  43. package/dist/et-EE.mjs +13 -0
  44. package/dist/et-EE.module.js +13 -0
  45. package/dist/et-EE.module.js.map +1 -0
  46. package/dist/fi-FI.main.js +11 -0
  47. package/dist/fi-FI.main.js.map +1 -0
  48. package/dist/fi-FI.mjs +13 -0
  49. package/dist/fi-FI.module.js +13 -0
  50. package/dist/fi-FI.module.js.map +1 -0
  51. package/dist/fr-FR.main.js +11 -0
  52. package/dist/fr-FR.main.js.map +1 -0
  53. package/dist/fr-FR.mjs +13 -0
  54. package/dist/fr-FR.module.js +13 -0
  55. package/dist/fr-FR.module.js.map +1 -0
  56. package/dist/he-IL.main.js +11 -0
  57. package/dist/he-IL.main.js.map +1 -0
  58. package/dist/he-IL.mjs +13 -0
  59. package/dist/he-IL.module.js +13 -0
  60. package/dist/he-IL.module.js.map +1 -0
  61. package/dist/hr-HR.main.js +11 -0
  62. package/dist/hr-HR.main.js.map +1 -0
  63. package/dist/hr-HR.mjs +13 -0
  64. package/dist/hr-HR.module.js +13 -0
  65. package/dist/hr-HR.module.js.map +1 -0
  66. package/dist/hu-HU.main.js +11 -0
  67. package/dist/hu-HU.main.js.map +1 -0
  68. package/dist/hu-HU.mjs +13 -0
  69. package/dist/hu-HU.module.js +13 -0
  70. package/dist/hu-HU.module.js.map +1 -0
  71. package/dist/import.mjs +7 -1357
  72. package/dist/intlStrings.main.js +108 -0
  73. package/dist/intlStrings.main.js.map +1 -0
  74. package/dist/intlStrings.mjs +110 -0
  75. package/dist/intlStrings.module.js +110 -0
  76. package/dist/intlStrings.module.js.map +1 -0
  77. package/dist/it-IT.main.js +11 -0
  78. package/dist/it-IT.main.js.map +1 -0
  79. package/dist/it-IT.mjs +13 -0
  80. package/dist/it-IT.module.js +13 -0
  81. package/dist/it-IT.module.js.map +1 -0
  82. package/dist/ja-JP.main.js +11 -0
  83. package/dist/ja-JP.main.js.map +1 -0
  84. package/dist/ja-JP.mjs +13 -0
  85. package/dist/ja-JP.module.js +13 -0
  86. package/dist/ja-JP.module.js.map +1 -0
  87. package/dist/ko-KR.main.js +11 -0
  88. package/dist/ko-KR.main.js.map +1 -0
  89. package/dist/ko-KR.mjs +13 -0
  90. package/dist/ko-KR.module.js +13 -0
  91. package/dist/ko-KR.module.js.map +1 -0
  92. package/dist/lt-LT.main.js +11 -0
  93. package/dist/lt-LT.main.js.map +1 -0
  94. package/dist/lt-LT.mjs +13 -0
  95. package/dist/lt-LT.module.js +13 -0
  96. package/dist/lt-LT.module.js.map +1 -0
  97. package/dist/lv-LV.main.js +11 -0
  98. package/dist/lv-LV.main.js.map +1 -0
  99. package/dist/lv-LV.mjs +13 -0
  100. package/dist/lv-LV.module.js +13 -0
  101. package/dist/lv-LV.module.js.map +1 -0
  102. package/dist/main.js +12 -1360
  103. package/dist/main.js.map +1 -1
  104. package/dist/module.js +7 -1357
  105. package/dist/module.js.map +1 -1
  106. package/dist/nb-NO.main.js +11 -0
  107. package/dist/nb-NO.main.js.map +1 -0
  108. package/dist/nb-NO.mjs +13 -0
  109. package/dist/nb-NO.module.js +13 -0
  110. package/dist/nb-NO.module.js.map +1 -0
  111. package/dist/nl-NL.main.js +11 -0
  112. package/dist/nl-NL.main.js.map +1 -0
  113. package/dist/nl-NL.mjs +13 -0
  114. package/dist/nl-NL.module.js +13 -0
  115. package/dist/nl-NL.module.js.map +1 -0
  116. package/dist/pl-PL.main.js +11 -0
  117. package/dist/pl-PL.main.js.map +1 -0
  118. package/dist/pl-PL.mjs +13 -0
  119. package/dist/pl-PL.module.js +13 -0
  120. package/dist/pl-PL.module.js.map +1 -0
  121. package/dist/pt-BR.main.js +11 -0
  122. package/dist/pt-BR.main.js.map +1 -0
  123. package/dist/pt-BR.mjs +13 -0
  124. package/dist/pt-BR.module.js +13 -0
  125. package/dist/pt-BR.module.js.map +1 -0
  126. package/dist/pt-PT.main.js +11 -0
  127. package/dist/pt-PT.main.js.map +1 -0
  128. package/dist/pt-PT.mjs +13 -0
  129. package/dist/pt-PT.module.js +13 -0
  130. package/dist/pt-PT.module.js.map +1 -0
  131. package/dist/ro-RO.main.js +11 -0
  132. package/dist/ro-RO.main.js.map +1 -0
  133. package/dist/ro-RO.mjs +13 -0
  134. package/dist/ro-RO.module.js +13 -0
  135. package/dist/ro-RO.module.js.map +1 -0
  136. package/dist/ru-RU.main.js +11 -0
  137. package/dist/ru-RU.main.js.map +1 -0
  138. package/dist/ru-RU.mjs +13 -0
  139. package/dist/ru-RU.module.js +13 -0
  140. package/dist/ru-RU.module.js.map +1 -0
  141. package/dist/sk-SK.main.js +11 -0
  142. package/dist/sk-SK.main.js.map +1 -0
  143. package/dist/sk-SK.mjs +13 -0
  144. package/dist/sk-SK.module.js +13 -0
  145. package/dist/sk-SK.module.js.map +1 -0
  146. package/dist/sl-SI.main.js +11 -0
  147. package/dist/sl-SI.main.js.map +1 -0
  148. package/dist/sl-SI.mjs +13 -0
  149. package/dist/sl-SI.module.js +13 -0
  150. package/dist/sl-SI.module.js.map +1 -0
  151. package/dist/sr-SP.main.js +11 -0
  152. package/dist/sr-SP.main.js.map +1 -0
  153. package/dist/sr-SP.mjs +13 -0
  154. package/dist/sr-SP.module.js +13 -0
  155. package/dist/sr-SP.module.js.map +1 -0
  156. package/dist/sv-SE.main.js +11 -0
  157. package/dist/sv-SE.main.js.map +1 -0
  158. package/dist/sv-SE.mjs +13 -0
  159. package/dist/sv-SE.module.js +13 -0
  160. package/dist/sv-SE.module.js.map +1 -0
  161. package/dist/tr-TR.main.js +11 -0
  162. package/dist/tr-TR.main.js.map +1 -0
  163. package/dist/tr-TR.mjs +13 -0
  164. package/dist/tr-TR.module.js +13 -0
  165. package/dist/tr-TR.module.js.map +1 -0
  166. package/dist/types.d.ts +41 -7
  167. package/dist/types.d.ts.map +1 -1
  168. package/dist/uk-UA.main.js +11 -0
  169. package/dist/uk-UA.main.js.map +1 -0
  170. package/dist/uk-UA.mjs +13 -0
  171. package/dist/uk-UA.module.js +13 -0
  172. package/dist/uk-UA.module.js.map +1 -0
  173. package/dist/useColorArea.main.js +404 -0
  174. package/dist/useColorArea.main.js.map +1 -0
  175. package/dist/useColorArea.mjs +399 -0
  176. package/dist/useColorArea.module.js +399 -0
  177. package/dist/useColorArea.module.js.map +1 -0
  178. package/dist/useColorAreaGradient.main.js +123 -0
  179. package/dist/useColorAreaGradient.main.js.map +1 -0
  180. package/dist/useColorAreaGradient.mjs +118 -0
  181. package/dist/useColorAreaGradient.module.js +118 -0
  182. package/dist/useColorAreaGradient.module.js.map +1 -0
  183. package/dist/useColorChannelField.main.js +36 -0
  184. package/dist/useColorChannelField.main.js.map +1 -0
  185. package/dist/useColorChannelField.mjs +31 -0
  186. package/dist/useColorChannelField.module.js +31 -0
  187. package/dist/useColorChannelField.module.js.map +1 -0
  188. package/dist/useColorField.main.js +98 -0
  189. package/dist/useColorField.main.js.map +1 -0
  190. package/dist/useColorField.mjs +93 -0
  191. package/dist/useColorField.module.js +93 -0
  192. package/dist/useColorField.module.js.map +1 -0
  193. package/dist/useColorSlider.main.js +132 -0
  194. package/dist/useColorSlider.main.js.map +1 -0
  195. package/dist/useColorSlider.mjs +127 -0
  196. package/dist/useColorSlider.module.js +127 -0
  197. package/dist/useColorSlider.module.js.map +1 -0
  198. package/dist/useColorSwatch.main.js +67 -0
  199. package/dist/useColorSwatch.main.js.map +1 -0
  200. package/dist/useColorSwatch.mjs +62 -0
  201. package/dist/useColorSwatch.module.js +62 -0
  202. package/dist/useColorSwatch.module.js.map +1 -0
  203. package/dist/useColorWheel.main.js +274 -0
  204. package/dist/useColorWheel.main.js.map +1 -0
  205. package/dist/useColorWheel.mjs +269 -0
  206. package/dist/useColorWheel.module.js +269 -0
  207. package/dist/useColorWheel.module.js.map +1 -0
  208. package/dist/zh-CN.main.js +11 -0
  209. package/dist/zh-CN.main.js.map +1 -0
  210. package/dist/zh-CN.mjs +13 -0
  211. package/dist/zh-CN.module.js +13 -0
  212. package/dist/zh-CN.module.js.map +1 -0
  213. package/dist/zh-TW.main.js +11 -0
  214. package/dist/zh-TW.main.js.map +1 -0
  215. package/dist/zh-TW.mjs +13 -0
  216. package/dist/zh-TW.module.js +13 -0
  217. package/dist/zh-TW.module.js.map +1 -0
  218. package/package.json +14 -13
  219. package/src/index.ts +4 -0
  220. package/src/useColorArea.ts +32 -23
  221. package/src/useColorAreaGradient.ts +66 -189
  222. package/src/useColorChannelField.ts +37 -0
  223. package/src/useColorField.ts +18 -14
  224. package/src/useColorSlider.ts +28 -4
  225. package/src/useColorSwatch.ts +74 -0
  226. package/src/useColorWheel.ts +19 -5
package/dist/main.js CHANGED
@@ -1,962 +1,21 @@
1
- var $kZqDi$reactariautils = require("@react-aria/utils");
2
- var $kZqDi$react = require("react");
3
- var $kZqDi$reactariainteractions = require("@react-aria/interactions");
4
- var $kZqDi$reactariai18n = require("@react-aria/i18n");
5
- var $kZqDi$reactariavisuallyhidden = require("@react-aria/visually-hidden");
6
- var $kZqDi$reactariaslider = require("@react-aria/slider");
7
- var $kZqDi$reactstatelyform = require("@react-stately/form");
8
- var $kZqDi$reactariatextfield = require("@react-aria/textfield");
9
- var $kZqDi$reactariaspinbutton = require("@react-aria/spinbutton");
1
+ var $47925bd68062ac17$exports = require("./useColorArea.main.js");
2
+ var $afbb9647440a7f5b$exports = require("./useColorSlider.main.js");
3
+ var $1d29bf243d4a9a53$exports = require("./useColorWheel.main.js");
4
+ var $58c850037bc7a7ce$exports = require("./useColorField.main.js");
5
+ var $7c947b33be1ec2a6$exports = require("./useColorSwatch.main.js");
6
+ var $d84c0c836f6e3601$exports = require("./useColorChannelField.main.js");
10
7
 
11
8
 
12
9
  function $parcel$export(e, n, v, s) {
13
10
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
14
11
  }
15
12
 
16
- function $parcel$interopDefault(a) {
17
- return a && a.__esModule ? a.default : a;
18
- }
19
-
20
- $parcel$export(module.exports, "useColorArea", () => $47925bd68062ac17$export$2f92a7a615a014f6);
21
- $parcel$export(module.exports, "useColorSlider", () => $afbb9647440a7f5b$export$106b7a4e66508f66);
22
- $parcel$export(module.exports, "useColorWheel", () => $1d29bf243d4a9a53$export$9064ff4e44b3729a);
23
- $parcel$export(module.exports, "useColorField", () => $58c850037bc7a7ce$export$77e32ca575a28fdf);
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
- * Copyright 2020 Adobe. All rights reserved.
36
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
37
- * you may not use this file except in compliance with the License. You may obtain a copy
38
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
39
- *
40
- * Unless required by applicable law or agreed to in writing, software distributed under
41
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
42
- * OF ANY KIND, either express or implied. See the License for the specific language
43
- * governing permissions and limitations under the License.
44
- */
45
- var $4a33e168940636d5$exports = {};
46
- var $f141a15c3076a67b$exports = {};
47
- $f141a15c3076a67b$exports = {
48
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
49
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
50
- "colorPicker": `\u{623}\u{62F}\u{627}\u{629} \u{627}\u{646}\u{62A}\u{642}\u{627}\u{621} \u{627}\u{644}\u{644}\u{648}\u{646}`,
51
- "twoDimensionalSlider": `\u{645}\u{64F}\u{646}\u{632}\u{644}\u{642} 2D`
52
- };
53
-
54
-
55
- var $435ac2a9fdd2ae5e$exports = {};
56
- $435ac2a9fdd2ae5e$exports = {
57
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
58
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
59
- "colorPicker": `\u{421}\u{440}\u{435}\u{434}\u{441}\u{442}\u{432}\u{43E} \u{437}\u{430} \u{438}\u{437}\u{431}\u{438}\u{440}\u{430}\u{43D}\u{435} \u{43D}\u{430} \u{446}\u{432}\u{44F}\u{442}`,
60
- "twoDimensionalSlider": `2D \u{43F}\u{43B}\u{44A}\u{437}\u{433}\u{430}\u{447}`
61
- };
62
-
63
-
64
- var $6b29758b432284f5$exports = {};
65
- $6b29758b432284f5$exports = {
66
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
67
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
68
- "colorPicker": `V\xfdb\u{11B}r barvy`,
69
- "twoDimensionalSlider": `2D posuvn\xedk`
70
- };
71
-
72
-
73
- var $357597bcf4afd6fb$exports = {};
74
- $357597bcf4afd6fb$exports = {
75
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
76
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
77
- "colorPicker": `Farvev\xe6lger`,
78
- "twoDimensionalSlider": `2D-skyder`
79
- };
80
-
81
-
82
- var $ddc6333960e2b591$exports = {};
83
- $ddc6333960e2b591$exports = {
84
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
85
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
86
- "colorPicker": `Farbw\xe4hler`,
87
- "twoDimensionalSlider": `2D-Schieberegler`
88
- };
89
-
90
-
91
- var $417ee93d3ca474c0$exports = {};
92
- $417ee93d3ca474c0$exports = {
93
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
94
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
95
- "colorPicker": `\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3BF}\u{3B3}\u{3AD}\u{3B1}\u{3C2} \u{3C7}\u{3C1}\u{3C9}\u{3BC}\u{3AC}\u{3C4}\u{3C9}\u{3BD}`,
96
- "twoDimensionalSlider": `\u{3A1}\u{3C5}\u{3B8}\u{3BC}\u{3B9}\u{3C3}\u{3C4}\u{3B9}\u{3BA}\u{3CC} 2D`
97
- };
98
-
99
-
100
- var $519561bc6dcff98b$exports = {};
101
- $519561bc6dcff98b$exports = {
102
- "colorPicker": `Color picker`,
103
- "twoDimensionalSlider": `2D slider`,
104
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
105
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`
106
- };
107
-
108
-
109
- var $7a34c3fcc03402b8$exports = {};
110
- $7a34c3fcc03402b8$exports = {
111
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
112
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
113
- "colorPicker": `Selector de color`,
114
- "twoDimensionalSlider": `Regulador 2D`
115
- };
116
-
117
-
118
- var $860f86d6eae22cba$exports = {};
119
- $860f86d6eae22cba$exports = {
120
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
121
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
122
- "colorPicker": `V\xe4rvivalija`,
123
- "twoDimensionalSlider": `2D-liugur`
124
- };
125
-
126
-
127
- var $8525d3c77b8a51b0$exports = {};
128
- $8525d3c77b8a51b0$exports = {
129
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
130
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
131
- "colorPicker": `V\xe4rimuokkain`,
132
- "twoDimensionalSlider": `2D-liukus\xe4\xe4din`
133
- };
134
-
135
-
136
- var $8240fe6825e900ec$exports = {};
137
- $8240fe6825e900ec$exports = {
138
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
139
- "colorNameAndValue": (args)=>`${args.name}\xa0: ${args.value}`,
140
- "colorPicker": `S\xe9lecteur de couleurs`,
141
- "twoDimensionalSlider": `Curseur\xa02D`
142
- };
143
-
144
-
145
- var $377849238307c673$exports = {};
146
- $377849238307c673$exports = {
147
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
148
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
149
- "colorPicker": `\u{5D1}\u{5D5}\u{5D7}\u{5E8} \u{5D4}\u{5E6}\u{5D1}\u{5E2}\u{5D9}\u{5DD}`,
150
- "twoDimensionalSlider": `\u{5DE}\u{5D7}\u{5D5}\u{5D5}\u{5DF} \u{5D3}\u{5D5} \u{5DE}\u{5D9}\u{5DE}\u{5D3}\u{5D9}`
151
- };
152
-
153
-
154
- var $5a6f44e0ec14b083$exports = {};
155
- $5a6f44e0ec14b083$exports = {
156
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
157
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
158
- "colorPicker": `Odabir boje`,
159
- "twoDimensionalSlider": `2D kliza\u{10D}`
160
- };
161
-
162
-
163
- var $82327d6e71e3e273$exports = {};
164
- $82327d6e71e3e273$exports = {
165
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
166
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
167
- "colorPicker": `Sz\xednv\xe1laszt\xf3`,
168
- "twoDimensionalSlider": `2D-cs\xfaszka`
169
- };
170
-
171
-
172
- var $b1e297275c248ab8$exports = {};
173
- $b1e297275c248ab8$exports = {
174
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
175
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
176
- "colorPicker": `Selettore colore`,
177
- "twoDimensionalSlider": `Cursore 2D`
178
- };
179
-
180
-
181
- var $b39c9f2638b4d2b9$exports = {};
182
- $b39c9f2638b4d2b9$exports = {
183
- "colorInputLabel": (args)=>`${args.label}\u{3001}${args.channelLabel}`,
184
- "colorNameAndValue": (args)=>`${args.name} : ${args.value}`,
185
- "colorPicker": `\u{30AB}\u{30E9}\u{30FC}\u{30D4}\u{30C3}\u{30AB}\u{30FC}`,
186
- "twoDimensionalSlider": `2D \u{30B9}\u{30E9}\u{30A4}\u{30C0}\u{30FC}`
187
- };
188
-
189
-
190
- var $2d2fbf4195848a62$exports = {};
191
- $2d2fbf4195848a62$exports = {
192
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
193
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
194
- "colorPicker": `\u{C0C9}\u{C0C1} \u{D53C}\u{CEE4}`,
195
- "twoDimensionalSlider": `2D \u{C2AC}\u{B77C}\u{C774}\u{B354}`
196
- };
197
-
198
-
199
- var $ea88350d0828fa2c$exports = {};
200
- $ea88350d0828fa2c$exports = {
201
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
202
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
203
- "colorPicker": `Spalv\u{173} parinkiklis`,
204
- "twoDimensionalSlider": `2D slankiklis`
205
- };
206
-
207
-
208
- var $0e0acd541630120a$exports = {};
209
- $0e0acd541630120a$exports = {
210
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
211
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
212
- "colorPicker": `Kr\u{101}su atlas\u{12B}t\u{101}js`,
213
- "twoDimensionalSlider": `2D sl\u{12B}dnis`
214
- };
215
-
216
-
217
- var $952a458224052046$exports = {};
218
- $952a458224052046$exports = {
219
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
220
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
221
- "colorPicker": `Fargevelger`,
222
- "twoDimensionalSlider": `2D-glidebryter`
223
- };
224
-
225
-
226
- var $2d8e195bc5683483$exports = {};
227
- $2d8e195bc5683483$exports = {
228
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
229
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
230
- "colorPicker": `Kleurkiezer`,
231
- "twoDimensionalSlider": `2D-schuifregelaar`
232
- };
233
-
234
-
235
- var $750d83f83c5f38d4$exports = {};
236
- $750d83f83c5f38d4$exports = {
237
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
238
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
239
- "colorPicker": `Pr\xf3bnik kolor\xf3w`,
240
- "twoDimensionalSlider": `Suwak 2D`
241
- };
242
-
243
-
244
- var $656b2846f611067c$exports = {};
245
- $656b2846f611067c$exports = {
246
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
247
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
248
- "colorPicker": `Seletor de cores`,
249
- "twoDimensionalSlider": `Controle deslizante 2D`
250
- };
251
-
252
-
253
- var $58ce120874d069dd$exports = {};
254
- $58ce120874d069dd$exports = {
255
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
256
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
257
- "colorPicker": `Seletor de cores`,
258
- "twoDimensionalSlider": `Controle deslizante 2D`
259
- };
260
-
261
-
262
- var $fd6c85b4eba18825$exports = {};
263
- $fd6c85b4eba18825$exports = {
264
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
265
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
266
- "colorPicker": `Selector de culori`,
267
- "twoDimensionalSlider": `Glisor 2D`
268
- };
269
-
270
-
271
- var $8849a15ecc435984$exports = {};
272
- $8849a15ecc435984$exports = {
273
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
274
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
275
- "colorPicker": `\u{41F}\u{430}\u{43B}\u{438}\u{442}\u{440}\u{430} \u{446}\u{432}\u{435}\u{442}\u{43E}\u{432}`,
276
- "twoDimensionalSlider": `\u{41F}\u{43E}\u{43B}\u{437}\u{443}\u{43D}\u{43E}\u{43A} 2D`
277
- };
278
-
279
-
280
- var $5192372f064be783$exports = {};
281
- $5192372f064be783$exports = {
282
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
283
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
284
- "colorPicker": `V\xfdber farieb`,
285
- "twoDimensionalSlider": `2D jazdec`
286
- };
287
-
288
-
289
- var $094525f9176df65d$exports = {};
290
- $094525f9176df65d$exports = {
291
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
292
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
293
- "colorPicker": `Izbirnik barv`,
294
- "twoDimensionalSlider": `2D drsnik`
295
- };
296
-
297
-
298
- var $9795aa59b4ad40ed$exports = {};
299
- $9795aa59b4ad40ed$exports = {
300
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
301
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
302
- "colorPicker": `Bira\u{10D} boja`,
303
- "twoDimensionalSlider": `2D kliza\u{10D}`
304
- };
305
-
306
-
307
- var $9ebaa0b485f13e4d$exports = {};
308
- $9ebaa0b485f13e4d$exports = {
309
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
310
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
311
- "colorPicker": `F\xe4rgv\xe4ljaren`,
312
- "twoDimensionalSlider": `2D-reglage`
313
- };
314
-
315
-
316
- var $ad58e2e4e0f2e750$exports = {};
317
- $ad58e2e4e0f2e750$exports = {
318
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
319
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
320
- "colorPicker": `Renk Se\xe7ici`,
321
- "twoDimensionalSlider": `2D s\xfcrg\xfc`
322
- };
323
-
324
-
325
- var $dafc19306f8b2dfc$exports = {};
326
- $dafc19306f8b2dfc$exports = {
327
- "colorInputLabel": (args)=>`${args.label}, ${args.channelLabel}`,
328
- "colorNameAndValue": (args)=>`${args.name}: ${args.value}`,
329
- "colorPicker": `\u{41F}\u{430}\u{43B}\u{456}\u{442}\u{440}\u{430} \u{43A}\u{43E}\u{43B}\u{44C}\u{43E}\u{440}\u{456}\u{432}`,
330
- "twoDimensionalSlider": `\u{41F}\u{43E}\u{432}\u{437}\u{443}\u{43D}\u{43E}\u{43A} 2D`
331
- };
332
-
333
-
334
- var $d31a8b80af5acc16$exports = {};
335
- $d31a8b80af5acc16$exports = {
336
- "colorInputLabel": (args)=>`${args.label}\u{3001}${args.channelLabel}`,
337
- "colorNameAndValue": (args)=>`${args.name}\u{FF1A}${args.value}`,
338
- "colorPicker": `\u{62FE}\u{8272}\u{5668}`,
339
- "twoDimensionalSlider": `2D \u{6ED1}\u{5757}`
340
- };
341
-
342
-
343
- var $7377d28aec5fa200$exports = {};
344
- $7377d28aec5fa200$exports = {
345
- "colorInputLabel": (args)=>`${args.label}\u{FF0C}${args.channelLabel}`,
346
- "colorNameAndValue": (args)=>`${args.name}\u{FF1A}${args.value}`,
347
- "colorPicker": `\u{6AA2}\u{8272}\u{5668}`,
348
- "twoDimensionalSlider": `2D \u{6ED1}\u{687F}`
349
- };
350
-
351
-
352
- $4a33e168940636d5$exports = {
353
- "ar-AE": $f141a15c3076a67b$exports,
354
- "bg-BG": $435ac2a9fdd2ae5e$exports,
355
- "cs-CZ": $6b29758b432284f5$exports,
356
- "da-DK": $357597bcf4afd6fb$exports,
357
- "de-DE": $ddc6333960e2b591$exports,
358
- "el-GR": $417ee93d3ca474c0$exports,
359
- "en-US": $519561bc6dcff98b$exports,
360
- "es-ES": $7a34c3fcc03402b8$exports,
361
- "et-EE": $860f86d6eae22cba$exports,
362
- "fi-FI": $8525d3c77b8a51b0$exports,
363
- "fr-FR": $8240fe6825e900ec$exports,
364
- "he-IL": $377849238307c673$exports,
365
- "hr-HR": $5a6f44e0ec14b083$exports,
366
- "hu-HU": $82327d6e71e3e273$exports,
367
- "it-IT": $b1e297275c248ab8$exports,
368
- "ja-JP": $b39c9f2638b4d2b9$exports,
369
- "ko-KR": $2d2fbf4195848a62$exports,
370
- "lt-LT": $ea88350d0828fa2c$exports,
371
- "lv-LV": $0e0acd541630120a$exports,
372
- "nb-NO": $952a458224052046$exports,
373
- "nl-NL": $2d8e195bc5683483$exports,
374
- "pl-PL": $750d83f83c5f38d4$exports,
375
- "pt-BR": $656b2846f611067c$exports,
376
- "pt-PT": $58ce120874d069dd$exports,
377
- "ro-RO": $fd6c85b4eba18825$exports,
378
- "ru-RU": $8849a15ecc435984$exports,
379
- "sk-SK": $5192372f064be783$exports,
380
- "sl-SI": $094525f9176df65d$exports,
381
- "sr-SP": $9795aa59b4ad40ed$exports,
382
- "sv-SE": $9ebaa0b485f13e4d$exports,
383
- "tr-TR": $ad58e2e4e0f2e750$exports,
384
- "uk-UA": $dafc19306f8b2dfc$exports,
385
- "zh-CN": $d31a8b80af5acc16$exports,
386
- "zh-TW": $7377d28aec5fa200$exports
387
- };
388
-
389
-
390
-
391
- /*
392
- * Copyright 2022 Adobe. All rights reserved.
393
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
394
- * you may not use this file except in compliance with the License. You may obtain a copy
395
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
396
- *
397
- * Unless required by applicable law or agreed to in writing, software distributed under
398
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
399
- * OF ANY KIND, either express or implied. See the License for the specific language
400
- * governing permissions and limitations under the License.
401
- */
402
- const $99936ad0bf67c8c4$var$generateRGB_R = (orientation, dir, zValue)=>{
403
- let maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, transparent, #000)`;
404
- let result = {
405
- colorAreaStyles: {
406
- backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(${zValue},0,0),rgb(${zValue},255,0))`
407
- },
408
- gradientStyles: {
409
- backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(${zValue},0,255),rgb(${zValue},255,255))`,
410
- "WebkitMaskImage": maskImage,
411
- maskImage: maskImage
412
- }
413
- };
414
- return result;
415
- };
416
- const $99936ad0bf67c8c4$var$generateRGB_G = (orientation, dir, zValue)=>{
417
- let maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, transparent, #000)`;
418
- let result = {
419
- colorAreaStyles: {
420
- backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,${zValue},0),rgb(255,${zValue},0))`
421
- },
422
- gradientStyles: {
423
- backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,${zValue},255),rgb(255,${zValue},255))`,
424
- "WebkitMaskImage": maskImage,
425
- maskImage: maskImage
426
- }
427
- };
428
- return result;
429
- };
430
- const $99936ad0bf67c8c4$var$generateRGB_B = (orientation, dir, zValue)=>{
431
- let maskImage = `linear-gradient(to ${orientation[Number(!dir)]}, transparent, #000)`;
432
- let result = {
433
- colorAreaStyles: {
434
- backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,0,${zValue}),rgb(255,0,${zValue}))`
435
- },
436
- gradientStyles: {
437
- backgroundImage: `linear-gradient(to ${orientation[Number(dir)]},rgb(0,255,${zValue}),rgb(255,255,${zValue}))`,
438
- "WebkitMaskImage": maskImage,
439
- maskImage: maskImage
440
- }
441
- };
442
- return result;
443
- };
444
- const $99936ad0bf67c8c4$var$generateHSL_H = (orientation, dir, zValue)=>{
445
- let result = {
446
- colorAreaStyles: {},
447
- gradientStyles: {
448
- background: [
449
- `linear-gradient(to ${orientation[Number(dir)]}, hsla(0,0%,0%,1) 0%, hsla(0,0%,0%,0) 50%, hsla(0,0%,100%,0) 50%, hsla(0,0%,100%,1) 100%)`,
450
- `linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,50%),hsla(0,0%,50%,0))`,
451
- `hsl(${zValue}, 100%, 50%)`
452
- ].join(",")
453
- }
454
- };
455
- return result;
456
- };
457
- const $99936ad0bf67c8c4$var$generateHSL_S = (orientation, dir, alphaValue)=>{
458
- let result = {
459
- colorAreaStyles: {},
460
- gradientStyles: {
461
- background: [
462
- `linear-gradient(to ${orientation[Number(!dir)]}, hsla(0,0%,0%,${alphaValue}) 0%, hsla(0,0%,0%,0) 50%, hsla(0,0%,100%,0) 50%, hsla(0,0%,100%,${alphaValue}) 100%)`,
463
- `linear-gradient(to ${orientation[Number(dir)]},hsla(0,100%,50%,${alphaValue}),hsla(60,100%,50%,${alphaValue}),hsla(120,100%,50%,${alphaValue}),hsla(180,100%,50%,${alphaValue}),hsla(240,100%,50%,${alphaValue}),hsla(300,100%,50%,${alphaValue}),hsla(359,100%,50%,${alphaValue}))`,
464
- "hsl(0, 0%, 50%)"
465
- ].join(",")
466
- }
467
- };
468
- return result;
469
- };
470
- const $99936ad0bf67c8c4$var$generateHSL_L = (orientation, dir, zValue)=>{
471
- let result = {
472
- colorAreaStyles: {},
473
- gradientStyles: {
474
- backgroundImage: [
475
- `linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,${zValue}%),hsla(0,0%,${zValue}%,0))`,
476
- `linear-gradient(to ${orientation[Number(dir)]},hsl(0,100%,${zValue}%),hsl(60,100%,${zValue}%),hsl(120,100%,${zValue}%),hsl(180,100%,${zValue}%),hsl(240,100%,${zValue}%),hsl(300,100%,${zValue}%),hsl(360,100%,${zValue}%))`
477
- ].join(",")
478
- }
479
- };
480
- return result;
481
- };
482
- const $99936ad0bf67c8c4$var$generateHSB_H = (orientation, dir, zValue)=>{
483
- let result = {
484
- colorAreaStyles: {},
485
- gradientStyles: {
486
- background: [
487
- `linear-gradient(to ${orientation[Number(dir)]},hsl(0,0%,0%),hsla(0,0%,0%,0))`,
488
- `linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,100%),hsla(0,0%,100%,0))`,
489
- `hsl(${zValue}, 100%, 50%)`
490
- ].join(",")
491
- }
492
- };
493
- return result;
494
- };
495
- const $99936ad0bf67c8c4$var$generateHSB_S = (orientation, dir, alphaValue)=>{
496
- let result = {
497
- colorAreaStyles: {},
498
- gradientStyles: {
499
- background: [
500
- `linear-gradient(to ${orientation[Number(!dir)]},hsla(0,0%,0%,${alphaValue}),hsla(0,0%,0%,0))`,
501
- `linear-gradient(to ${orientation[Number(dir)]},hsla(0,100%,50%,${alphaValue}),hsla(60,100%,50%,${alphaValue}),hsla(120,100%,50%,${alphaValue}),hsla(180,100%,50%,${alphaValue}),hsla(240,100%,50%,${alphaValue}),hsla(300,100%,50%,${alphaValue}),hsla(359,100%,50%,${alphaValue}))`,
502
- `linear-gradient(to ${orientation[Number(!dir)]},hsl(0,0%,0%),hsl(0,0%,100%))`
503
- ].join(",")
504
- }
505
- };
506
- return result;
507
- };
508
- const $99936ad0bf67c8c4$var$generateHSB_B = (orientation, dir, alphaValue)=>{
509
- let result = {
510
- colorAreaStyles: {},
511
- gradientStyles: {
512
- background: [
513
- `linear-gradient(to ${orientation[Number(!dir)]},hsla(0,0%,100%,${alphaValue}),hsla(0,0%,100%,0))`,
514
- `linear-gradient(to ${orientation[Number(dir)]},hsla(0,100%,50%,${alphaValue}),hsla(60,100%,50%,${alphaValue}),hsla(120,100%,50%,${alphaValue}),hsla(180,100%,50%,${alphaValue}),hsla(240,100%,50%,${alphaValue}),hsla(300,100%,50%,${alphaValue}),hsla(359,100%,50%,${alphaValue}))`,
515
- "#000"
516
- ].join(",")
517
- }
518
- };
519
- return result;
520
- };
521
- function $99936ad0bf67c8c4$export$dd62420467d245ca({ direction: direction, state: state, zChannel: zChannel, xChannel: xChannel, isDisabled: isDisabled }) {
522
- let returnVal = (0, $kZqDi$react.useMemo)(()=>{
523
- let orientation = [
524
- "top",
525
- direction === "rtl" ? "left" : "right"
526
- ];
527
- let dir = false;
528
- let background = {
529
- colorAreaStyles: {},
530
- gradientStyles: {}
531
- };
532
- let zValue = state.value.getChannelValue(zChannel);
533
- let { minValue: zMin, maxValue: zMax } = state.value.getChannelRange(zChannel);
534
- let alphaValue = (zValue - zMin) / (zMax - zMin);
535
- let isHSL = state.value.getColorSpace() === "hsl";
536
- if (!isDisabled) switch(zChannel){
537
- case "red":
538
- dir = xChannel === "green";
539
- background = $99936ad0bf67c8c4$var$generateRGB_R(orientation, dir, zValue);
540
- break;
541
- case "green":
542
- dir = xChannel === "red";
543
- background = $99936ad0bf67c8c4$var$generateRGB_G(orientation, dir, zValue);
544
- break;
545
- case "blue":
546
- dir = xChannel === "red";
547
- background = $99936ad0bf67c8c4$var$generateRGB_B(orientation, dir, zValue);
548
- break;
549
- case "hue":
550
- dir = xChannel !== "saturation";
551
- if (isHSL) background = $99936ad0bf67c8c4$var$generateHSL_H(orientation, dir, zValue);
552
- else background = $99936ad0bf67c8c4$var$generateHSB_H(orientation, dir, zValue);
553
- break;
554
- case "saturation":
555
- dir = xChannel === "hue";
556
- if (isHSL) background = $99936ad0bf67c8c4$var$generateHSL_S(orientation, dir, alphaValue);
557
- else background = $99936ad0bf67c8c4$var$generateHSB_S(orientation, dir, alphaValue);
558
- break;
559
- case "brightness":
560
- dir = xChannel === "hue";
561
- background = $99936ad0bf67c8c4$var$generateHSB_B(orientation, dir, alphaValue);
562
- break;
563
- case "lightness":
564
- dir = xChannel === "hue";
565
- background = $99936ad0bf67c8c4$var$generateHSL_L(orientation, dir, zValue);
566
- break;
567
- }
568
- let { x: x, y: y } = state.getThumbPosition();
569
- if (direction === "rtl") x = 1 - x;
570
- let forcedColorAdjustNoneStyle = {
571
- forcedColorAdjust: "none"
572
- };
573
- return {
574
- colorAreaStyleProps: {
575
- style: {
576
- position: "relative",
577
- touchAction: "none",
578
- ...forcedColorAdjustNoneStyle,
579
- ...background.colorAreaStyles
580
- }
581
- },
582
- gradientStyleProps: {
583
- style: {
584
- touchAction: "none",
585
- ...forcedColorAdjustNoneStyle,
586
- ...background.gradientStyles
587
- }
588
- },
589
- thumbStyleProps: {
590
- style: {
591
- position: "absolute",
592
- left: `${x * 100}%`,
593
- top: `${y * 100}%`,
594
- transform: "translate(0%, 0%)",
595
- touchAction: "none",
596
- ...forcedColorAdjustNoneStyle
597
- }
598
- }
599
- };
600
- }, [
601
- direction,
602
- state,
603
- zChannel,
604
- xChannel,
605
- isDisabled
606
- ]);
607
- return returnVal;
608
- }
609
-
610
-
611
-
612
-
613
-
614
- function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
615
- let { isDisabled: isDisabled, inputXRef: inputXRef, inputYRef: inputYRef, containerRef: containerRef, "aria-label": ariaLabel, xName: xName, yName: yName } = props;
616
- let stringFormatter = (0, $kZqDi$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($4a33e168940636d5$exports))), "@react-aria/color");
617
- let { addGlobalListener: addGlobalListener, removeGlobalListener: removeGlobalListener } = (0, $kZqDi$reactariautils.useGlobalListeners)();
618
- let { direction: direction, locale: locale } = (0, $kZqDi$reactariai18n.useLocale)();
619
- let [focusedInput, setFocusedInput] = (0, $kZqDi$react.useState)(null);
620
- let focusInput = (0, $kZqDi$react.useCallback)((inputRef = inputXRef)=>{
621
- if (inputRef.current) (0, $kZqDi$reactariautils.focusWithoutScrolling)(inputRef.current);
622
- }, [
623
- inputXRef
624
- ]);
625
- (0, $kZqDi$reactariautils.useFormReset)(inputXRef, [
626
- state.xValue,
627
- state.yValue
628
- ], ([x, y])=>{
629
- let newColor = state.value.withChannelValue(state.channels.xChannel, x).withChannelValue(state.channels.yChannel, y);
630
- state.setValue(newColor);
631
- });
632
- let [valueChangedViaKeyboard, setValueChangedViaKeyboard] = (0, $kZqDi$react.useState)(false);
633
- let { xChannel: xChannel, yChannel: yChannel, zChannel: zChannel } = state.channels;
634
- let xChannelStep = state.xChannelStep;
635
- let yChannelStep = state.yChannelStep;
636
- let currentPosition = (0, $kZqDi$react.useRef)(null);
637
- let { keyboardProps: keyboardProps } = (0, $kZqDi$reactariainteractions.useKeyboard)({
638
- onKeyDown (e) {
639
- // these are the cases that useMove doesn't handle
640
- if (!/^(PageUp|PageDown|Home|End)$/.test(e.key)) {
641
- e.continuePropagation();
642
- return;
643
- }
644
- // same handling as useMove, don't need to stop propagation, useKeyboard will do that for us
645
- e.preventDefault();
646
- // remember to set this and unset it so that onChangeEnd is fired
647
- state.setDragging(true);
648
- setValueChangedViaKeyboard(true);
649
- let dir;
650
- switch(e.key){
651
- case "PageUp":
652
- state.incrementY(state.yChannelPageStep);
653
- dir = "y";
654
- break;
655
- case "PageDown":
656
- state.decrementY(state.yChannelPageStep);
657
- dir = "y";
658
- break;
659
- case "Home":
660
- direction === "rtl" ? state.incrementX(state.xChannelPageStep) : state.decrementX(state.xChannelPageStep);
661
- dir = "x";
662
- break;
663
- case "End":
664
- direction === "rtl" ? state.decrementX(state.xChannelPageStep) : state.incrementX(state.xChannelPageStep);
665
- dir = "x";
666
- break;
667
- }
668
- state.setDragging(false);
669
- if (dir) {
670
- let input = dir === "x" ? inputXRef : inputYRef;
671
- focusInput(input);
672
- setFocusedInput(dir);
673
- }
674
- }
675
- });
676
- let moveHandler = {
677
- onMoveStart () {
678
- currentPosition.current = null;
679
- state.setDragging(true);
680
- },
681
- onMove ({ deltaX: deltaX, deltaY: deltaY, pointerType: pointerType, shiftKey: shiftKey }) {
682
- var _containerRef_current;
683
- let { incrementX: incrementX, decrementX: decrementX, incrementY: incrementY, decrementY: decrementY, xChannelPageStep: xChannelPageStep, xChannelStep: xChannelStep, yChannelPageStep: yChannelPageStep, yChannelStep: yChannelStep, getThumbPosition: getThumbPosition, setColorFromPoint: setColorFromPoint } = state;
684
- if (currentPosition.current == null) currentPosition.current = getThumbPosition();
685
- let { width: width, height: height } = ((_containerRef_current = containerRef.current) === null || _containerRef_current === void 0 ? void 0 : _containerRef_current.getBoundingClientRect()) || {
686
- width: 0,
687
- height: 0
688
- };
689
- let valueChanged = deltaX !== 0 || deltaY !== 0;
690
- if (pointerType === "keyboard") {
691
- let deltaXValue = shiftKey && xChannelPageStep > xChannelStep ? xChannelPageStep : xChannelStep;
692
- let deltaYValue = shiftKey && yChannelPageStep > yChannelStep ? yChannelPageStep : yChannelStep;
693
- if (deltaX > 0 && direction === "ltr" || deltaX < 0 && direction === "rtl") incrementX(deltaXValue);
694
- else if (deltaX < 0 && direction === "ltr" || deltaX > 0 && direction === "rtl") decrementX(deltaXValue);
695
- else if (deltaY > 0) decrementY(deltaYValue);
696
- else if (deltaY < 0) incrementY(deltaYValue);
697
- setValueChangedViaKeyboard(valueChanged);
698
- // set the focused input based on which axis has the greater delta
699
- focusedInput = valueChanged && Math.abs(deltaY) > Math.abs(deltaX) ? "y" : "x";
700
- setFocusedInput(focusedInput);
701
- } else {
702
- currentPosition.current.x += (direction === "rtl" ? -1 : 1) * deltaX / width;
703
- currentPosition.current.y += deltaY / height;
704
- setColorFromPoint(currentPosition.current.x, currentPosition.current.y);
705
- }
706
- },
707
- onMoveEnd () {
708
- isOnColorArea.current = false;
709
- state.setDragging(false);
710
- let input = focusedInput === "x" ? inputXRef : inputYRef;
711
- focusInput(input);
712
- }
713
- };
714
- let { moveProps: movePropsThumb } = (0, $kZqDi$reactariainteractions.useMove)(moveHandler);
715
- let { focusWithinProps: focusWithinProps } = (0, $kZqDi$reactariainteractions.useFocusWithin)({
716
- onFocusWithinChange: (focusWithin)=>{
717
- if (!focusWithin) setValueChangedViaKeyboard(false);
718
- }
719
- });
720
- let currentPointer = (0, $kZqDi$react.useRef)(undefined);
721
- let isOnColorArea = (0, $kZqDi$react.useRef)(false);
722
- let { moveProps: movePropsContainer } = (0, $kZqDi$reactariainteractions.useMove)({
723
- onMoveStart () {
724
- if (isOnColorArea.current) moveHandler.onMoveStart();
725
- },
726
- onMove (e) {
727
- if (isOnColorArea.current) moveHandler.onMove(e);
728
- },
729
- onMoveEnd () {
730
- if (isOnColorArea.current) moveHandler.onMoveEnd();
731
- }
732
- });
733
- let onThumbDown = (id)=>{
734
- if (!state.isDragging) {
735
- currentPointer.current = id;
736
- setValueChangedViaKeyboard(false);
737
- focusInput();
738
- state.setDragging(true);
739
- if (typeof PointerEvent !== "undefined") addGlobalListener(window, "pointerup", onThumbUp, false);
740
- else {
741
- addGlobalListener(window, "mouseup", onThumbUp, false);
742
- addGlobalListener(window, "touchend", onThumbUp, false);
743
- }
744
- }
745
- };
746
- let onThumbUp = (e)=>{
747
- var _e_changedTouches;
748
- var _e_pointerId;
749
- let id = (_e_pointerId = e.pointerId) !== null && _e_pointerId !== void 0 ? _e_pointerId : (_e_changedTouches = e.changedTouches) === null || _e_changedTouches === void 0 ? void 0 : _e_changedTouches[0].identifier;
750
- if (id === currentPointer.current) {
751
- setValueChangedViaKeyboard(false);
752
- focusInput();
753
- state.setDragging(false);
754
- currentPointer.current = undefined;
755
- isOnColorArea.current = false;
756
- if (typeof PointerEvent !== "undefined") removeGlobalListener(window, "pointerup", onThumbUp, false);
757
- else {
758
- removeGlobalListener(window, "mouseup", onThumbUp, false);
759
- removeGlobalListener(window, "touchend", onThumbUp, false);
760
- }
761
- }
762
- };
763
- let onColorAreaDown = (colorArea, id, clientX, clientY)=>{
764
- let rect = colorArea.getBoundingClientRect();
765
- let { width: width, height: height } = rect;
766
- let x = (clientX - rect.x) / width;
767
- let y = (clientY - rect.y) / height;
768
- if (direction === "rtl") x = 1 - x;
769
- if (x >= 0 && x <= 1 && y >= 0 && y <= 1 && !state.isDragging && currentPointer.current === undefined) {
770
- isOnColorArea.current = true;
771
- setValueChangedViaKeyboard(false);
772
- currentPointer.current = id;
773
- state.setColorFromPoint(x, y);
774
- focusInput();
775
- state.setDragging(true);
776
- if (typeof PointerEvent !== "undefined") addGlobalListener(window, "pointerup", onColorAreaUp, false);
777
- else {
778
- addGlobalListener(window, "mouseup", onColorAreaUp, false);
779
- addGlobalListener(window, "touchend", onColorAreaUp, false);
780
- }
781
- }
782
- };
783
- let onColorAreaUp = (e)=>{
784
- var _e_changedTouches;
785
- var _e_pointerId;
786
- let id = (_e_pointerId = e.pointerId) !== null && _e_pointerId !== void 0 ? _e_pointerId : (_e_changedTouches = e.changedTouches) === null || _e_changedTouches === void 0 ? void 0 : _e_changedTouches[0].identifier;
787
- if (isOnColorArea.current && id === currentPointer.current) {
788
- isOnColorArea.current = false;
789
- setValueChangedViaKeyboard(false);
790
- currentPointer.current = undefined;
791
- state.setDragging(false);
792
- focusInput();
793
- if (typeof PointerEvent !== "undefined") removeGlobalListener(window, "pointerup", onColorAreaUp, false);
794
- else {
795
- removeGlobalListener(window, "mouseup", onColorAreaUp, false);
796
- removeGlobalListener(window, "touchend", onColorAreaUp, false);
797
- }
798
- }
799
- };
800
- let colorAreaInteractions = isDisabled ? {} : (0, $kZqDi$reactariautils.mergeProps)({
801
- ...typeof PointerEvent !== "undefined" ? {
802
- onPointerDown: (e)=>{
803
- if (e.pointerType === "mouse" && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)) return;
804
- onColorAreaDown(e.currentTarget, e.pointerId, e.clientX, e.clientY);
805
- }
806
- } : {
807
- onMouseDown: (e)=>{
808
- if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey) return;
809
- onColorAreaDown(e.currentTarget, undefined, e.clientX, e.clientY);
810
- },
811
- onTouchStart: (e)=>{
812
- onColorAreaDown(e.currentTarget, e.changedTouches[0].identifier, e.changedTouches[0].clientX, e.changedTouches[0].clientY);
813
- }
814
- }
815
- }, movePropsContainer);
816
- let thumbInteractions = isDisabled ? {} : (0, $kZqDi$reactariautils.mergeProps)({
817
- ...typeof PointerEvent !== "undefined" ? {
818
- onPointerDown: (e)=>{
819
- if (e.pointerType === "mouse" && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)) return;
820
- onThumbDown(e.pointerId);
821
- }
822
- } : {
823
- onMouseDown: (e)=>{
824
- if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey) return;
825
- onThumbDown(undefined);
826
- },
827
- onTouchStart: (e)=>{
828
- onThumbDown(e.changedTouches[0].identifier);
829
- }
830
- }
831
- }, focusWithinProps, keyboardProps, movePropsThumb);
832
- let { focusProps: xInputFocusProps } = (0, $kZqDi$reactariainteractions.useFocus)({
833
- onFocus: ()=>{
834
- setFocusedInput("x");
835
- }
836
- });
837
- let { focusProps: yInputFocusProps } = (0, $kZqDi$reactariainteractions.useFocus)({
838
- onFocus: ()=>{
839
- setFocusedInput("y");
840
- }
841
- });
842
- let isMobile = (0, $kZqDi$reactariautils.isIOS)() || (0, $kZqDi$reactariautils.isAndroid)();
843
- function getAriaValueTextForChannel(channel) {
844
- return valueChangedViaKeyboard ? stringFormatter.format("colorNameAndValue", {
845
- name: state.value.getChannelName(channel, locale),
846
- value: state.value.formatChannelValue(channel, locale)
847
- }) : [
848
- stringFormatter.format("colorNameAndValue", {
849
- name: state.value.getChannelName(channel, locale),
850
- value: state.value.formatChannelValue(channel, locale)
851
- }),
852
- stringFormatter.format("colorNameAndValue", {
853
- name: state.value.getChannelName(channel === yChannel ? xChannel : yChannel, locale),
854
- value: state.value.formatChannelValue(channel === yChannel ? xChannel : yChannel, locale)
855
- })
856
- ].join(", ");
857
- }
858
- let colorPickerLabel = stringFormatter.format("colorPicker");
859
- let xInputLabellingProps = (0, $kZqDi$reactariautils.useLabels)({
860
- ...props,
861
- "aria-label": ariaLabel ? stringFormatter.format("colorInputLabel", {
862
- label: ariaLabel,
863
- channelLabel: colorPickerLabel
864
- }) : colorPickerLabel
865
- });
866
- let yInputLabellingProps = (0, $kZqDi$reactariautils.useLabels)({
867
- ...props,
868
- "aria-label": ariaLabel ? stringFormatter.format("colorInputLabel", {
869
- label: ariaLabel,
870
- channelLabel: colorPickerLabel
871
- }) : colorPickerLabel
872
- });
873
- let colorAreaLabellingProps = (0, $kZqDi$reactariautils.useLabels)({
874
- ...props,
875
- "aria-label": ariaLabel ? `${ariaLabel}, ${colorPickerLabel}` : undefined
876
- }, isMobile ? colorPickerLabel : undefined);
877
- let ariaRoleDescription = stringFormatter.format("twoDimensionalSlider");
878
- let { visuallyHiddenProps: visuallyHiddenProps } = (0, $kZqDi$reactariavisuallyhidden.useVisuallyHidden)({
879
- style: {
880
- opacity: "0.0001",
881
- width: "100%",
882
- height: "100%",
883
- pointerEvents: "none"
884
- }
885
- });
886
- let { colorAreaStyleProps: colorAreaStyleProps, gradientStyleProps: gradientStyleProps, thumbStyleProps: thumbStyleProps } = (0, $99936ad0bf67c8c4$export$dd62420467d245ca)({
887
- direction: direction,
888
- state: state,
889
- xChannel: xChannel,
890
- zChannel: zChannel,
891
- isDisabled: props.isDisabled
892
- });
893
- return {
894
- colorAreaProps: {
895
- ...colorAreaLabellingProps,
896
- ...colorAreaInteractions,
897
- ...colorAreaStyleProps,
898
- role: "group"
899
- },
900
- gradientProps: {
901
- ...gradientStyleProps,
902
- role: "presentation"
903
- },
904
- thumbProps: {
905
- ...thumbInteractions,
906
- ...thumbStyleProps,
907
- role: "presentation"
908
- },
909
- xInputProps: {
910
- ...xInputLabellingProps,
911
- ...visuallyHiddenProps,
912
- ...xInputFocusProps,
913
- type: "range",
914
- min: state.value.getChannelRange(xChannel).minValue,
915
- max: state.value.getChannelRange(xChannel).maxValue,
916
- step: xChannelStep,
917
- "aria-roledescription": ariaRoleDescription,
918
- "aria-valuetext": getAriaValueTextForChannel(xChannel),
919
- disabled: isDisabled,
920
- value: state.value.getChannelValue(xChannel),
921
- name: xName,
922
- tabIndex: isMobile || !focusedInput || focusedInput === "x" ? undefined : -1,
923
- /*
924
- So that only a single "2d slider" control shows up when listing form elements for screen readers,
925
- add aria-hidden="true" to the unfocused control when the value has not changed via the keyboard,
926
- but remove aria-hidden to reveal the input for each channel when the value has changed with the keyboard.
927
- */ "aria-hidden": isMobile || !focusedInput || focusedInput === "x" || valueChangedViaKeyboard ? undefined : "true",
928
- onChange: (e)=>{
929
- state.setXValue(parseFloat(e.target.value));
930
- }
931
- },
932
- yInputProps: {
933
- ...yInputLabellingProps,
934
- ...visuallyHiddenProps,
935
- ...yInputFocusProps,
936
- type: "range",
937
- min: state.value.getChannelRange(yChannel).minValue,
938
- max: state.value.getChannelRange(yChannel).maxValue,
939
- step: yChannelStep,
940
- "aria-roledescription": ariaRoleDescription,
941
- "aria-valuetext": getAriaValueTextForChannel(yChannel),
942
- "aria-orientation": "vertical",
943
- disabled: isDisabled,
944
- value: state.value.getChannelValue(yChannel),
945
- name: yName,
946
- tabIndex: isMobile || focusedInput === "y" ? undefined : -1,
947
- /*
948
- So that only a single "2d slider" control shows up when listing form elements for screen readers,
949
- add aria-hidden="true" to the unfocused input when the value has not changed via the keyboard,
950
- but remove aria-hidden to reveal the input for each channel when the value has changed with the keyboard.
951
- */ "aria-hidden": isMobile || focusedInput === "y" || valueChangedViaKeyboard ? undefined : "true",
952
- onChange: (e)=>{
953
- state.setYValue(parseFloat(e.target.value));
954
- }
955
- }
956
- };
957
- }
958
-
959
-
13
+ $parcel$export(module.exports, "useColorArea", () => $47925bd68062ac17$exports.useColorArea);
14
+ $parcel$export(module.exports, "useColorSlider", () => $afbb9647440a7f5b$exports.useColorSlider);
15
+ $parcel$export(module.exports, "useColorWheel", () => $1d29bf243d4a9a53$exports.useColorWheel);
16
+ $parcel$export(module.exports, "useColorField", () => $58c850037bc7a7ce$exports.useColorField);
17
+ $parcel$export(module.exports, "useColorSwatch", () => $7c947b33be1ec2a6$exports.useColorSwatch);
18
+ $parcel$export(module.exports, "useColorChannelField", () => $d84c0c836f6e3601$exports.useColorChannelField);
960
19
  /*
961
20
  * Copyright 2020 Adobe. All rights reserved.
962
21
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -970,415 +29,8 @@ function $47925bd68062ac17$export$2f92a7a615a014f6(props, state) {
970
29
  */
971
30
 
972
31
 
973
- function $afbb9647440a7f5b$export$106b7a4e66508f66(props, state) {
974
- let { trackRef: trackRef, inputRef: inputRef, orientation: orientation, channel: channel, "aria-label": ariaLabel, name: name } = props;
975
- let { locale: locale, direction: direction } = (0, $kZqDi$reactariai18n.useLocale)();
976
- // Provide a default aria-label if there is no other label provided.
977
- if (!props.label && !ariaLabel && !props["aria-labelledby"]) ariaLabel = state.value.getChannelName(channel, locale);
978
- // @ts-ignore - ignore unused incompatible props
979
- let { groupProps: groupProps, trackProps: trackProps, labelProps: labelProps, outputProps: outputProps } = (0, $kZqDi$reactariaslider.useSlider)({
980
- ...props,
981
- "aria-label": ariaLabel
982
- }, state, trackRef);
983
- let { inputProps: inputProps, thumbProps: thumbProps } = (0, $kZqDi$reactariaslider.useSliderThumb)({
984
- index: 0,
985
- orientation: orientation,
986
- isDisabled: props.isDisabled,
987
- name: name,
988
- trackRef: trackRef,
989
- inputRef: inputRef
990
- }, state);
991
- let generateBackground = ()=>{
992
- let value = state.getDisplayColor();
993
- let to;
994
- if (orientation === "vertical") to = "top";
995
- else if (direction === "ltr") to = "right";
996
- else to = "left";
997
- switch(channel){
998
- case "hue":
999
- return `linear-gradient(to ${to}, rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)`;
1000
- case "lightness":
1001
- {
1002
- // We have to add an extra color stop in the middle so that the hue shows up at all.
1003
- // Otherwise it will always just be black to white.
1004
- let min = state.getThumbMinValue(0);
1005
- let max = state.getThumbMaxValue(0);
1006
- let start = value.withChannelValue(channel, min).toString("css");
1007
- let middle = value.withChannelValue(channel, (max - min) / 2).toString("css");
1008
- let end = value.withChannelValue(channel, max).toString("css");
1009
- return `linear-gradient(to ${to}, ${start}, ${middle}, ${end})`;
1010
- }
1011
- case "saturation":
1012
- case "brightness":
1013
- case "red":
1014
- case "green":
1015
- case "blue":
1016
- case "alpha":
1017
- {
1018
- let start = value.withChannelValue(channel, state.getThumbMinValue(0)).toString("css");
1019
- let end = value.withChannelValue(channel, state.getThumbMaxValue(0)).toString("css");
1020
- return `linear-gradient(to ${to}, ${start}, ${end})`;
1021
- }
1022
- default:
1023
- throw new Error("Unknown color channel: " + channel);
1024
- }
1025
- };
1026
- let forcedColorAdjustNoneStyle = {
1027
- forcedColorAdjust: "none"
1028
- };
1029
- return {
1030
- trackProps: {
1031
- ...(0, $kZqDi$reactariautils.mergeProps)(groupProps, trackProps),
1032
- style: {
1033
- ...trackProps.style,
1034
- ...forcedColorAdjustNoneStyle,
1035
- background: generateBackground()
1036
- }
1037
- },
1038
- inputProps: inputProps,
1039
- thumbProps: {
1040
- ...thumbProps,
1041
- style: {
1042
- ...thumbProps.style,
1043
- ...forcedColorAdjustNoneStyle
1044
- }
1045
- },
1046
- labelProps: labelProps,
1047
- outputProps: outputProps
1048
- };
1049
- }
1050
-
1051
-
1052
- /*
1053
- * Copyright 2020 Adobe. All rights reserved.
1054
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1055
- * you may not use this file except in compliance with the License. You may obtain a copy
1056
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1057
- *
1058
- * Unless required by applicable law or agreed to in writing, software distributed under
1059
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1060
- * OF ANY KIND, either express or implied. See the License for the specific language
1061
- * governing permissions and limitations under the License.
1062
- */
1063
-
1064
-
1065
-
1066
- function $1d29bf243d4a9a53$export$9064ff4e44b3729a(props, state, inputRef) {
1067
- let { isDisabled: isDisabled, innerRadius: innerRadius, outerRadius: outerRadius, "aria-label": ariaLabel, name: name } = props;
1068
- let { addGlobalListener: addGlobalListener, removeGlobalListener: removeGlobalListener } = (0, $kZqDi$reactariautils.useGlobalListeners)();
1069
- let thumbRadius = (innerRadius + outerRadius) / 2;
1070
- let focusInput = (0, $kZqDi$react.useCallback)(()=>{
1071
- if (inputRef.current) (0, $kZqDi$reactariautils.focusWithoutScrolling)(inputRef.current);
1072
- }, [
1073
- inputRef
1074
- ]);
1075
- (0, $kZqDi$reactariautils.useFormReset)(inputRef, state.hue, state.setHue);
1076
- let currentPosition = (0, $kZqDi$react.useRef)(null);
1077
- let { keyboardProps: keyboardProps } = (0, $kZqDi$reactariainteractions.useKeyboard)({
1078
- onKeyDown (e) {
1079
- // these are the cases that useMove doesn't handle
1080
- if (!/^(PageUp|PageDown)$/.test(e.key)) {
1081
- e.continuePropagation();
1082
- return;
1083
- }
1084
- // same handling as useMove, don't need to stop propagation, useKeyboard will do that for us
1085
- e.preventDefault();
1086
- // remember to set this and unset it so that onChangeEnd is fired
1087
- state.setDragging(true);
1088
- switch(e.key){
1089
- case "PageUp":
1090
- e.preventDefault();
1091
- state.increment(state.pageStep);
1092
- break;
1093
- case "PageDown":
1094
- e.preventDefault();
1095
- state.decrement(state.pageStep);
1096
- break;
1097
- }
1098
- state.setDragging(false);
1099
- }
1100
- });
1101
- let moveHandler = {
1102
- onMoveStart () {
1103
- currentPosition.current = null;
1104
- state.setDragging(true);
1105
- },
1106
- onMove ({ deltaX: deltaX, deltaY: deltaY, pointerType: pointerType, shiftKey: shiftKey }) {
1107
- if (currentPosition.current == null) currentPosition.current = state.getThumbPosition(thumbRadius);
1108
- currentPosition.current.x += deltaX;
1109
- currentPosition.current.y += deltaY;
1110
- if (pointerType === "keyboard") {
1111
- if (deltaX > 0 || deltaY < 0) state.increment(shiftKey ? state.pageStep : state.step);
1112
- else if (deltaX < 0 || deltaY > 0) state.decrement(shiftKey ? state.pageStep : state.step);
1113
- } else state.setHueFromPoint(currentPosition.current.x, currentPosition.current.y, thumbRadius);
1114
- },
1115
- onMoveEnd () {
1116
- isOnTrack.current = false;
1117
- state.setDragging(false);
1118
- focusInput();
1119
- }
1120
- };
1121
- let { moveProps: movePropsThumb } = (0, $kZqDi$reactariainteractions.useMove)(moveHandler);
1122
- let currentPointer = (0, $kZqDi$react.useRef)(undefined);
1123
- let isOnTrack = (0, $kZqDi$react.useRef)(false);
1124
- let { moveProps: movePropsContainer } = (0, $kZqDi$reactariainteractions.useMove)({
1125
- onMoveStart () {
1126
- if (isOnTrack.current) moveHandler.onMoveStart();
1127
- },
1128
- onMove (e) {
1129
- if (isOnTrack.current) moveHandler.onMove(e);
1130
- },
1131
- onMoveEnd () {
1132
- if (isOnTrack.current) moveHandler.onMoveEnd();
1133
- }
1134
- });
1135
- let onThumbDown = (id)=>{
1136
- if (!state.isDragging) {
1137
- currentPointer.current = id;
1138
- focusInput();
1139
- state.setDragging(true);
1140
- if (typeof PointerEvent !== "undefined") addGlobalListener(window, "pointerup", onThumbUp, false);
1141
- else {
1142
- addGlobalListener(window, "mouseup", onThumbUp, false);
1143
- addGlobalListener(window, "touchend", onThumbUp, false);
1144
- }
1145
- }
1146
- };
1147
- let onThumbUp = (e)=>{
1148
- var _e_changedTouches;
1149
- var _e_pointerId;
1150
- let id = (_e_pointerId = e.pointerId) !== null && _e_pointerId !== void 0 ? _e_pointerId : (_e_changedTouches = e.changedTouches) === null || _e_changedTouches === void 0 ? void 0 : _e_changedTouches[0].identifier;
1151
- if (id === currentPointer.current) {
1152
- focusInput();
1153
- state.setDragging(false);
1154
- currentPointer.current = undefined;
1155
- isOnTrack.current = false;
1156
- if (typeof PointerEvent !== "undefined") removeGlobalListener(window, "pointerup", onThumbUp, false);
1157
- else {
1158
- removeGlobalListener(window, "mouseup", onThumbUp, false);
1159
- removeGlobalListener(window, "touchend", onThumbUp, false);
1160
- }
1161
- }
1162
- };
1163
- let onTrackDown = (track, id, pageX, pageY)=>{
1164
- let rect = track.getBoundingClientRect();
1165
- let x = pageX - rect.x - rect.width / 2;
1166
- let y = pageY - rect.y - rect.height / 2;
1167
- let radius = Math.sqrt(x * x + y * y);
1168
- if (innerRadius < radius && radius < outerRadius && !state.isDragging && currentPointer.current === undefined) {
1169
- isOnTrack.current = true;
1170
- currentPointer.current = id;
1171
- state.setHueFromPoint(x, y, radius);
1172
- focusInput();
1173
- state.setDragging(true);
1174
- if (typeof PointerEvent !== "undefined") addGlobalListener(window, "pointerup", onTrackUp, false);
1175
- else {
1176
- addGlobalListener(window, "mouseup", onTrackUp, false);
1177
- addGlobalListener(window, "touchend", onTrackUp, false);
1178
- }
1179
- }
1180
- };
1181
- let onTrackUp = (e)=>{
1182
- var _e_changedTouches;
1183
- var _e_pointerId;
1184
- let id = (_e_pointerId = e.pointerId) !== null && _e_pointerId !== void 0 ? _e_pointerId : (_e_changedTouches = e.changedTouches) === null || _e_changedTouches === void 0 ? void 0 : _e_changedTouches[0].identifier;
1185
- if (isOnTrack.current && id === currentPointer.current) {
1186
- isOnTrack.current = false;
1187
- currentPointer.current = undefined;
1188
- state.setDragging(false);
1189
- focusInput();
1190
- if (typeof PointerEvent !== "undefined") removeGlobalListener(window, "pointerup", onTrackUp, false);
1191
- else {
1192
- removeGlobalListener(window, "mouseup", onTrackUp, false);
1193
- removeGlobalListener(window, "touchend", onTrackUp, false);
1194
- }
1195
- }
1196
- };
1197
- let trackInteractions = isDisabled ? {} : (0, $kZqDi$reactariautils.mergeProps)({
1198
- ...typeof PointerEvent !== "undefined" ? {
1199
- onPointerDown: (e)=>{
1200
- if (e.pointerType === "mouse" && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)) return;
1201
- onTrackDown(e.currentTarget, e.pointerId, e.clientX, e.clientY);
1202
- }
1203
- } : {
1204
- onMouseDown: (e)=>{
1205
- if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey) return;
1206
- onTrackDown(e.currentTarget, undefined, e.clientX, e.clientY);
1207
- },
1208
- onTouchStart: (e)=>{
1209
- onTrackDown(e.currentTarget, e.changedTouches[0].identifier, e.changedTouches[0].clientX, e.changedTouches[0].clientY);
1210
- }
1211
- }
1212
- }, movePropsContainer);
1213
- let thumbInteractions = isDisabled ? {} : (0, $kZqDi$reactariautils.mergeProps)({
1214
- onMouseDown: (e)=>{
1215
- if (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey) return;
1216
- onThumbDown(undefined);
1217
- },
1218
- onPointerDown: (e)=>{
1219
- if (e.pointerType === "mouse" && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)) return;
1220
- onThumbDown(e.pointerId);
1221
- },
1222
- onTouchStart: (e)=>{
1223
- onThumbDown(e.changedTouches[0].identifier);
1224
- }
1225
- }, keyboardProps, movePropsThumb);
1226
- let { x: x, y: y } = state.getThumbPosition(thumbRadius);
1227
- // Provide a default aria-label if none is given
1228
- let { locale: locale } = (0, $kZqDi$reactariai18n.useLocale)();
1229
- if (ariaLabel == null && props["aria-labelledby"] == null) ariaLabel = state.value.getChannelName("hue", locale);
1230
- let inputLabellingProps = (0, $kZqDi$reactariautils.useLabels)({
1231
- ...props,
1232
- "aria-label": ariaLabel
1233
- });
1234
- let { minValue: minValue, maxValue: maxValue, step: step } = state.value.getChannelRange("hue");
1235
- let forcedColorAdjustNoneStyle = {
1236
- forcedColorAdjust: "none"
1237
- };
1238
- return {
1239
- trackProps: {
1240
- ...trackInteractions,
1241
- style: {
1242
- position: "relative",
1243
- touchAction: "none",
1244
- width: outerRadius * 2,
1245
- height: outerRadius * 2,
1246
- background: `
1247
- conic-gradient(
1248
- from 90deg,
1249
- hsl(0, 100%, 50%),
1250
- hsl(30, 100%, 50%),
1251
- hsl(60, 100%, 50%),
1252
- hsl(90, 100%, 50%),
1253
- hsl(120, 100%, 50%),
1254
- hsl(150, 100%, 50%),
1255
- hsl(180, 100%, 50%),
1256
- hsl(210, 100%, 50%),
1257
- hsl(240, 100%, 50%),
1258
- hsl(270, 100%, 50%),
1259
- hsl(300, 100%, 50%),
1260
- hsl(330, 100%, 50%),
1261
- hsl(360, 100%, 50%)
1262
- )
1263
- `,
1264
- clipPath: `path(evenodd, "${$1d29bf243d4a9a53$var$circlePath(outerRadius, outerRadius, outerRadius)} ${$1d29bf243d4a9a53$var$circlePath(outerRadius, outerRadius, innerRadius)}")`,
1265
- ...forcedColorAdjustNoneStyle
1266
- }
1267
- },
1268
- thumbProps: {
1269
- ...thumbInteractions,
1270
- style: {
1271
- position: "absolute",
1272
- left: "50%",
1273
- top: "50%",
1274
- transform: `translate(calc(${x}px - 50%), calc(${y}px - 50%))`,
1275
- touchAction: "none",
1276
- ...forcedColorAdjustNoneStyle
1277
- }
1278
- },
1279
- inputProps: (0, $kZqDi$reactariautils.mergeProps)(inputLabellingProps, {
1280
- type: "range",
1281
- min: String(minValue),
1282
- max: String(maxValue),
1283
- step: String(step),
1284
- "aria-valuetext": state.value.formatChannelValue("hue", locale),
1285
- disabled: isDisabled,
1286
- value: `${state.value.getChannelValue("hue")}`,
1287
- name: name,
1288
- onChange: (e)=>{
1289
- state.setHue(parseFloat(e.target.value));
1290
- }
1291
- })
1292
- };
1293
- }
1294
- // Creates an SVG path string for a circle.
1295
- function $1d29bf243d4a9a53$var$circlePath(cx, cy, r) {
1296
- return `M ${cx}, ${cy} m ${-r}, 0 a ${r}, ${r}, 0, 1, 0, ${r * 2}, 0 a ${r}, ${r}, 0, 1, 0 ${-r * 2}, 0`;
1297
- }
1298
32
 
1299
33
 
1300
- /*
1301
- * Copyright 2020 Adobe. All rights reserved.
1302
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1303
- * you may not use this file except in compliance with the License. You may obtain a copy
1304
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
1305
- *
1306
- * Unless required by applicable law or agreed to in writing, software distributed under
1307
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1308
- * OF ANY KIND, either express or implied. See the License for the specific language
1309
- * governing permissions and limitations under the License.
1310
- */
1311
-
1312
-
1313
-
1314
-
1315
-
1316
- function $58c850037bc7a7ce$export$77e32ca575a28fdf(props, state, ref) {
1317
- let { isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, isWheelDisabled: isWheelDisabled, validationBehavior: validationBehavior = "aria" } = props;
1318
- let { colorValue: colorValue, inputValue: inputValue, increment: increment, decrement: decrement, incrementToMax: incrementToMax, decrementToMin: decrementToMin, commit: commit } = state;
1319
- let inputId = (0, $kZqDi$reactariautils.useId)();
1320
- let { spinButtonProps: spinButtonProps } = (0, $kZqDi$reactariaspinbutton.useSpinButton)({
1321
- isDisabled: isDisabled,
1322
- isReadOnly: isReadOnly,
1323
- isRequired: isRequired,
1324
- maxValue: 0xFFFFFF,
1325
- minValue: 0,
1326
- onIncrement: increment,
1327
- onIncrementToMax: incrementToMax,
1328
- onDecrement: decrement,
1329
- onDecrementToMin: decrementToMin,
1330
- value: colorValue ? colorValue.toHexInt() : undefined,
1331
- textValue: colorValue ? colorValue.toString("hex") : undefined
1332
- });
1333
- let [focusWithin, setFocusWithin] = (0, $kZqDi$react.useState)(false);
1334
- let { focusWithinProps: focusWithinProps } = (0, $kZqDi$reactariainteractions.useFocusWithin)({
1335
- isDisabled: isDisabled,
1336
- onFocusWithinChange: setFocusWithin
1337
- });
1338
- let onWheel = (0, $kZqDi$react.useCallback)((e)=>{
1339
- if (Math.abs(e.deltaY) <= Math.abs(e.deltaX)) return;
1340
- if (e.deltaY > 0) increment();
1341
- else if (e.deltaY < 0) decrement();
1342
- }, [
1343
- decrement,
1344
- increment
1345
- ]);
1346
- // If the input isn't supposed to receive input, disable scrolling.
1347
- let scrollingDisabled = isWheelDisabled || isDisabled || isReadOnly || !focusWithin;
1348
- (0, $kZqDi$reactariainteractions.useScrollWheel)({
1349
- onScroll: onWheel,
1350
- isDisabled: scrollingDisabled
1351
- }, ref);
1352
- let onChange = (value)=>{
1353
- if (state.validate(value)) state.setInputValue(value);
1354
- };
1355
- let { inputProps: inputProps, ...otherProps } = (0, $kZqDi$reactariatextfield.useFormattedTextField)((0, $kZqDi$reactariautils.mergeProps)(props, {
1356
- id: inputId,
1357
- value: inputValue,
1358
- defaultValue: undefined,
1359
- validate: undefined,
1360
- [(0, $kZqDi$reactstatelyform.privateValidationStateProp)]: state,
1361
- type: "text",
1362
- autoComplete: "off",
1363
- onChange: onChange
1364
- }), state, ref);
1365
- inputProps = (0, $kZqDi$reactariautils.mergeProps)(inputProps, spinButtonProps, focusWithinProps, {
1366
- role: "textbox",
1367
- "aria-valuemax": null,
1368
- "aria-valuemin": null,
1369
- "aria-valuenow": null,
1370
- "aria-valuetext": null,
1371
- autoCorrect: "off",
1372
- spellCheck: "false",
1373
- onBlur: commit
1374
- });
1375
- if (validationBehavior === "native") inputProps["aria-required"] = undefined;
1376
- return {
1377
- inputProps: inputProps,
1378
- ...otherProps
1379
- };
1380
- }
1381
-
1382
34
 
1383
35
 
1384
36