@luminescent/ui 0.7.7 → 0.8.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.
- package/LICENSE +661 -661
- package/README.md +48 -48
- package/lib/index.qwik.cjs +323 -566
- package/lib/index.qwik.mjs +324 -567
- package/lib-types/components/elements/ColorInput.d.ts +12 -2
- package/lib-types/utils/simple-color-picker/color.d.ts +6 -21
- package/package.json +62 -62
- package/src/tailwind.config.js +71 -71
- package/lib-types/utils/simple-color-picker/index.d.ts +0 -145
- package/lib-types/utils/simple-color-picker/utils.d.ts +0 -6
package/lib/index.qwik.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const qwik = require("@builder.io/qwik");
|
|
4
|
-
const build = require("@builder.io/qwik/build");
|
|
5
4
|
const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
|
|
6
5
|
const Anchor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => /* @__PURE__ */ qwik._jsxQ("span", null, {
|
|
7
6
|
class: "block h-32 -mt-32",
|
|
@@ -307,80 +306,6 @@ function getMousePosition(e) {
|
|
|
307
306
|
};
|
|
308
307
|
}
|
|
309
308
|
const pad2 = (c) => c.length == 1 ? "0" + c : "" + c;
|
|
310
|
-
class Color {
|
|
311
|
-
constructor(color) {
|
|
312
|
-
this._rgba = {
|
|
313
|
-
r: 0,
|
|
314
|
-
g: 0,
|
|
315
|
-
b: 0,
|
|
316
|
-
a: 1
|
|
317
|
-
};
|
|
318
|
-
this._hsva = {
|
|
319
|
-
h: 0,
|
|
320
|
-
s: 0,
|
|
321
|
-
v: 0,
|
|
322
|
-
a: 1
|
|
323
|
-
};
|
|
324
|
-
this.fromHex(color);
|
|
325
|
-
}
|
|
326
|
-
fromHex(color = 0) {
|
|
327
|
-
if (typeof color === "number") {
|
|
328
|
-
this._hexNumber = color;
|
|
329
|
-
this._hexString = numberToHexString(this._hexNumber);
|
|
330
|
-
} else {
|
|
331
|
-
this._hexString = color.toUpperCase();
|
|
332
|
-
this._hexNumber = hexStringToNumber(this._hexString);
|
|
333
|
-
}
|
|
334
|
-
const { r, g, b } = hexNumberToRgb(this._hexNumber);
|
|
335
|
-
this._rgba.r = r;
|
|
336
|
-
this._rgba.g = g;
|
|
337
|
-
this._rgba.b = b;
|
|
338
|
-
const { h, s, v } = rgbToHsv(this._rgba);
|
|
339
|
-
this._hsva.h = h;
|
|
340
|
-
this._hsva.s = s;
|
|
341
|
-
this._hsva.v = v;
|
|
342
|
-
this._updateBrightness();
|
|
343
|
-
}
|
|
344
|
-
fromHsv(color) {
|
|
345
|
-
const { h, s, v } = color;
|
|
346
|
-
this._hsva.h = h;
|
|
347
|
-
this._hsva.s = s;
|
|
348
|
-
this._hsva.v = v;
|
|
349
|
-
const { r, g, b } = hsvToRgb(this._hsva);
|
|
350
|
-
this._rgba.r = r;
|
|
351
|
-
this._rgba.g = g;
|
|
352
|
-
this._rgba.b = b;
|
|
353
|
-
this._hexString = rgbToHex(this._rgba);
|
|
354
|
-
this._hexNumber = hexStringToNumber(this._hexString);
|
|
355
|
-
this._updateBrightness();
|
|
356
|
-
}
|
|
357
|
-
_updateBrightness() {
|
|
358
|
-
this._brightness = getBrightness(this._rgba);
|
|
359
|
-
this._isDark = this._brightness < 0.5;
|
|
360
|
-
this._isLight = !this._isDark;
|
|
361
|
-
}
|
|
362
|
-
get rgb() {
|
|
363
|
-
return this._rgba;
|
|
364
|
-
}
|
|
365
|
-
get hsv() {
|
|
366
|
-
return this._hsva;
|
|
367
|
-
}
|
|
368
|
-
get hex() {
|
|
369
|
-
return this._hexNumber;
|
|
370
|
-
}
|
|
371
|
-
get hexString() {
|
|
372
|
-
return this._hexString;
|
|
373
|
-
}
|
|
374
|
-
get brightness() {
|
|
375
|
-
return this._brightness;
|
|
376
|
-
}
|
|
377
|
-
get isDark() {
|
|
378
|
-
return this._isDark;
|
|
379
|
-
}
|
|
380
|
-
get isLight() {
|
|
381
|
-
return this._isLight;
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
309
|
function getBrightness(color) {
|
|
385
310
|
const { r, g, b } = color;
|
|
386
311
|
return (r * 299 + g * 587 + b * 114) / 1e3;
|
|
@@ -405,7 +330,6 @@ function rgbToHex(color) {
|
|
|
405
330
|
];
|
|
406
331
|
return hex.join("").toUpperCase();
|
|
407
332
|
}
|
|
408
|
-
const numberToHexString = (color) => "#" + ("00000" + (color | 0).toString(16)).substr(-6).toUpperCase();
|
|
409
333
|
const hexStringToNumber = (color) => parseInt(color.replace("#", ""), 16);
|
|
410
334
|
function hsvToRgb(color) {
|
|
411
335
|
let { h } = color;
|
|
@@ -475,338 +399,6 @@ function rgbToHsv(color) {
|
|
|
475
399
|
v
|
|
476
400
|
};
|
|
477
401
|
}
|
|
478
|
-
class ColorPicker {
|
|
479
|
-
constructor(options = {}) {
|
|
480
|
-
this._widthUnits = "px";
|
|
481
|
-
this._heightUnits = "px";
|
|
482
|
-
this._huePosition = 0;
|
|
483
|
-
this._hueHeight = 0;
|
|
484
|
-
this._maxHue = 0;
|
|
485
|
-
this._inputIsNumber = false;
|
|
486
|
-
this._saturationWidth = 0;
|
|
487
|
-
this._isChoosing = false;
|
|
488
|
-
this._callbacks = [];
|
|
489
|
-
this.width = 0;
|
|
490
|
-
this.height = 0;
|
|
491
|
-
this.hue = 0;
|
|
492
|
-
this.position = {
|
|
493
|
-
x: 0,
|
|
494
|
-
y: 0
|
|
495
|
-
};
|
|
496
|
-
this.color = new Color(0);
|
|
497
|
-
this.backgroundColor = new Color(0);
|
|
498
|
-
this.hueColor = new Color(0);
|
|
499
|
-
this._onSaturationMouseDown = (e) => {
|
|
500
|
-
const sbOffset = this.$saturation.getBoundingClientRect();
|
|
501
|
-
const { x, y } = getMousePosition(e);
|
|
502
|
-
this._isChoosing = true;
|
|
503
|
-
this._moveSelectorTo(x - sbOffset.left, y - sbOffset.top);
|
|
504
|
-
this._updateColorFromPosition();
|
|
505
|
-
this._window.addEventListener("mouseup", this._onSaturationMouseUp);
|
|
506
|
-
this._window.addEventListener("touchend", this._onSaturationMouseUp);
|
|
507
|
-
this._window.addEventListener("mousemove", this._onSaturationMouseMove);
|
|
508
|
-
this._window.addEventListener("touchmove", this._onSaturationMouseMove);
|
|
509
|
-
e.preventDefault();
|
|
510
|
-
};
|
|
511
|
-
this._onSaturationMouseMove = (e) => {
|
|
512
|
-
const sbOffset = this.$saturation.getBoundingClientRect();
|
|
513
|
-
const { x, y } = getMousePosition(e);
|
|
514
|
-
this._moveSelectorTo(x - sbOffset.left, y - sbOffset.top);
|
|
515
|
-
this._updateColorFromPosition();
|
|
516
|
-
};
|
|
517
|
-
this._onSaturationMouseUp = () => {
|
|
518
|
-
this._isChoosing = false;
|
|
519
|
-
this._window.removeEventListener("mouseup", this._onSaturationMouseUp);
|
|
520
|
-
this._window.removeEventListener("touchend", this._onSaturationMouseUp);
|
|
521
|
-
this._window.removeEventListener("mousemove", this._onSaturationMouseMove);
|
|
522
|
-
this._window.removeEventListener("touchmove", this._onSaturationMouseMove);
|
|
523
|
-
};
|
|
524
|
-
this._onHueMouseDown = (e) => {
|
|
525
|
-
const hOffset = this.$hue.getBoundingClientRect();
|
|
526
|
-
const { y } = getMousePosition(e);
|
|
527
|
-
this._isChoosing = true;
|
|
528
|
-
this._moveHueTo(y - hOffset.top);
|
|
529
|
-
this._updateHueFromPosition();
|
|
530
|
-
this._window.addEventListener("mouseup", this._onHueMouseUp);
|
|
531
|
-
this._window.addEventListener("touchend", this._onHueMouseUp);
|
|
532
|
-
this._window.addEventListener("mousemove", this._onHueMouseMove);
|
|
533
|
-
this._window.addEventListener("touchmove", this._onHueMouseMove);
|
|
534
|
-
e.preventDefault();
|
|
535
|
-
};
|
|
536
|
-
this._onHueMouseMove = (e) => {
|
|
537
|
-
const hOffset = this.$hue.getBoundingClientRect();
|
|
538
|
-
const { y } = getMousePosition(e);
|
|
539
|
-
this._moveHueTo(y - hOffset.top);
|
|
540
|
-
this._updateHueFromPosition();
|
|
541
|
-
};
|
|
542
|
-
this._onHueMouseUp = () => {
|
|
543
|
-
this._isChoosing = false;
|
|
544
|
-
this._window.removeEventListener("mouseup", this._onHueMouseUp);
|
|
545
|
-
this._window.removeEventListener("touchend", this._onHueMouseUp);
|
|
546
|
-
this._window.removeEventListener("mousemove", this._onHueMouseMove);
|
|
547
|
-
this._window.removeEventListener("touchmove", this._onHueMouseMove);
|
|
548
|
-
};
|
|
549
|
-
this._window = options.window || window;
|
|
550
|
-
this._document = this._window.document;
|
|
551
|
-
this.$el = this._document.createElement("div");
|
|
552
|
-
this.$el.className = "color-picker";
|
|
553
|
-
this.$el.innerHTML = `
|
|
554
|
-
<div class="color-picker-saturation">
|
|
555
|
-
<div class="color-picker-brightness"></div>
|
|
556
|
-
<div class="color-picker-sbSelector"></div>
|
|
557
|
-
</div>
|
|
558
|
-
<div class="color-picker-hue">
|
|
559
|
-
<div class="color-picker-hSelector"></div>
|
|
560
|
-
</div>
|
|
561
|
-
`;
|
|
562
|
-
this.$saturation = this.$el.querySelector(".color-picker-saturation");
|
|
563
|
-
this.$hue = this.$el.querySelector(".color-picker-hue");
|
|
564
|
-
this.$sbSelector = this.$el.querySelector(".color-picker-sbSelector");
|
|
565
|
-
this.$hSelector = this.$el.querySelector(".color-picker-hSelector");
|
|
566
|
-
this.$saturation.addEventListener("mousedown", this._onSaturationMouseDown);
|
|
567
|
-
this.$saturation.addEventListener("touchstart", this._onSaturationMouseDown);
|
|
568
|
-
this.$hue.addEventListener("mousedown", this._onHueMouseDown);
|
|
569
|
-
this.$hue.addEventListener("touchstart", this._onHueMouseDown);
|
|
570
|
-
if (options.el)
|
|
571
|
-
this.appendTo(options.el);
|
|
572
|
-
if (options.background)
|
|
573
|
-
this.setBackgroundColor(options.background);
|
|
574
|
-
if (options.widthUnits)
|
|
575
|
-
this._widthUnits = options.widthUnits;
|
|
576
|
-
if (options.heightUnits)
|
|
577
|
-
this._heightUnits = options.heightUnits;
|
|
578
|
-
if (options.colors) {
|
|
579
|
-
this.$colors = this._document.createElement("div");
|
|
580
|
-
this.$colors.className = "color-picker-colors";
|
|
581
|
-
this.$el.appendChild(this.$colors);
|
|
582
|
-
options.colors.forEach((color) => {
|
|
583
|
-
const $color = this._document.createElement("button");
|
|
584
|
-
$color.className = "color-picker-color";
|
|
585
|
-
$color.style.background = `${color}`;
|
|
586
|
-
$color.addEventListener("mousedown", (e) => {
|
|
587
|
-
this.setColor(color);
|
|
588
|
-
e.preventDefault();
|
|
589
|
-
});
|
|
590
|
-
$color.addEventListener("touchstart", (e) => {
|
|
591
|
-
this.setColor(color);
|
|
592
|
-
e.preventDefault();
|
|
593
|
-
});
|
|
594
|
-
this.$colors.appendChild($color);
|
|
595
|
-
});
|
|
596
|
-
}
|
|
597
|
-
this.setSize(options.width || 175, options.height || 150);
|
|
598
|
-
this.setColor(options.color);
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* Add the ColorPicker instance to a DOM element.
|
|
602
|
-
* @param {HTMLElement} el
|
|
603
|
-
* @return {ColorPicker} Returns itself for chaining purpose
|
|
604
|
-
*/
|
|
605
|
-
appendTo(el) {
|
|
606
|
-
if (typeof el === "string")
|
|
607
|
-
document.querySelector(el).appendChild(this.$el);
|
|
608
|
-
else
|
|
609
|
-
el.appendChild(this.$el);
|
|
610
|
-
return this;
|
|
611
|
-
}
|
|
612
|
-
/**
|
|
613
|
-
* Removes picker from its parent and kill all listeners.
|
|
614
|
-
* Call this method for proper destroy.
|
|
615
|
-
*/
|
|
616
|
-
remove() {
|
|
617
|
-
this._callbacks = [];
|
|
618
|
-
this._onSaturationMouseUp();
|
|
619
|
-
this._onHueMouseUp();
|
|
620
|
-
this.$saturation.removeEventListener("mousedown", this._onSaturationMouseDown);
|
|
621
|
-
this.$saturation.removeEventListener("touchstart", this._onSaturationMouseDown);
|
|
622
|
-
this.$hue.removeEventListener("mousedown", this._onHueMouseDown);
|
|
623
|
-
this.$hue.removeEventListener("touchstart", this._onHueMouseDown);
|
|
624
|
-
if (this.$el.parentNode)
|
|
625
|
-
this.$el.parentNode.removeChild(this.$el);
|
|
626
|
-
}
|
|
627
|
-
/**
|
|
628
|
-
* Manually set the current color of the picker. This is the method
|
|
629
|
-
* used on instantiation to convert `color` option to actual color for
|
|
630
|
-
* the picker. Param can be a hexadecimal number or an hex String.
|
|
631
|
-
* @param {String|Number} color hex color desired
|
|
632
|
-
* @return {ColorPicker} Returns itself for chaining purpose
|
|
633
|
-
*/
|
|
634
|
-
setColor(color) {
|
|
635
|
-
this._inputIsNumber = !isNaN(Number(color));
|
|
636
|
-
this.color.fromHex(color);
|
|
637
|
-
const { h, s, v } = this.color.hsv;
|
|
638
|
-
if (!isNaN(h))
|
|
639
|
-
this.hue = h;
|
|
640
|
-
this._moveSelectorTo(this._saturationWidth * s, (1 - v) * this._hueHeight);
|
|
641
|
-
this._moveHueTo((1 - this.hue) * this._hueHeight);
|
|
642
|
-
this._updateHue();
|
|
643
|
-
return this;
|
|
644
|
-
}
|
|
645
|
-
/**
|
|
646
|
-
* Set size of the color picker for a given width and height. Note that
|
|
647
|
-
* a padding of 5px will be added if you chose to use the background option
|
|
648
|
-
* of the constructor.
|
|
649
|
-
* @param {Number} width
|
|
650
|
-
* @param {Number} height
|
|
651
|
-
* @return {ColorPicker} Returns itself for chaining purpose
|
|
652
|
-
*/
|
|
653
|
-
setSize(width, height) {
|
|
654
|
-
this.width = width;
|
|
655
|
-
this.height = height;
|
|
656
|
-
this.$el.style.width = this.width + this._widthUnits;
|
|
657
|
-
this.$el.style.height = this.height + this._heightUnits;
|
|
658
|
-
this._saturationWidth = this.width - 25;
|
|
659
|
-
this.$saturation.style.width = this._saturationWidth + "px";
|
|
660
|
-
this._hueHeight = this.height;
|
|
661
|
-
this._maxHue = this._hueHeight - 2;
|
|
662
|
-
return this;
|
|
663
|
-
}
|
|
664
|
-
/**
|
|
665
|
-
* Set the background color of the picker. It also adds a 5px padding
|
|
666
|
-
* for design purpose.
|
|
667
|
-
* @param {String|Number} color hex color desired for background
|
|
668
|
-
* @return {ColorPicker} Returns itself for chaining purpose
|
|
669
|
-
*/
|
|
670
|
-
setBackgroundColor(color) {
|
|
671
|
-
this.backgroundColor.fromHex(color);
|
|
672
|
-
this.$el.style.padding = "5px";
|
|
673
|
-
this.$el.style.background = this.backgroundColor.hexString;
|
|
674
|
-
return this;
|
|
675
|
-
}
|
|
676
|
-
/**
|
|
677
|
-
* Removes background of the picker if previously set. It's no use
|
|
678
|
-
* calling this method if you didn't set the background option on start
|
|
679
|
-
* or if you didn't call setBackgroundColor previously.
|
|
680
|
-
*/
|
|
681
|
-
setNoBackground() {
|
|
682
|
-
this.$el.style.padding = "0px";
|
|
683
|
-
this.$el.style.background = "none";
|
|
684
|
-
return this;
|
|
685
|
-
}
|
|
686
|
-
/**
|
|
687
|
-
* Registers callback to the update event of the picker.
|
|
688
|
-
* picker inherits from [component/emitter](https://github.com/component/emitter)
|
|
689
|
-
* so you could do the same thing by calling `colorPicker.on('update');`
|
|
690
|
-
* @param {Function} callback
|
|
691
|
-
* @return {ColorPicker} Returns itself for chaining purpose
|
|
692
|
-
*/
|
|
693
|
-
onChange(callback) {
|
|
694
|
-
if (this._callbacks.indexOf(callback) < 0) {
|
|
695
|
-
this._callbacks.push(callback);
|
|
696
|
-
callback(this.getHexString());
|
|
697
|
-
}
|
|
698
|
-
return this;
|
|
699
|
-
}
|
|
700
|
-
/**
|
|
701
|
-
* Is true when mouse is down and user is currently choosing a color.
|
|
702
|
-
*/
|
|
703
|
-
get isChoosing() {
|
|
704
|
-
return this._isChoosing;
|
|
705
|
-
}
|
|
706
|
-
/* =============================================================================
|
|
707
|
-
Color getters
|
|
708
|
-
============================================================================= */
|
|
709
|
-
/**
|
|
710
|
-
* Main color getter, will return a formatted color string depending on input
|
|
711
|
-
* or a number depending on the last setColor call.
|
|
712
|
-
* @return {Number|String}
|
|
713
|
-
*/
|
|
714
|
-
getColor() {
|
|
715
|
-
if (this._inputIsNumber)
|
|
716
|
-
return this.getHexNumber();
|
|
717
|
-
return this.getHexString();
|
|
718
|
-
}
|
|
719
|
-
/**
|
|
720
|
-
* Returns color as css hex string (ex: '#FF0000').
|
|
721
|
-
* @return {String}
|
|
722
|
-
*/
|
|
723
|
-
getHexString() {
|
|
724
|
-
return this.color.hexString.toUpperCase();
|
|
725
|
-
}
|
|
726
|
-
/**
|
|
727
|
-
* Returns color as number (ex: 0xFF0000).
|
|
728
|
-
* @return {Number}
|
|
729
|
-
*/
|
|
730
|
-
getHexNumber() {
|
|
731
|
-
return this.color.hex;
|
|
732
|
-
}
|
|
733
|
-
/**
|
|
734
|
-
* Returns color as {r: 1, g: 0, b: 0} object.
|
|
735
|
-
* @return {Object}
|
|
736
|
-
*/
|
|
737
|
-
getRGB() {
|
|
738
|
-
return this.color.rgb;
|
|
739
|
-
}
|
|
740
|
-
/**
|
|
741
|
-
* Returns color as {h: 100, s: 1, v: 1} object.
|
|
742
|
-
* @return {Object}
|
|
743
|
-
*/
|
|
744
|
-
getHSV() {
|
|
745
|
-
return this.color.hsv;
|
|
746
|
-
}
|
|
747
|
-
/**
|
|
748
|
-
* Returns true if color is perceived as dark
|
|
749
|
-
* @return {Boolean}
|
|
750
|
-
*/
|
|
751
|
-
isDark() {
|
|
752
|
-
return this.color.isDark;
|
|
753
|
-
}
|
|
754
|
-
/**
|
|
755
|
-
* Returns true if color is perceived as light
|
|
756
|
-
* @return {Boolean}
|
|
757
|
-
*/
|
|
758
|
-
isLight() {
|
|
759
|
-
return this.color.isLight;
|
|
760
|
-
}
|
|
761
|
-
/* =============================================================================
|
|
762
|
-
Private methods
|
|
763
|
-
============================================================================= */
|
|
764
|
-
_moveSelectorTo(x, y) {
|
|
765
|
-
this.position.x = clamp(x, 0, this._saturationWidth);
|
|
766
|
-
this.position.y = clamp(y, 0, this._hueHeight);
|
|
767
|
-
this.$sbSelector.style.transform = `translate(${this.position.x}px, ${this.position.y}px)`;
|
|
768
|
-
}
|
|
769
|
-
_updateColorFromPosition() {
|
|
770
|
-
this.color.fromHsv({
|
|
771
|
-
h: this.hue,
|
|
772
|
-
s: this.position.x / this._saturationWidth,
|
|
773
|
-
v: 1 - this.position.y / this._hueHeight
|
|
774
|
-
});
|
|
775
|
-
this._updateColor();
|
|
776
|
-
}
|
|
777
|
-
_moveHueTo(y) {
|
|
778
|
-
this._huePosition = clamp(y, 0, this._maxHue);
|
|
779
|
-
this.$hSelector.style.transform = `translateY(${this._huePosition}px)`;
|
|
780
|
-
}
|
|
781
|
-
_updateHueFromPosition() {
|
|
782
|
-
const hsvColor = this.getHSV();
|
|
783
|
-
this.hue = 1 - this._huePosition / this._maxHue;
|
|
784
|
-
this.color.fromHsv({
|
|
785
|
-
h: this.hue,
|
|
786
|
-
s: hsvColor.s,
|
|
787
|
-
v: hsvColor.v
|
|
788
|
-
});
|
|
789
|
-
this._updateHue();
|
|
790
|
-
}
|
|
791
|
-
_updateHue() {
|
|
792
|
-
this.hueColor.fromHsv({
|
|
793
|
-
h: this.hue,
|
|
794
|
-
s: 1,
|
|
795
|
-
v: 1
|
|
796
|
-
});
|
|
797
|
-
this.$hSelector.style.background = this.hueColor.hexString;
|
|
798
|
-
this.$saturation.style.background = `linear-gradient(to right, #fff, ${this.hueColor.hexString})`;
|
|
799
|
-
this._updateColor();
|
|
800
|
-
}
|
|
801
|
-
_updateColor() {
|
|
802
|
-
this.$sbSelector.style.background = this.getHexString();
|
|
803
|
-
this.$sbSelector.style.borderColor = this.isDark() ? "#fff" : "#000";
|
|
804
|
-
this._triggerChange();
|
|
805
|
-
}
|
|
806
|
-
_triggerChange() {
|
|
807
|
-
this._callbacks.forEach((callback) => callback(this.getHexString()));
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
402
|
const ColorInput = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
811
403
|
const props1 = qwik._restProps(props, [
|
|
812
404
|
"onInput$",
|
|
@@ -814,101 +406,12 @@ const ColorInput = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inline
|
|
|
814
406
|
"presetColors",
|
|
815
407
|
"preview"
|
|
816
408
|
]);
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
padding: 15px;
|
|
824
|
-
border-radius: 10px;
|
|
825
|
-
border: 1px solid rgb(31 41 55);
|
|
826
|
-
filter: drop-shadow(0px 0px 5px rgba(0, 0, 0, 0.5));
|
|
827
|
-
background: rgba(31 41 55 / 40%);
|
|
828
|
-
backdrop-filter: blur(10px);
|
|
829
|
-
user-select: none;
|
|
830
|
-
position: relative;
|
|
831
|
-
z-index: 1000;
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
.color-picker-saturation {
|
|
835
|
-
position: relative;
|
|
836
|
-
height: 100%;
|
|
837
|
-
width: 100%;
|
|
838
|
-
background: linear-gradient(to right, #FFFFFF, #FF0000);
|
|
839
|
-
float: left;
|
|
840
|
-
border-radius: 5px;
|
|
841
|
-
border: 1px solid rgb(31 41 55);
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
.color-picker-brightness {
|
|
845
|
-
width: 100%;
|
|
846
|
-
height: 100%;
|
|
847
|
-
background: linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 1));
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
.color-picker-sbSelector {
|
|
851
|
-
border: 1px solid white;
|
|
852
|
-
position: absolute;
|
|
853
|
-
width: 14px;
|
|
854
|
-
height: 14px;
|
|
855
|
-
background: white;
|
|
856
|
-
border-radius: 10px;
|
|
857
|
-
top: -7px;
|
|
858
|
-
left: -7px;
|
|
859
|
-
box-sizing: border-box;
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
.color-picker-hue {
|
|
863
|
-
width: 8px;
|
|
864
|
-
border-radius: 5px;
|
|
865
|
-
height: 100%;
|
|
866
|
-
position: relative;
|
|
867
|
-
float: left;
|
|
868
|
-
background: linear-gradient(rgb(255, 0, 0) 0%, rgb(255, 0, 255) 17%, rgb(0, 0, 255) 34%, rgb(0, 255, 255) 50%, rgb(0, 255, 0) 67%, rgb(255, 255, 0) 84%, rgb(255, 0, 0) 100%);
|
|
869
|
-
border: 1px solid rgb(31 41 55);
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
.color-picker-colors {
|
|
873
|
-
height: 100%;
|
|
874
|
-
position: relative;
|
|
875
|
-
display: flex;
|
|
876
|
-
flex-direction: column;
|
|
877
|
-
gap: 5px;
|
|
878
|
-
float: left;
|
|
879
|
-
justify-content: space-evenly;
|
|
880
|
-
flex-wrap: wrap;
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
.color-picker-color {
|
|
884
|
-
transition: all 0.2s;
|
|
885
|
-
height: 25px;
|
|
886
|
-
width: 25px;
|
|
887
|
-
border-radius: 5px;
|
|
888
|
-
position: relative;
|
|
889
|
-
background: red;
|
|
890
|
-
border: 1px solid rgb(31 41 55);
|
|
891
|
-
cursor: pointer;
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
.color-picker-color:hover {
|
|
895
|
-
border: 1px solid white;
|
|
896
|
-
transform: scale(1.1);
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
.color-picker-hSelector {
|
|
900
|
-
border: 1px solid white;
|
|
901
|
-
position: absolute;
|
|
902
|
-
width: 14px;
|
|
903
|
-
height: 14px;
|
|
904
|
-
background: white;
|
|
905
|
-
border-radius: 10px;
|
|
906
|
-
top: -6px;
|
|
907
|
-
left: -4px;
|
|
908
|
-
box-sizing: border-box;
|
|
909
|
-
}
|
|
910
|
-
`, "ColorInput_component_useStyles_SMNFl4Oy0IA"));
|
|
911
|
-
return /* @__PURE__ */ qwik._jsxQ("div", null, null, [
|
|
409
|
+
const store = qwik.useStore({
|
|
410
|
+
opened: false
|
|
411
|
+
});
|
|
412
|
+
return /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
413
|
+
class: "relative"
|
|
414
|
+
}, [
|
|
912
415
|
/* @__PURE__ */ qwik._jsxQ("label", {
|
|
913
416
|
for: qwik._wrapSignal(props1, "id")
|
|
914
417
|
}, {
|
|
@@ -919,66 +422,25 @@ const ColorInput = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inline
|
|
|
919
422
|
get value() {
|
|
920
423
|
return props.value ?? "#000000";
|
|
921
424
|
},
|
|
922
|
-
onBlur$: /* @__PURE__ */ qwik.inlinedQrl((
|
|
923
|
-
const [
|
|
924
|
-
|
|
925
|
-
const pickerDiv = document.getElementById(`${props12.id}-color-picker`);
|
|
926
|
-
pickerDiv.classList.add("opacity-0", "pointer-events-none", "scale-95");
|
|
425
|
+
onBlur$: /* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
426
|
+
const [store2] = qwik.useLexicalScope();
|
|
427
|
+
store2.opened = false;
|
|
927
428
|
}, "ColorInput_component_div_TextInputRaw_onBlur_giB7aSy8tnc", [
|
|
928
|
-
|
|
429
|
+
store
|
|
929
430
|
]),
|
|
930
|
-
onFocus$: /* @__PURE__ */ qwik.inlinedQrl((
|
|
931
|
-
const [
|
|
932
|
-
|
|
933
|
-
if (!pickerDiv.children.length) {
|
|
934
|
-
if (build.isServer)
|
|
935
|
-
return;
|
|
936
|
-
const picker = new ColorPicker({
|
|
937
|
-
el: pickerDiv,
|
|
938
|
-
color: props2.value ?? "#000000",
|
|
939
|
-
colors: [
|
|
940
|
-
"#FAEDCB",
|
|
941
|
-
"#C9E4DE",
|
|
942
|
-
"#C6DEF1",
|
|
943
|
-
"#DBCDF0",
|
|
944
|
-
"#F2C6DE",
|
|
945
|
-
"#FCD05C",
|
|
946
|
-
"#5FE2C5",
|
|
947
|
-
"#4498DB",
|
|
948
|
-
"#9863E7",
|
|
949
|
-
"#E43A96",
|
|
950
|
-
...props2.presetColors ?? []
|
|
951
|
-
],
|
|
952
|
-
width: 150,
|
|
953
|
-
height: 150
|
|
954
|
-
});
|
|
955
|
-
picker.onChange((color) => {
|
|
956
|
-
element.value = color;
|
|
957
|
-
switch (props2.preview ?? "left") {
|
|
958
|
-
case "full":
|
|
959
|
-
element.style.backgroundColor = color;
|
|
960
|
-
element.style.color = getBrightness(hexNumberToRgb(hexStringToNumber(color))) > 0.5 ? "black" : "white";
|
|
961
|
-
break;
|
|
962
|
-
case "left":
|
|
963
|
-
element.style.borderLeft = `40px solid ${color}`;
|
|
964
|
-
break;
|
|
965
|
-
case "right":
|
|
966
|
-
element.style.borderRight = `40px solid ${color}`;
|
|
967
|
-
break;
|
|
968
|
-
case "top":
|
|
969
|
-
element.style.borderTop = `10px solid ${color}`;
|
|
970
|
-
break;
|
|
971
|
-
case "bottom":
|
|
972
|
-
element.style.borderBottom = `10px solid ${color}`;
|
|
973
|
-
break;
|
|
974
|
-
}
|
|
975
|
-
if (props2.onInput$)
|
|
976
|
-
props2.onInput$(color, element);
|
|
977
|
-
});
|
|
978
|
-
element.addEventListener("input", () => picker.setColor(element.value));
|
|
979
|
-
}
|
|
980
|
-
pickerDiv.classList.remove("opacity-0", "pointer-events-none", "scale-95");
|
|
431
|
+
onFocus$: /* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
432
|
+
const [store2] = qwik.useLexicalScope();
|
|
433
|
+
store2.opened = true;
|
|
981
434
|
}, "ColorInput_component_div_TextInputRaw_onFocus_9bHrhSeTgfI", [
|
|
435
|
+
store
|
|
436
|
+
]),
|
|
437
|
+
onInput$: /* @__PURE__ */ qwik.inlinedQrl((e, el) => {
|
|
438
|
+
const [props12, props2] = qwik.useLexicalScope();
|
|
439
|
+
const div = document.getElementById(`${props12.id}-picker`);
|
|
440
|
+
const event = new Event("change");
|
|
441
|
+
div.dispatchEvent(event);
|
|
442
|
+
props2.onInput$?.(el.value);
|
|
443
|
+
}, "ColorInput_component_div_TextInputRaw_onInput_nsV3cUv0Sxg", [
|
|
982
444
|
props1,
|
|
983
445
|
props
|
|
984
446
|
]),
|
|
@@ -995,18 +457,312 @@ const ColorInput = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inline
|
|
|
995
457
|
borderBottom: `10px solid ${props.value ?? "#000000"}`
|
|
996
458
|
} : {},
|
|
997
459
|
[qwik._IMMUTABLE]: {
|
|
460
|
+
onBlur$: qwik._IMMUTABLE,
|
|
461
|
+
onFocus$: qwik._IMMUTABLE,
|
|
998
462
|
value: qwik._fnSignal((p0) => p0.value ?? "#000000", [
|
|
999
463
|
props
|
|
1000
464
|
], 'p0.value??"#000000"')
|
|
1001
465
|
}
|
|
1002
466
|
}, 0, "0s_1"),
|
|
1003
|
-
/* @__PURE__ */ qwik.
|
|
1004
|
-
id
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
467
|
+
/* @__PURE__ */ qwik._jsxC(ColorPickerRaw, {
|
|
468
|
+
get id() {
|
|
469
|
+
return props1.id;
|
|
470
|
+
},
|
|
471
|
+
get color() {
|
|
472
|
+
return props.value ?? "#000000";
|
|
473
|
+
},
|
|
474
|
+
get colors() {
|
|
475
|
+
return [
|
|
476
|
+
"#FAEDCB",
|
|
477
|
+
"#C9E4DE",
|
|
478
|
+
"#C6DEF1",
|
|
479
|
+
"#DBCDF0",
|
|
480
|
+
"#F2C6DE",
|
|
481
|
+
"#FCD05C",
|
|
482
|
+
"#5FE2C5",
|
|
483
|
+
"#4498DB",
|
|
484
|
+
"#9863E7",
|
|
485
|
+
"#E43A96",
|
|
486
|
+
...props.presetColors ?? []
|
|
487
|
+
];
|
|
488
|
+
},
|
|
489
|
+
get class() {
|
|
490
|
+
return {
|
|
491
|
+
"transition-all absolute top-full mt-2 left-0 gap-1 z-[1000]": true,
|
|
492
|
+
"opacity-0 pointer-events-none scale-95": !store.opened
|
|
493
|
+
};
|
|
494
|
+
},
|
|
495
|
+
onInput$: /* @__PURE__ */ qwik.inlinedQrl((color) => {
|
|
496
|
+
const [props12, props2] = qwik.useLexicalScope();
|
|
497
|
+
const el = document.getElementById(props12.id);
|
|
498
|
+
el.value = color;
|
|
499
|
+
switch (props2.preview ?? "left") {
|
|
500
|
+
case "full":
|
|
501
|
+
el.style.backgroundColor = color;
|
|
502
|
+
el.style.color = getBrightness(hexNumberToRgb(hexStringToNumber(color))) > 0.5 ? "black" : "white";
|
|
503
|
+
break;
|
|
504
|
+
case "left":
|
|
505
|
+
el.style.borderLeft = `40px solid ${color}`;
|
|
506
|
+
break;
|
|
507
|
+
case "right":
|
|
508
|
+
el.style.borderRight = `40px solid ${color}`;
|
|
509
|
+
break;
|
|
510
|
+
case "top":
|
|
511
|
+
el.style.borderTop = `10px solid ${color}`;
|
|
512
|
+
break;
|
|
513
|
+
case "bottom":
|
|
514
|
+
el.style.borderBottom = `10px solid ${color}`;
|
|
515
|
+
break;
|
|
516
|
+
}
|
|
517
|
+
props2.onInput$?.(color);
|
|
518
|
+
}, "ColorInput_component_div_ColorPickerRaw_onInput_wTO4B2czR7s", [
|
|
519
|
+
props1,
|
|
520
|
+
props
|
|
521
|
+
]),
|
|
522
|
+
[qwik._IMMUTABLE]: {
|
|
523
|
+
class: qwik._fnSignal((p0) => ({
|
|
524
|
+
"transition-all absolute top-full mt-2 left-0 gap-1 z-[1000]": true,
|
|
525
|
+
"opacity-0 pointer-events-none scale-95": !p0.opened
|
|
526
|
+
}), [
|
|
527
|
+
store
|
|
528
|
+
], '{"transition-all absolute top-full mt-2 left-0 gap-1 z-[1000]":true,"opacity-0 pointer-events-none scale-95":!p0.opened}'),
|
|
529
|
+
color: qwik._fnSignal((p0) => p0.value ?? "#000000", [
|
|
530
|
+
props
|
|
531
|
+
], 'p0.value??"#000000"'),
|
|
532
|
+
colors: qwik._fnSignal((p0) => [
|
|
533
|
+
"#FAEDCB",
|
|
534
|
+
"#C9E4DE",
|
|
535
|
+
"#C6DEF1",
|
|
536
|
+
"#DBCDF0",
|
|
537
|
+
"#F2C6DE",
|
|
538
|
+
"#FCD05C",
|
|
539
|
+
"#5FE2C5",
|
|
540
|
+
"#4498DB",
|
|
541
|
+
"#9863E7",
|
|
542
|
+
"#E43A96",
|
|
543
|
+
...p0.presetColors ?? []
|
|
544
|
+
], [
|
|
545
|
+
props
|
|
546
|
+
], '["#FAEDCB","#C9E4DE","#C6DEF1","#DBCDF0","#F2C6DE","#FCD05C","#5FE2C5","#4498DB","#9863E7","#E43A96",...p0.presetColors??[]]'),
|
|
547
|
+
id: qwik._wrapProp(props1, "id")
|
|
548
|
+
}
|
|
549
|
+
}, 3, "0s_2")
|
|
550
|
+
], 1, "0s_3");
|
|
1009
551
|
}, "ColorInput_component_jilGo0Bn3Ps"));
|
|
552
|
+
const ColorPickerRaw = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
553
|
+
const props1 = qwik._restProps(props, [
|
|
554
|
+
"id",
|
|
555
|
+
"color",
|
|
556
|
+
"colors",
|
|
557
|
+
"onInput$"
|
|
558
|
+
]);
|
|
559
|
+
const width = 125;
|
|
560
|
+
const maxHue = 148;
|
|
561
|
+
const hsvColor = rgbToHsv(hexNumberToRgb(hexStringToNumber(props.color)));
|
|
562
|
+
const store = qwik.useStore({
|
|
563
|
+
hue: {
|
|
564
|
+
position: hsvColor.h * maxHue,
|
|
565
|
+
color: rgbToHex(hsvToRgb({
|
|
566
|
+
h: hsvColor.h,
|
|
567
|
+
s: 1,
|
|
568
|
+
v: 1
|
|
569
|
+
}))
|
|
570
|
+
},
|
|
571
|
+
bPosition: (1 - hsvColor.v) * maxHue,
|
|
572
|
+
sPosition: hsvColor.s * width,
|
|
573
|
+
color: props.color
|
|
574
|
+
});
|
|
575
|
+
const setColor = /* @__PURE__ */ qwik.inlinedQrl((color) => {
|
|
576
|
+
const [maxHue2, props2, store2, width2] = qwik.useLexicalScope();
|
|
577
|
+
store2.color = color;
|
|
578
|
+
const hsv = rgbToHsv(hexNumberToRgb(hexStringToNumber(color)));
|
|
579
|
+
store2.hue.position = hsv.h * maxHue2;
|
|
580
|
+
store2.hue.color = rgbToHex(hsvToRgb({
|
|
581
|
+
h: hsv.h,
|
|
582
|
+
s: 1,
|
|
583
|
+
v: 1
|
|
584
|
+
}));
|
|
585
|
+
store2.sPosition = hsv.s * width2;
|
|
586
|
+
store2.bPosition = (1 - hsv.v) * maxHue2;
|
|
587
|
+
props2.onInput$?.(color);
|
|
588
|
+
}, "ColorPickerRaw_component_setColor_KSE5T0GnULs", [
|
|
589
|
+
maxHue,
|
|
590
|
+
props,
|
|
591
|
+
store,
|
|
592
|
+
width
|
|
593
|
+
]);
|
|
594
|
+
const hueChange = /* @__PURE__ */ qwik.inlinedQrl((e, hOffset) => {
|
|
595
|
+
const [maxHue2, props2, store2] = qwik.useLexicalScope();
|
|
596
|
+
const { y } = getMousePosition(e);
|
|
597
|
+
store2.hue.position = clamp(maxHue2 - (y - hOffset), 0, maxHue2);
|
|
598
|
+
const hsvColor2 = rgbToHsv(hexNumberToRgb(hexStringToNumber(store2.color)));
|
|
599
|
+
const h = store2.hue.position / maxHue2;
|
|
600
|
+
hsvColor2.h = h;
|
|
601
|
+
store2.hue.color = rgbToHex(hsvToRgb({
|
|
602
|
+
h,
|
|
603
|
+
s: 1,
|
|
604
|
+
v: 1
|
|
605
|
+
}));
|
|
606
|
+
store2.color = rgbToHex(hsvToRgb(hsvColor2));
|
|
607
|
+
props2.onInput$?.(store2.color);
|
|
608
|
+
}, "ColorPickerRaw_component_hueChange_za4ruRb84uA", [
|
|
609
|
+
maxHue,
|
|
610
|
+
props,
|
|
611
|
+
store
|
|
612
|
+
]);
|
|
613
|
+
const hueMouseDown = /* @__PURE__ */ qwik.inlinedQrl((e, el) => {
|
|
614
|
+
const [hueChange2] = qwik.useLexicalScope();
|
|
615
|
+
const hOffset = el.getBoundingClientRect().top;
|
|
616
|
+
hueChange2(e, hOffset);
|
|
617
|
+
const eventListener = (e2) => hueChange2(e2, hOffset);
|
|
618
|
+
window.addEventListener("mousemove", eventListener);
|
|
619
|
+
window.addEventListener("touchmove", eventListener);
|
|
620
|
+
const mouseUpListener = () => {
|
|
621
|
+
window.removeEventListener("mousemove", eventListener);
|
|
622
|
+
window.removeEventListener("touchmove", eventListener);
|
|
623
|
+
window.removeEventListener("mouseup", mouseUpListener);
|
|
624
|
+
window.removeEventListener("touchend", mouseUpListener);
|
|
625
|
+
};
|
|
626
|
+
window.addEventListener("mouseup", mouseUpListener);
|
|
627
|
+
window.addEventListener("touchend", mouseUpListener);
|
|
628
|
+
}, "ColorPickerRaw_component_hueMouseDown_IbHBnI0jzpg", [
|
|
629
|
+
hueChange
|
|
630
|
+
]);
|
|
631
|
+
const sbChange = /* @__PURE__ */ qwik.inlinedQrl((e, hOffset) => {
|
|
632
|
+
const [maxHue2, props2, store2, width2] = qwik.useLexicalScope();
|
|
633
|
+
const { x, y } = getMousePosition(e);
|
|
634
|
+
store2.bPosition = clamp(y - hOffset.top, 0, maxHue2);
|
|
635
|
+
store2.sPosition = clamp(x - hOffset.left, 0, width2);
|
|
636
|
+
const s = store2.sPosition / width2;
|
|
637
|
+
const v = 1 - store2.bPosition / maxHue2;
|
|
638
|
+
store2.color = rgbToHex(hsvToRgb({
|
|
639
|
+
h: store2.hue.position / maxHue2,
|
|
640
|
+
s,
|
|
641
|
+
v
|
|
642
|
+
}));
|
|
643
|
+
props2.onInput$?.(store2.color);
|
|
644
|
+
}, "ColorPickerRaw_component_sbChange_yhwlg2HYP8Y", [
|
|
645
|
+
maxHue,
|
|
646
|
+
props,
|
|
647
|
+
store,
|
|
648
|
+
width
|
|
649
|
+
]);
|
|
650
|
+
const sbMouseDown = /* @__PURE__ */ qwik.inlinedQrl((e, el) => {
|
|
651
|
+
const [sbChange2] = qwik.useLexicalScope();
|
|
652
|
+
const offset = el.getBoundingClientRect();
|
|
653
|
+
sbChange2(e, offset);
|
|
654
|
+
const eventListener = (e2) => sbChange2(e2, offset);
|
|
655
|
+
window.addEventListener("mousemove", eventListener);
|
|
656
|
+
window.addEventListener("touchmove", eventListener);
|
|
657
|
+
const mouseUpListener = () => {
|
|
658
|
+
window.removeEventListener("mousemove", eventListener);
|
|
659
|
+
window.removeEventListener("touchmove", eventListener);
|
|
660
|
+
window.removeEventListener("mouseup", mouseUpListener);
|
|
661
|
+
window.removeEventListener("touchend", mouseUpListener);
|
|
662
|
+
};
|
|
663
|
+
window.addEventListener("mouseup", mouseUpListener);
|
|
664
|
+
window.addEventListener("touchend", mouseUpListener);
|
|
665
|
+
}, "ColorPickerRaw_component_sbMouseDown_hRgkP7lymfY", [
|
|
666
|
+
sbChange
|
|
667
|
+
]);
|
|
668
|
+
qwik.useOn("change", /* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
669
|
+
const [props2, setColor2] = qwik.useLexicalScope();
|
|
670
|
+
if (!props2.id)
|
|
671
|
+
return;
|
|
672
|
+
const inputElement = document.getElementById(props2.id);
|
|
673
|
+
if (!inputElement)
|
|
674
|
+
return;
|
|
675
|
+
setColor2(inputElement.value);
|
|
676
|
+
}, "ColorPickerRaw_component_useOn_hsh00WCnzOE", [
|
|
677
|
+
props,
|
|
678
|
+
setColor
|
|
679
|
+
]));
|
|
680
|
+
return /* @__PURE__ */ qwik._jsxQ("div", {
|
|
681
|
+
class: {
|
|
682
|
+
"transition-all p-4 bg-gray-800/50 backdrop-blur-xl flex flex-col gap-6 rounded-lg border border-gray-700 touch-none": true,
|
|
683
|
+
...props1.class
|
|
684
|
+
}
|
|
685
|
+
}, {
|
|
686
|
+
id: qwik._fnSignal((p0) => p0.id ? `${p0.id}-picker` : void 0, [
|
|
687
|
+
props
|
|
688
|
+
], "p0.id?`${p0.id}-picker`:undefined"),
|
|
689
|
+
"preventdefault:mousedown": true,
|
|
690
|
+
"preventdefault:touchstart": true
|
|
691
|
+
}, [
|
|
692
|
+
/* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
693
|
+
class: "flex gap-4"
|
|
694
|
+
}, [
|
|
695
|
+
/* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
696
|
+
class: "w-[125px] h-[150px] border border-gray-700 rounded-md relative",
|
|
697
|
+
onMouseDown$: sbMouseDown,
|
|
698
|
+
onTouchStart$: sbMouseDown,
|
|
699
|
+
"preventdefault:mousedown": true,
|
|
700
|
+
"preventdefault:touchstart": true,
|
|
701
|
+
style: qwik._fnSignal((p0) => ({
|
|
702
|
+
background: `linear-gradient(to right, #FFFFFF, ${p0.hue.color})`
|
|
703
|
+
}), [
|
|
704
|
+
store
|
|
705
|
+
], "{background:`linear-gradient(to right, #FFFFFF, ${p0.hue.color})`}")
|
|
706
|
+
}, [
|
|
707
|
+
/* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
708
|
+
class: "w-[125px] h-[150px] border border-gray-700 rounded-md bg-gradient-to-b from-transparent to-black"
|
|
709
|
+
}, null, 3, null),
|
|
710
|
+
/* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
711
|
+
class: "absolute -top-2 -left-2 w-4 h-4 border border-white rounded-full bg-white",
|
|
712
|
+
style: qwik._fnSignal((p0) => ({
|
|
713
|
+
background: p0.color,
|
|
714
|
+
transform: `translate(${p0.sPosition}px, ${p0.bPosition}px)`
|
|
715
|
+
}), [
|
|
716
|
+
store
|
|
717
|
+
], "{background:p0.color,transform:`translate(${p0.sPosition}px, ${p0.bPosition}px)`}")
|
|
718
|
+
}, null, 3, null)
|
|
719
|
+
], 3, null),
|
|
720
|
+
/* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
721
|
+
class: "h-[150px] relative w-2 border border-gray-700 rounded-md",
|
|
722
|
+
onMouseDown$: hueMouseDown,
|
|
723
|
+
onTouchStart$: hueMouseDown,
|
|
724
|
+
"preventdefault:mousedown": true,
|
|
725
|
+
"preventdefault:touchstart": true,
|
|
726
|
+
style: {
|
|
727
|
+
background: "linear-gradient(to bottom, #ff0000, #ff00ff, #0000ff, #00ffff, #00ff00, #ffff00, #ff0000)"
|
|
728
|
+
}
|
|
729
|
+
}, /* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
730
|
+
class: "absolute -bottom-2 -left-[5px] w-4 h-4 border border-white rounded-full bg-[#ff0000]",
|
|
731
|
+
style: qwik._fnSignal((p0) => ({
|
|
732
|
+
transform: `translateY(${-p0.hue.position}px)`,
|
|
733
|
+
background: p0.hue.color
|
|
734
|
+
}), [
|
|
735
|
+
store
|
|
736
|
+
], "{transform:`translateY(${-p0.hue.position}px)`,background:p0.hue.color}")
|
|
737
|
+
}, null, 3, null), 3, null)
|
|
738
|
+
], 3, null),
|
|
739
|
+
/* @__PURE__ */ qwik._jsxQ("div", null, {
|
|
740
|
+
class: "w-[150px] flex flex-wrap gap-1 justify-evenly"
|
|
741
|
+
}, props.colors.map((color, i) => {
|
|
742
|
+
return /* @__PURE__ */ qwik._jsxQ("button", {
|
|
743
|
+
onMouseDown$: /* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
744
|
+
const [color2, setColor2] = qwik.useLexicalScope();
|
|
745
|
+
setColor2(color2);
|
|
746
|
+
}, "ColorPickerRaw_component_div_div_button_onMouseDown_C5tqQYvx7wA", [
|
|
747
|
+
color,
|
|
748
|
+
setColor
|
|
749
|
+
]),
|
|
750
|
+
onTouchStart$: /* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
751
|
+
const [color2, setColor2] = qwik.useLexicalScope();
|
|
752
|
+
setColor2(color2);
|
|
753
|
+
}, "ColorPickerRaw_component_div_div_button_onTouchStart_qgiiO8Blb88", [
|
|
754
|
+
color,
|
|
755
|
+
setColor
|
|
756
|
+
]),
|
|
757
|
+
style: `background: ${color}`
|
|
758
|
+
}, {
|
|
759
|
+
class: "w-[25px] h-[25px] border border-gray-700 rounded-md hover:scale-110 transition-all",
|
|
760
|
+
"preventdefault:mousedown": true,
|
|
761
|
+
"preventdefault:touchstart": true
|
|
762
|
+
}, null, 2, i);
|
|
763
|
+
}), 1, null)
|
|
764
|
+
], 1, "0s_4");
|
|
765
|
+
}, "ColorPickerRaw_component_CWQPPcezhyA"));
|
|
1010
766
|
const LoadingIcon = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
1011
767
|
const props1 = qwik._restProps(props, [
|
|
1012
768
|
"width",
|
|
@@ -1971,6 +1727,7 @@ exports.Button = Button;
|
|
|
1971
1727
|
exports.ButtonAnchor = ButtonAnchor;
|
|
1972
1728
|
exports.Card = Card;
|
|
1973
1729
|
exports.ColorInput = ColorInput;
|
|
1730
|
+
exports.ColorPickerRaw = ColorPickerRaw;
|
|
1974
1731
|
exports.Header = Header;
|
|
1975
1732
|
exports.InputClasses = InputClasses;
|
|
1976
1733
|
exports.LoadingIcon = LoadingIcon;
|