@react-stately/color 3.6.1-nightly.4624 → 3.6.1

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.
@@ -21,7 +21,7 @@ $parcel$export(module.exports, "useColorWheelState", () => $9d7d8736d45f74b8$exp
21
21
  */
22
22
 
23
23
 
24
- const $9d7d8736d45f74b8$var$DEFAULT_COLOR = (0, $83fe1a57d631223b$exports.parseColor)("hsl(0, 100%, 50%)");
24
+ const $9d7d8736d45f74b8$var$DEFAULT_COLOR = (0, $83fe1a57d631223b$exports.parseColor)('hsl(0, 100%, 50%)');
25
25
  function $9d7d8736d45f74b8$var$roundToStep(value, step) {
26
26
  return Math.round(value / step) * step;
27
27
  }
@@ -59,7 +59,7 @@ function $9d7d8736d45f74b8$export$f4301076d9336137(props) {
59
59
  let [stateValue, setValueState] = (0, $5Frb2$reactstatelyutils.useControlledState)((0, $83fe1a57d631223b$exports.normalizeColor)(props.value), (0, $83fe1a57d631223b$exports.normalizeColor)(defaultValue), onChange);
60
60
  let value = (0, $5Frb2$react.useMemo)(()=>{
61
61
  let colorSpace = stateValue.getColorSpace();
62
- return colorSpace === "hsl" || colorSpace === "hsb" ? stateValue : stateValue.toFormat("hsl");
62
+ return colorSpace === 'hsl' || colorSpace === 'hsb' ? stateValue : stateValue.toFormat('hsl');
63
63
  }, [
64
64
  stateValue
65
65
  ]);
@@ -68,17 +68,17 @@ function $9d7d8736d45f74b8$export$f4301076d9336137(props) {
68
68
  valueRef.current = value;
69
69
  setValueState(value);
70
70
  };
71
- let channelRange = value.getChannelRange("hue");
71
+ let channelRange = value.getChannelRange('hue');
72
72
  let { minValue: minValueX, maxValue: maxValueX, step: step, pageSize: pageStep } = channelRange;
73
73
  let [isDragging, setDragging] = (0, $5Frb2$react.useState)(false);
74
74
  let isDraggingRef = (0, $5Frb2$react.useRef)(false);
75
- let hue = value.getChannelValue("hue");
75
+ let hue = value.getChannelValue('hue');
76
76
  function setHue(v) {
77
77
  if (v > 360) // Make sure you can always get back to 0.
78
78
  v = 0;
79
79
  v = $9d7d8736d45f74b8$var$roundToStep($9d7d8736d45f74b8$var$mod(v, 360), step);
80
80
  if (hue !== v) {
81
- let color = value.withChannelValue("hue", v);
81
+ let color = value.withChannelValue('hue', v);
82
82
  setValue(color);
83
83
  }
84
84
  }
@@ -96,7 +96,7 @@ function $9d7d8736d45f74b8$export$f4301076d9336137(props) {
96
96
  setHue($9d7d8736d45f74b8$var$cartesianToAngle(x, y, radius));
97
97
  },
98
98
  getThumbPosition (radius) {
99
- return $9d7d8736d45f74b8$var$angleToCartesian(value.getChannelValue("hue"), radius);
99
+ return $9d7d8736d45f74b8$var$angleToCartesian(value.getChannelValue('hue'), radius);
100
100
  },
101
101
  increment (stepSize = 1) {
102
102
  let s = Math.max(stepSize, step);
@@ -120,7 +120,7 @@ function $9d7d8736d45f74b8$export$f4301076d9336137(props) {
120
120
  },
121
121
  isDragging: isDragging,
122
122
  getDisplayColor () {
123
- return value.toFormat("hsl").withChannelValue("saturation", 100).withChannelValue("lightness", 50).withChannelValue("alpha", 1);
123
+ return value.toFormat('hsl').withChannelValue('saturation', 100).withChannelValue('lightness', 50).withChannelValue('alpha', 1);
124
124
  },
125
125
  isDisabled: props.isDisabled || false
126
126
  };
@@ -15,7 +15,7 @@ import {useMemo as $d4Pfi$useMemo, useRef as $d4Pfi$useRef, useState as $d4Pfi$u
15
15
  */
16
16
 
17
17
 
18
- const $ee4262c74a467b07$var$DEFAULT_COLOR = (0, $799cddbef784668f$export$6e865ea70d7724f)("hsl(0, 100%, 50%)");
18
+ const $ee4262c74a467b07$var$DEFAULT_COLOR = (0, $799cddbef784668f$export$6e865ea70d7724f)('hsl(0, 100%, 50%)');
19
19
  function $ee4262c74a467b07$var$roundToStep(value, step) {
20
20
  return Math.round(value / step) * step;
21
21
  }
@@ -53,7 +53,7 @@ function $ee4262c74a467b07$export$f4301076d9336137(props) {
53
53
  let [stateValue, setValueState] = (0, $d4Pfi$useControlledState)((0, $799cddbef784668f$export$4cde5df63f53f473)(props.value), (0, $799cddbef784668f$export$4cde5df63f53f473)(defaultValue), onChange);
54
54
  let value = (0, $d4Pfi$useMemo)(()=>{
55
55
  let colorSpace = stateValue.getColorSpace();
56
- return colorSpace === "hsl" || colorSpace === "hsb" ? stateValue : stateValue.toFormat("hsl");
56
+ return colorSpace === 'hsl' || colorSpace === 'hsb' ? stateValue : stateValue.toFormat('hsl');
57
57
  }, [
58
58
  stateValue
59
59
  ]);
@@ -62,17 +62,17 @@ function $ee4262c74a467b07$export$f4301076d9336137(props) {
62
62
  valueRef.current = value;
63
63
  setValueState(value);
64
64
  };
65
- let channelRange = value.getChannelRange("hue");
65
+ let channelRange = value.getChannelRange('hue');
66
66
  let { minValue: minValueX, maxValue: maxValueX, step: step, pageSize: pageStep } = channelRange;
67
67
  let [isDragging, setDragging] = (0, $d4Pfi$useState)(false);
68
68
  let isDraggingRef = (0, $d4Pfi$useRef)(false);
69
- let hue = value.getChannelValue("hue");
69
+ let hue = value.getChannelValue('hue');
70
70
  function setHue(v) {
71
71
  if (v > 360) // Make sure you can always get back to 0.
72
72
  v = 0;
73
73
  v = $ee4262c74a467b07$var$roundToStep($ee4262c74a467b07$var$mod(v, 360), step);
74
74
  if (hue !== v) {
75
- let color = value.withChannelValue("hue", v);
75
+ let color = value.withChannelValue('hue', v);
76
76
  setValue(color);
77
77
  }
78
78
  }
@@ -90,7 +90,7 @@ function $ee4262c74a467b07$export$f4301076d9336137(props) {
90
90
  setHue($ee4262c74a467b07$var$cartesianToAngle(x, y, radius));
91
91
  },
92
92
  getThumbPosition (radius) {
93
- return $ee4262c74a467b07$var$angleToCartesian(value.getChannelValue("hue"), radius);
93
+ return $ee4262c74a467b07$var$angleToCartesian(value.getChannelValue('hue'), radius);
94
94
  },
95
95
  increment (stepSize = 1) {
96
96
  let s = Math.max(stepSize, step);
@@ -114,7 +114,7 @@ function $ee4262c74a467b07$export$f4301076d9336137(props) {
114
114
  },
115
115
  isDragging: isDragging,
116
116
  getDisplayColor () {
117
- return value.toFormat("hsl").withChannelValue("saturation", 100).withChannelValue("lightness", 50).withChannelValue("alpha", 1);
117
+ return value.toFormat('hsl').withChannelValue('saturation', 100).withChannelValue('lightness', 50).withChannelValue('alpha', 1);
118
118
  },
119
119
  isDisabled: props.isDisabled || false
120
120
  };
@@ -15,7 +15,7 @@ import {useMemo as $d4Pfi$useMemo, useRef as $d4Pfi$useRef, useState as $d4Pfi$u
15
15
  */
16
16
 
17
17
 
18
- const $ee4262c74a467b07$var$DEFAULT_COLOR = (0, $799cddbef784668f$export$6e865ea70d7724f)("hsl(0, 100%, 50%)");
18
+ const $ee4262c74a467b07$var$DEFAULT_COLOR = (0, $799cddbef784668f$export$6e865ea70d7724f)('hsl(0, 100%, 50%)');
19
19
  function $ee4262c74a467b07$var$roundToStep(value, step) {
20
20
  return Math.round(value / step) * step;
21
21
  }
@@ -53,7 +53,7 @@ function $ee4262c74a467b07$export$f4301076d9336137(props) {
53
53
  let [stateValue, setValueState] = (0, $d4Pfi$useControlledState)((0, $799cddbef784668f$export$4cde5df63f53f473)(props.value), (0, $799cddbef784668f$export$4cde5df63f53f473)(defaultValue), onChange);
54
54
  let value = (0, $d4Pfi$useMemo)(()=>{
55
55
  let colorSpace = stateValue.getColorSpace();
56
- return colorSpace === "hsl" || colorSpace === "hsb" ? stateValue : stateValue.toFormat("hsl");
56
+ return colorSpace === 'hsl' || colorSpace === 'hsb' ? stateValue : stateValue.toFormat('hsl');
57
57
  }, [
58
58
  stateValue
59
59
  ]);
@@ -62,17 +62,17 @@ function $ee4262c74a467b07$export$f4301076d9336137(props) {
62
62
  valueRef.current = value;
63
63
  setValueState(value);
64
64
  };
65
- let channelRange = value.getChannelRange("hue");
65
+ let channelRange = value.getChannelRange('hue');
66
66
  let { minValue: minValueX, maxValue: maxValueX, step: step, pageSize: pageStep } = channelRange;
67
67
  let [isDragging, setDragging] = (0, $d4Pfi$useState)(false);
68
68
  let isDraggingRef = (0, $d4Pfi$useRef)(false);
69
- let hue = value.getChannelValue("hue");
69
+ let hue = value.getChannelValue('hue');
70
70
  function setHue(v) {
71
71
  if (v > 360) // Make sure you can always get back to 0.
72
72
  v = 0;
73
73
  v = $ee4262c74a467b07$var$roundToStep($ee4262c74a467b07$var$mod(v, 360), step);
74
74
  if (hue !== v) {
75
- let color = value.withChannelValue("hue", v);
75
+ let color = value.withChannelValue('hue', v);
76
76
  setValue(color);
77
77
  }
78
78
  }
@@ -90,7 +90,7 @@ function $ee4262c74a467b07$export$f4301076d9336137(props) {
90
90
  setHue($ee4262c74a467b07$var$cartesianToAngle(x, y, radius));
91
91
  },
92
92
  getThumbPosition (radius) {
93
- return $ee4262c74a467b07$var$angleToCartesian(value.getChannelValue("hue"), radius);
93
+ return $ee4262c74a467b07$var$angleToCartesian(value.getChannelValue('hue'), radius);
94
94
  },
95
95
  increment (stepSize = 1) {
96
96
  let s = Math.max(stepSize, step);
@@ -114,7 +114,7 @@ function $ee4262c74a467b07$export$f4301076d9336137(props) {
114
114
  },
115
115
  isDragging: isDragging,
116
116
  getDisplayColor () {
117
- return value.toFormat("hsl").withChannelValue("saturation", 100).withChannelValue("lightness", 50).withChannelValue("alpha", 1);
117
+ return value.toFormat('hsl').withChannelValue('saturation', 100).withChannelValue('lightness', 50).withChannelValue('alpha', 1);
118
118
  },
119
119
  isDisabled: props.isDisabled || false
120
120
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-stately/color",
3
- "version": "3.6.1-nightly.4624+d80999e89",
3
+ "version": "3.6.1",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -22,15 +22,15 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@internationalized/number": "3.5.3-nightly.4624+d80999e89",
26
- "@internationalized/string": "3.2.3-nightly.4624+d80999e89",
27
- "@react-aria/i18n": "3.0.0-nightly.2912+d80999e89",
28
- "@react-stately/form": "3.0.3-nightly.4624+d80999e89",
29
- "@react-stately/numberfield": "3.0.0-nightly.2912+d80999e89",
30
- "@react-stately/slider": "3.5.4-nightly.4624+d80999e89",
31
- "@react-stately/utils": "3.0.0-nightly.2912+d80999e89",
32
- "@react-types/color": "3.0.0-nightly.4624+d80999e89",
33
- "@react-types/shared": "3.0.0-nightly.2912+d80999e89",
25
+ "@internationalized/number": "^3.5.3",
26
+ "@internationalized/string": "^3.2.3",
27
+ "@react-aria/i18n": "^3.11.1",
28
+ "@react-stately/form": "^3.0.3",
29
+ "@react-stately/numberfield": "^3.9.3",
30
+ "@react-stately/slider": "^3.5.4",
31
+ "@react-stately/utils": "^3.10.1",
32
+ "@react-types/color": "3.0.0-beta.25",
33
+ "@react-types/shared": "^3.23.1",
34
34
  "@swc/helpers": "^0.5.0"
35
35
  },
36
36
  "peerDependencies": {
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "d80999e897b4d4db9fcfb4e9b8fcdc9fdd700882"
42
+ "gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
43
43
  }