@react-aria/color 3.0.0-nightly.4624 → 3.0.0-nightly.4629

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.
@@ -28,8 +28,8 @@ function $parcel$interopDefault(a) {
28
28
 
29
29
 
30
30
  function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
31
- let { isDisabled: isDisabled, inputXRef: inputXRef, inputYRef: inputYRef, containerRef: containerRef, "aria-label": ariaLabel, xName: xName, yName: yName } = props;
32
- let stringFormatter = (0, $8t1z9$useLocalizedStringFormatter)((0, ($parcel$interopDefault($8t1z9$intlStringsmodulejs))), "@react-aria/color");
31
+ let { isDisabled: isDisabled, inputXRef: inputXRef, inputYRef: inputYRef, containerRef: containerRef, 'aria-label': ariaLabel, xName: xName, yName: yName } = props;
32
+ let stringFormatter = (0, $8t1z9$useLocalizedStringFormatter)((0, ($parcel$interopDefault($8t1z9$intlStringsmodulejs))), '@react-aria/color');
33
33
  let { addGlobalListener: addGlobalListener, removeGlobalListener: removeGlobalListener } = (0, $8t1z9$useGlobalListeners)();
34
34
  let { direction: direction, locale: locale } = (0, $8t1z9$useLocale)();
35
35
  let [focusedInput, setFocusedInput] = (0, $8t1z9$useState)(null);
@@ -65,26 +65,26 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
65
65
  setValueChangedViaKeyboard(true);
66
66
  let dir;
67
67
  switch(e.key){
68
- case "PageUp":
68
+ case 'PageUp':
69
69
  state.incrementY(state.yChannelPageStep);
70
- dir = "y";
70
+ dir = 'y';
71
71
  break;
72
- case "PageDown":
72
+ case 'PageDown':
73
73
  state.decrementY(state.yChannelPageStep);
74
- dir = "y";
74
+ dir = 'y';
75
75
  break;
76
- case "Home":
77
- direction === "rtl" ? state.incrementX(state.xChannelPageStep) : state.decrementX(state.xChannelPageStep);
78
- dir = "x";
76
+ case 'Home':
77
+ direction === 'rtl' ? state.incrementX(state.xChannelPageStep) : state.decrementX(state.xChannelPageStep);
78
+ dir = 'x';
79
79
  break;
80
- case "End":
81
- direction === "rtl" ? state.decrementX(state.xChannelPageStep) : state.incrementX(state.xChannelPageStep);
82
- dir = "x";
80
+ case 'End':
81
+ direction === 'rtl' ? state.decrementX(state.xChannelPageStep) : state.incrementX(state.xChannelPageStep);
82
+ dir = 'x';
83
83
  break;
84
84
  }
85
85
  state.setDragging(false);
86
86
  if (dir) {
87
- let input = dir === "x" ? inputXRef : inputYRef;
87
+ let input = dir === 'x' ? inputXRef : inputYRef;
88
88
  focusInput(input);
89
89
  setFocusedInput(dir);
90
90
  }
@@ -104,19 +104,19 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
104
104
  height: 0
105
105
  };
106
106
  let valueChanged = deltaX !== 0 || deltaY !== 0;
