@webdevarif/dashui 0.3.6 → 0.3.7
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.
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3237,9 +3237,13 @@ var ColorPicker = ({
|
|
|
3237
3237
|
var ColorPickerSelection = memo(({ className, ...props }) => {
|
|
3238
3238
|
const containerRef = useRef4(null);
|
|
3239
3239
|
const [isDragging, setIsDragging] = useState7(false);
|
|
3240
|
-
const
|
|
3241
|
-
const [
|
|
3242
|
-
const
|
|
3240
|
+
const { hue, saturation, lightness, setSaturation, setLightness } = useColorPicker();
|
|
3241
|
+
const [posX, setPosX] = useState7(() => saturation / 100);
|
|
3242
|
+
const [posY, setPosY] = useState7(() => {
|
|
3243
|
+
const x = saturation / 100;
|
|
3244
|
+
const topL = x < 0.01 ? 100 : 50 + 50 * (1 - x);
|
|
3245
|
+
return topL > 0 ? Math.max(0, Math.min(1, 1 - lightness / topL)) : 0;
|
|
3246
|
+
});
|
|
3243
3247
|
const bg = useMemo2(
|
|
3244
3248
|
() => `linear-gradient(0deg,rgba(0,0,0,1),rgba(0,0,0,0)),linear-gradient(90deg,rgba(255,255,255,1),rgba(255,255,255,0)),hsl(${hue},100%,50%)`,
|
|
3245
3249
|
[hue]
|