107
- if (pointerType === "keyboard") {
107
+ if (pointerType === 'keyboard') {
108
108
  let deltaXValue = shiftKey && xChannelPageStep > xChannelStep ? xChannelPageStep : xChannelStep;
109
109
  let deltaYValue = shiftKey && yChannelPageStep > yChannelStep ? yChannelPageStep : yChannelStep;
110
- if (deltaX > 0 && direction === "ltr" || deltaX < 0 && direction === "rtl") incrementX(deltaXValue);
111
- else if (deltaX < 0 && direction === "ltr" || deltaX > 0 && direction === "rtl") decrementX(deltaXValue);
110
+ if (deltaX > 0 && direction === 'ltr' || deltaX < 0 && direction === 'rtl') incrementX(deltaXValue);
111
+ else if (deltaX < 0 && direction === 'ltr' || deltaX > 0 && direction === 'rtl') decrementX(deltaXValue);
112
112
  else if (deltaY > 0) decrementY(deltaYValue);
113
113
  else if (deltaY < 0) incrementY(deltaYValue);
114
114
  setValueChangedViaKeyboard(valueChanged);
115
115
  // set the focused input based on which axis has the greater delta
116
- focusedInput = valueChanged && Math.abs(deltaY) > Math.abs(deltaX) ? "y" : "x";
116
+ focusedInput = valueChanged && Math.abs(deltaY) > Math.abs(deltaX) ? 'y' : 'x';
117
117
  setFocusedInput(focusedInput);
118
118
  } else {
119
- currentPosition.current.x += (direction === "rtl" ? -1 : 1) * deltaX / width;
119
+ currentPosition.current.x += (direction === 'rtl' ? -1 : 1) * deltaX / width;
120
120
  currentPosition.current.y += deltaY / height;
121
121
  setColorFromPoint(currentPosition.current.x, currentPosition.current.y);
122
122
  }
@@ -124,7 +124,7 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
124
124
  onMoveEnd () {
125
125
  isOnColorArea.current = false;
126
126
  state.setDragging(false);
127
- let input = focusedInput === "x" ? inputXRef : inputYRef;
127
+ let input = focusedInput === 'x' ? inputXRef : inputYRef;
128
128
  focusInput(input);
129
129
  }
130
130
  };
@@ -156,10 +156,10 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
156
156
  setValueChangedViaKeyboard(false);
157
157
  focusInput();
158
158
  state.setDragging(true);
159
- if (typeof PointerEvent !== "undefined") addGlobalListener(window, "pointerup", onThumbUp, false);
159
+ if (typeof PointerEvent !== 'undefined') addGlobalListener(window, 'pointerup', onThumbUp, false);
160
160
  else {
161
- addGlobalListener(window, "mouseup", onThumbUp, false);
162
- addGlobalListener(window, "touchend", onThumbUp, false);
161
+ addGlobalListener(window, 'mouseup', onThumbUp, false);
162
+ addGlobalListener(window, 'touchend', onThumbUp, false);
163
163
  }
164
164
  }
165
165
  };
@@ -173,10 +173,10 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
173
173
  state.setDragging(false);
174
174
  currentPointer.current = undefined;
175
175
  isOnColorArea.current = false;
176
- if (typeof PointerEvent !== "undefined") removeGlobalListener(window, "pointerup", onThumbUp, false);
176
+ if (typeof PointerEvent !== 'undefined') removeGlobalListener(window, 'pointerup', onThumbUp, false);
177
177
  else {
178
- removeGlobalListener(window, "mouseup", onThumbUp, false);
179
- removeGlobalListener(window, "touchend", onThumbUp, false);
178
+ removeGlobalListener(window, 'mouseup', onThumbUp, false);
179
+ removeGlobalListener(window, 'touchend', onThumbUp, false);
180
180
  }
181
181
  }
182
182
  };
@@ -185,7 +185,7 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
185
185
  let { width: width, height: height } = rect;
186
186
  let x = (clientX - rect.x) / width;
187
187
  let y = (clientY - rect.y) / height;
188
- if (direction === "rtl") x = 1 - x;
188
+ if (direction === 'rtl') x = 1 - x;
189
189
  if (x >= 0 && x <= 1 && y >= 0 && y <= 1 && !state.isDragging && currentPointer.current === undefined) {
190
190
  isOnColorArea.current = true;
191
191
  setValueChangedViaKeyboard(false);
@@ -193,10 +193,10 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
193
193
  state.setColorFromPoint(x, y);
194
194
  focusInput();
195
195
  state.setDragging(true);
196
- if (typeof PointerEvent !== "undefined") addGlobalListener(window, "pointerup", onColorAreaUp, false);
196
+ if (typeof PointerEvent !== 'undefined') addGlobalListener(window, 'pointerup', onColorAreaUp, false);
197
197
  else {
198
- addGlobalListener(window, "mouseup", onColorAreaUp, false);
199
- addGlobalListener(window, "touchend", onColorAreaUp, false);
198
+ addGlobalListener(window, 'mouseup', onColorAreaUp, false);
199
+ addGlobalListener(window, 'touchend', onColorAreaUp, false);
200
200
  }
201
201
  }
202
202
  };
@@ -210,17 +210,17 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
210
210
  currentPointer.current = undefined;
211
211
  state.setDragging(false);
212
212
  focusInput();
213
- if (typeof PointerEvent !== "undefined") removeGlobalListener(window, "pointerup", onColorAreaUp, false);
213
+ if (typeof PointerEvent !== 'undefined') removeGlobalListener(window, 'pointerup', onColorAreaUp, false);
214
214
  else {
215
- removeGlobalListener(window, "mouseup", onColorAreaUp, false);
216
- removeGlobalListener(window, "touchend", onColorAreaUp, false);
215
+ removeGlobalListener(window, 'mouseup', onColorAreaUp, false);
216
+ removeGlobalListener(window, 'touchend', onColorAreaUp, false);
217
217
  }
218
218
  }
219
219
  };
220
220
  let colorAreaInteractions = isDisabled ? {} : (0, $8t1z9$mergeProps)({
221
- ...typeof PointerEvent !== "undefined" ? {
221
+ ...typeof PointerEvent !== 'undefined' ? {
222
222
  onPointerDown: (e)=>{
223
- if (e.pointerType === "mouse" && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)) return;
223
+ if (e.pointerType === 'mouse' && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)) return;
224
224
  onColorAreaDown(e.currentTarget, e.pointerId, e.clientX, e.clientY);
225
225
  }
226
226
  } : {
@@ -234,9 +234,9 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
234
234
  }
235
235
  }, movePropsContainer);
236
236
  let thumbInteractions = isDisabled ? {} : (0, $8t1z9$mergeProps)({
237
- ...typeof PointerEvent !== "undefined" ? {
237
+ ...typeof PointerEvent !== 'undefined' ? {
238
238
  onPointerDown: (e)=>{
239
- if (e.pointerType === "mouse" && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)) return;
239
+ if (e.pointerType === 'mouse' && (e.button !== 0 || e.altKey || e.ctrlKey || e.metaKey)) return;
240
240
  onThumbDown(e.pointerId);
241
241
  }
242
242
  } : {
@@ -251,12 +251,12 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
251
251
  }, focusWithinProps, keyboardProps, movePropsThumb);
252
252
  let { focusProps: xInputFocusProps } = (0, $8t1z9$useFocus)({
253
253
  onFocus: ()=>{
254
- setFocusedInput("x");
254
+ setFocusedInput('x');
255
255
  }
256
256
  });
257
257
  let { focusProps: yInputFocusProps } = (0, $8t1z9$useFocus)({
258
258
  onFocus: ()=>{
259
- setFocusedInput("y");
259
+ setFocusedInput('y');
260
260
  }
261
261
  });
262
262
  const onChange = (e)=>{
@@ -269,23 +269,23 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
269
269
  let value = state.getDisplayColor();
270
270
  const getAriaValueTextForChannel = (0, $8t1z9$useCallback)((channel)=>{
271
271
  const isAfterInput = valueChangedViaInputChangeEvent || valueChangedViaKeyboard;
272
- return `${isAfterInput ? stringFormatter.format("colorNameAndValue", {
272
+ return `${isAfterInput ? stringFormatter.format('colorNameAndValue', {
273
273
  name: value.getChannelName(channel, locale),
274
274
  value: value.formatChannelValue(channel, locale)
275
275
  }) : [
276
- stringFormatter.format("colorNameAndValue", {
276
+ stringFormatter.format('colorNameAndValue', {
277
277
  name: value.getChannelName(channel, locale),
278
278
  value: value.formatChannelValue(channel, locale)
279
279
  }),
280
- stringFormatter.format("colorNameAndValue", {
280
+ stringFormatter.format('colorNameAndValue', {
281
281
  name: value.getChannelName(channel === yChannel ? xChannel : yChannel, locale),
282
282
  value: value.formatChannelValue(channel === yChannel ? xChannel : yChannel, locale)
283
283
  }),
284
- stringFormatter.format("colorNameAndValue", {
284
+ stringFormatter.format('colorNameAndValue', {
285
285
  name: value.getChannelName(zChannel, locale),
286
286
  value: value.formatChannelValue(zChannel, locale)
287
287
  })
288
- ].join(", ")}, ${value.getColorName(locale)}`;
288
+ ].join(', ')}, ${value.getColorName(locale)}`;
289
289
  }, [
290
290
  locale,
291
291
  value,
@@ -296,32 +296,32 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
296
296
  yChannel,
297
297
  zChannel
298
298
  ]);
299
- let colorPickerLabel = stringFormatter.format("colorPicker");
299
+ let colorPickerLabel = stringFormatter.format('colorPicker');
300
300
  let xInputLabellingProps = (0, $8t1z9$useLabels)({
301
301
  ...props,
302
- "aria-label": ariaLabel ? stringFormatter.format("colorInputLabel", {
302
+ 'aria-label': ariaLabel ? stringFormatter.format('colorInputLabel', {
303
303
  label: ariaLabel,
304
304
  channelLabel: colorPickerLabel
305
305
  }) : colorPickerLabel
306
306
  });
307
307
  let yInputLabellingProps = (0, $8t1z9$useLabels)({
308
308
  ...props,
309
- "aria-label": ariaLabel ? stringFormatter.format("colorInputLabel", {
309
+ 'aria-label': ariaLabel ? stringFormatter.format('colorInputLabel', {
310
310
  label: ariaLabel,
311
311
  channelLabel: colorPickerLabel
312
312
  }) : colorPickerLabel
313
313
  });
314
314
  let colorAreaLabellingProps = (0, $8t1z9$useLabels)({
315
315
  ...props,
316
- "aria-label": ariaLabel ? `${ariaLabel}, ${colorPickerLabel}` : undefined
316
+ 'aria-label': ariaLabel ? `${ariaLabel}, ${colorPickerLabel}` : undefined
317
317
  }, isMobile ? colorPickerLabel : undefined);
318
- let ariaRoleDescription = stringFormatter.format("twoDimensionalSlider");
318
+ let ariaRoleDescription = stringFormatter.format('twoDimensionalSlider');
319
319
  let { visuallyHiddenProps: visuallyHiddenProps } = (0, $8t1z9$useVisuallyHidden)({
320
320
  style: {
321
- opacity: "0.0001",
322
- width: "100%",
323
- height: "100%",
324
- pointerEvents: "none"
321
+ opacity: '0.0001',
322
+ width: '100%',
323
+ height: '100%',
324
+ pointerEvents: 'none'
325
325
  }
326
326
  });
327
327
  let { colorAreaStyleProps: colorAreaStyleProps, thumbStyleProps: thumbStyleProps } = (0, $40297c24c53588e6$export$dd62420467d245ca)({
@@ -336,59 +336,59 @@ function $60bd7d6e45dcddfa$export$2f92a7a615a014f6(props, state) {
336
336
  ...colorAreaLabellingProps,
337
337
  ...colorAreaInteractions,
338
338
  ...colorAreaStyleProps,
339
- role: "group"
339
+ role: 'group'
340
340
  },
341
341
  thumbProps: {
342
342
  ...thumbInteractions,
343
343
  ...thumbStyleProps,
344
- role: "presentation"
344
+ role: 'presentation'
345
345
  },
346
346
  xInputProps: {
347
347
  ...xInputLabellingProps,
348
348
  ...visuallyHiddenProps,
349
349
  ...xInputFocusProps,
350
- type: "range",
350
+ type: 'range',
351
351
  min: state.value.getChannelRange(xChannel).minValue,
352
352
  max: state.value.getChannelRange(xChannel).maxValue,
353
353
  step: xChannelStep,
354
- "aria-roledescription": ariaRoleDescription,
355
- "aria-valuetext": getAriaValueTextForChannel(xChannel),
356
- "aria-orientation": "horizontal",
357
- "aria-describedby": props["aria-describedby"],
358
- "aria-details": props["aria-details"],
354
+ 'aria-roledescription': ariaRoleDescription,
355
+ 'aria-valuetext': getAriaValueTextForChannel(xChannel),
356
+ 'aria-orientation': 'horizontal',
357
+ 'aria-describedby': props['aria-describedby'],
358
+ 'aria-details': props['aria-details'],
359
359
  disabled: isDisabled,
360
360
  value: state.value.getChannelValue(xChannel),
361
361
  name: xName,
362
- tabIndex: isMobile || !focusedInput || focusedInput === "x" ? undefined : -1,
362
+ tabIndex: isMobile || !focusedInput || focusedInput === 'x' ? undefined : -1,
363
363
  /*
364
364
  So that only a single "2d slider" control shows up when listing form elements for screen readers,
365
365
  add aria-hidden="true" to the unfocused control when the value has not changed via the keyboard,
366
366
  but remove aria-hidden to reveal the input for each channel when the value has changed with the keyboard.
367
- */ "aria-hidden": isMobile || !focusedInput || focusedInput === "x" || valueChangedViaKeyboard ? undefined : "true",
367
+ */ 'aria-hidden': isMobile || !focusedInput || focusedInput === 'x' || valueChangedViaKeyboard ? undefined : 'true',
368
368
  onChange: onChange
369
369
  },
370
370
  yInputProps: {
371
371
  ...yInputLabellingProps,
372
372
  ...visuallyHiddenProps,
373
373
  ...yInputFocusProps,
374
- type: "range",
374
+ type: 'range',
375
375
  min: state.value.getChannelRange(yChannel).minValue,
376
376
  max: state.value.getChannelRange(yChannel).maxValue,
377
377
  step: yChannelStep,
378
- "aria-roledescription": ariaRoleDescription,
379
- "aria-valuetext": getAriaValueTextForChannel(yChannel),
380
- "aria-orientation": "vertical",
381
- "aria-describedby": props["aria-describedby"],
382
- "aria-details": props["aria-details"],
378
+ 'aria-roledescription': ariaRoleDescription,
379
+ 'aria-valuetext': getAriaValueTextForChannel(yChannel),
380
+ 'aria-orientation': 'vertical',
381
+ 'aria-describedby': props['aria-describedby'],
382
+ 'aria-details': props['aria-details'],
383
383
  disabled: isDisabled,
384
384
  value: state.value.getChannelValue(yChannel),
385
385
  name: yName,
386
- tabIndex: isMobile || focusedInput === "y" ? undefined : -1,
386
+ tabIndex: isMobile || focusedInput === 'y' ? undefined : -1,
387
387
  /*
388
388
  So that only a single "2d slider" control shows up when listing form elements for screen readers,
389
389
  add aria-hidden="true" to the unfocused input when the value has not changed via the keyboard,
390
390
  but remove aria-hidden to reveal the input for each channel when the value has changed with the keyboard.
391
- */ "aria-hidden": isMobile || focusedInput === "y" || valueChangedViaKeyboard ? undefined : "true",
391
+ */ 'aria-hidden': isMobile || focusedInput === 'y' || valueChangedViaKeyboard ? undefined : 'true',
392
392
  onChange: onChange
393
393
  }
394
394
  };
@@ -27,27 +27,27 @@ const $99936ad0bf67c8c4$var$hue = (color)=>[
27
27
  240,
28
28
  300,
29
29
  360
30
- ].map((hue)=>color.withChannelValue("hue", hue).toString("css")).join(", ");
31
- const $99936ad0bf67c8c4$var$saturation = (color)=>`${color.withChannelValue("saturation", 0)}, transparent`;
30
+ ].map((hue)=>color.withChannelValue('hue', hue).toString('css')).join(', ');
31
+ const $99936ad0bf67c8c4$var$saturation = (color)=>`${color.withChannelValue('saturation', 0)}, transparent`;
32
32
  const $99936ad0bf67c8c4$var$hslChannels = {
33
33
  hue: $99936ad0bf67c8c4$var$hue,
34
34
  saturation: $99936ad0bf67c8c4$var$saturation,
35
- lightness: ()=>"black, transparent, white"
35
+ lightness: ()=>'black, transparent, white'
36
36
  };
37
37
  const $99936ad0bf67c8c4$var$hsbChannels = {
38
38
  hue: $99936ad0bf67c8c4$var$hue,
39
39
  saturation: $99936ad0bf67c8c4$var$saturation,
40
- brightness: ()=>"black, transparent"
40
+ brightness: ()=>'black, transparent'
41
41
  };
42
42
  function $99936ad0bf67c8c4$export$dd62420467d245ca({ direction: direction, state: state, zChannel: zChannel, xChannel: xChannel, yChannel: yChannel }) {
43
43
  let returnVal = (0, $9t8qo$react.useMemo)(()=>{
44
- let end = direction === "rtl" ? "left" : "right";
44
+ let end = direction === 'rtl' ? 'left' : 'right';
45
45
  let colorAreaStyles = {};
46
46
  let zValue = state.value.getChannelValue(zChannel);
47
47
  switch(state.value.getColorSpace()){
48
- case "rgb":
48
+ case 'rgb':
49
49
  {
50
- let rgb = (0, $9t8qo$reactstatelycolor.parseColor)("rgb(0, 0, 0)");
50
+ let rgb = (0, $9t8qo$reactstatelycolor.parseColor)('rgb(0, 0, 0)');
51
51
  colorAreaStyles = {
52
52
  background: [
53
53
  // The screen blend mode multiplies the inverse of each channel, e.g. 1 - (1 - a) * (1 - b).
@@ -56,55 +56,55 @@ function $99936ad0bf67c8c4$export$dd62420467d245ca({ direction: direction, state
56
56
  `linear-gradient(to ${end}, ${rgb.withChannelValue(xChannel, 0)}, ${rgb.withChannelValue(xChannel, 255)})`,
57
57
  `linear-gradient(to top, ${rgb.withChannelValue(yChannel, 0)}, ${rgb.withChannelValue(yChannel, 255)})`,
58
58
  rgb.withChannelValue(zChannel, zValue)
59
- ].join(","),
60
- backgroundBlendMode: "screen"
59
+ ].join(','),
60
+ backgroundBlendMode: 'screen'
61
61
  };
62
62
  break;
63
63
  }
64
- case "hsl":
64
+ case 'hsl':
65
65
  {
66
66
  let channels = state.value.getColorChannels();
67
- let value = (0, $9t8qo$reactstatelycolor.parseColor)("hsl(0, 100%, 50%)").withChannelValue(zChannel, zValue);
68
- let bg = channels.filter((c)=>c !== zChannel).map((c)=>`linear-gradient(to ${c === xChannel ? end : "top"}, ${$99936ad0bf67c8c4$var$hslChannels[c](value)})`).reverse();
69
- if (zChannel === "hue") bg.push(value.toString("css"));
67
+ let value = (0, $9t8qo$reactstatelycolor.parseColor)('hsl(0, 100%, 50%)').withChannelValue(zChannel, zValue);
68
+ let bg = channels.filter((c)=>c !== zChannel).map((c)=>`linear-gradient(to ${c === xChannel ? end : 'top'}, ${$99936ad0bf67c8c4$var$hslChannels[c](value)})`).reverse();
69
+ if (zChannel === 'hue') bg.push(value.toString('css'));
70
70
  colorAreaStyles = {
71
- background: bg.join(", ")
71
+ background: bg.join(', ')
72
72
  };
73
73
  break;
74
74
  }
75
- case "hsb":
75
+ case 'hsb':
76
76
  {
77
77
  let channels = state.value.getColorChannels();
78
- let value = (0, $9t8qo$reactstatelycolor.parseColor)("hsb(0, 100%, 100%)").withChannelValue(zChannel, zValue);
79
- let bg = channels.filter((c)=>c !== zChannel).map((c)=>`linear-gradient(to ${c === xChannel ? end : "top"}, ${$99936ad0bf67c8c4$var$hsbChannels[c](value)})`).reverse();
80
- if (zChannel === "hue") bg.push(value.toString("css"));
78
+ let value = (0, $9t8qo$reactstatelycolor.parseColor)('hsb(0, 100%, 100%)').withChannelValue(zChannel, zValue);
79
+ let bg = channels.filter((c)=>c !== zChannel).map((c)=>`linear-gradient(to ${c === xChannel ? end : 'top'}, ${$99936ad0bf67c8c4$var$hsbChannels[c](value)})`).reverse();
80
+ if (zChannel === 'hue') bg.push(value.toString('css'));
81
81
  colorAreaStyles = {
82
- background: bg.join(", ")
82
+ background: bg.join(', ')
83
83
  };
84
84
  break;
85
85
  }
86
86
  }
87
87
  let { x: x, y: y } = state.getThumbPosition();
88
- if (direction === "rtl") x = 1 - x;
88
+ if (direction === 'rtl') x = 1 - x;
89
89
  let forcedColorAdjustNoneStyle = {
90
- forcedColorAdjust: "none"
90
+ forcedColorAdjust: 'none'
91
91
  };
92
92
  return {
93
93
  colorAreaStyleProps: {
94
94
  style: {
95
- position: "relative",
96
- touchAction: "none",
95
+ position: 'relative',
96
+ touchAction: 'none',
97
97
  ...forcedColorAdjustNoneStyle,
98
98
  ...colorAreaStyles
99
99
  }
100
100
  },
101
101
  thumbStyleProps: {
102
102
  style: {
103
- position: "absolute",
103
+ position: 'absolute',
104
104
  left: `${x * 100}%`,
105
105
  top: `${y * 100}%`,
106
- transform: "translate(-50%, -50%)",
107
- touchAction: "none",
106
+ transform: 'translate(-50%, -50%)',
107
+ touchAction: 'none',
108
108
  ...forcedColorAdjustNoneStyle
109
109
  }
110
110
  }
@@ -21,27 +21,27 @@ const $40297c24c53588e6$var$hue = (color)=>[
21
21
  240,
22
22
  300,
23
23
  360
24
- ].map((hue)=>color.withChannelValue("hue", hue).toString("css")).join(", ");
25
- const $40297c24c53588e6$var$saturation = (color)=>`${color.withChannelValue("saturation", 0)}, transparent`;
24
+ ].map((hue)=>color.withChannelValue('hue', hue).toString('css')).join(', ');
25
+ const $40297c24c53588e6$var$saturation = (color)=>`${color.withChannelValue('saturation', 0)}, transparent`;
26
26
  const $40297c24c53588e6$var$hslChannels = {
27
27
  hue: $40297c24c53588e6$var$hue,
28
28
  saturation: $40297c24c53588e6$var$saturation,
29
- lightness: ()=>"black, transparent, white"
29
+ lightness: ()=>'black, transparent, white'
30
30
  };
31
31
  const $40297c24c53588e6$var$hsbChannels = {
32
32
  hue: $40297c24c53588e6$var$hue,
33
33
  saturation: $40297c24c53588e6$var$saturation,
34
- brightness: ()=>"black, transparent"
34
+ brightness: ()=>'black, transparent'
35
35
  };
36
36
  function $40297c24c53588e6$export$dd62420467d245ca({ direction: direction, state: state, zChannel: zChannel, xChannel: xChannel, yChannel: yChannel }) {
37
37
  let returnVal = (0, $hLqEt$useMemo)(()=>{
38
- let end = direction === "rtl" ? "left" : "right";
38
+ let end = direction === 'rtl' ? 'left' : 'right';
39
39
  let colorAreaStyles = {};
40
40
  let zValue = state.value.getChannelValue(zChannel);
41
41
  switch(state.value.getColorSpace()){
42
- case "rgb":
42
+ case 'rgb':
43
43
  {
44
- let rgb = (0, $hLqEt$parseColor)("rgb(0, 0, 0)");
44
+ let rgb = (0, $hLqEt$parseColor)('rgb(0, 0, 0)');
45
45
  colorAreaStyles = {
46
46
  background: [
47
47
  // The screen blend mode multiplies the inverse of each channel, e.g. 1 - (1 - a) * (1 - b).
@@ -50,55 +50,55 @@ function $40297c24c53588e6$export$dd62420467d245ca({ direction: direction, state
50
50
  `linear-gradient(to ${end}, ${rgb.withChannelValue(xChannel, 0)}, ${rgb.withChannelValue(xChannel, 255)})`,
51
51
  `linear-gradient(to top, ${rgb.withChannelValue(yChannel, 0)}, ${rgb.withChannelValue(yChannel, 255)})`,
52
52
  rgb.withChannelValue(zChannel, zValue)
53
- ].join(","),
54
- backgroundBlendMode: "screen"
53
+ ].join(','),
54
+ backgroundBlendMode: 'screen'
55
55
  };
56
56
  break;
57
57
  }
58
- case "hsl":
58
+ case 'hsl':
59
59
  {
60
60
  let channels = state.value.getColorChannels();
61
- let value = (0, $hLqEt$parseColor)("hsl(0, 100%, 50%)").withChannelValue(zChannel, zValue);
62
- let bg = channels.filter((c)=>c !== zChannel).map((c)=>`linear-gradient(to ${c === xChannel ? end : "top"}, ${$40297c24c53588e6$var$hslChannels[c](value)})`).reverse();
63
- if (zChannel === "hue") bg.push(value.toString("css"));
61
+ let value = (0, $hLqEt$parseColor)('hsl(0, 100%, 50%)').withChannelValue(zChannel, zValue);
62
+ let bg = channels.filter((c)=>c !== zChannel).map((c)=>`linear-gradient(to ${c === xChannel ? end : 'top'}, ${$40297c24c53588e6$var$hslChannels[c](value)})`).reverse();
63
+ if (zChannel === 'hue') bg.push(value.toString('css'));
64
64
  colorAreaStyles = {
65
- background: bg.join(", ")
65
+ background: bg.join(', ')
66
66
  };
67
67
  break;
68
68
  }
69
- case "hsb":
69
+ case 'hsb':
70
70
  {
71
71
  let channels = state.value.getColorChannels();
72
- let value = (0, $hLqEt$parseColor)("hsb(0, 100%, 100%)").withChannelValue(zChannel, zValue);
73
- let bg = channels.filter((c)=>c !== zChannel).map((c)=>`linear-gradient(to ${c === xChannel ? end : "top"}, ${$40297c24c53588e6$var$hsbChannels[c](value)})`).reverse();
74
- if (zChannel === "hue") bg.push(value.toString("css"));
72
+ let value = (0, $hLqEt$parseColor)('hsb(0, 100%, 100%)').withChannelValue(zChannel, zValue);
73
+ let bg = channels.filter((c)=>c !== zChannel).map((c)=>`linear-gradient(to ${c === xChannel ? end : 'top'}, ${$40297c24c53588e6$var$hsbChannels[c](value)})`).reverse();
74
+ if (zChannel === 'hue') bg.push(value.toString('css'));
75
75
  colorAreaStyles = {
76
- background: bg.join(", ")
76
+ background: bg.join(', ')
77
77
  };
78
78
  break;
79
79
  }
80
80
  }
81
81
  let { x: x, y: y } = state.getThumbPosition();
82
- if (direction === "rtl") x = 1 - x;
82
+ if (direction === 'rtl') x = 1 - x;
83
83
  let forcedColorAdjustNoneStyle = {
84
- forcedColorAdjust: "none"
84
+ forcedColorAdjust: 'none'
85
85
  };
86
86
  return {
87
87
  colorAreaStyleProps: {
88
88
  style: {
89
- position: "relative",
90
- touchAction: "none",
89
+ position: 'relative',
90
+ touchAction: 'none',
91
91
  ...forcedColorAdjustNoneStyle,
92
92
  ...colorAreaStyles
93
93
  }
94
94
  },
95
95
  thumbStyleProps: {
96
96
  style: {
97
- position: "absolute",
97
+ position: 'absolute',
98
98
  left: `${x * 100}%`,
99
99
  top: `${y * 100}%`,
100
- transform: "translate(-50%, -50%)",
101
- touchAction: "none",
100
+ transform: 'translate(-50%, -50%)',
101
+ touchAction: 'none',
102
102
  ...forcedColorAdjustNoneStyle
103
103
  }
104
104
  }