@luminescent/ui-qwik 1.4.5-0 → 1.4.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.
package/lib/index.qwik.cjs
CHANGED
|
@@ -356,7 +356,7 @@ const ColorPicker = qwik.component$(({ id, value = "#000000", colors = [
|
|
|
356
356
|
sPosition: hsvColor.s * width,
|
|
357
357
|
value
|
|
358
358
|
});
|
|
359
|
-
const setColor = qwik.$((color) => {
|
|
359
|
+
const setColor = qwik.$(async (color) => {
|
|
360
360
|
if (!color.match(/^#[0-9A-F]{6}$/i)) return;
|
|
361
361
|
const number = hexStringToNumber(color);
|
|
362
362
|
const hsv = rgbToHsv(hexNumberToRgb(number));
|
|
@@ -369,9 +369,9 @@ const ColorPicker = qwik.component$(({ id, value = "#000000", colors = [
|
|
|
369
369
|
store.sPosition = hsv.s * width;
|
|
370
370
|
store.bPosition = (1 - hsv.v) * maxHue;
|
|
371
371
|
store.value = color;
|
|
372
|
-
onInput$?.(store.value);
|
|
372
|
+
await onInput$?.(store.value);
|
|
373
373
|
});
|
|
374
|
-
const hueChange = qwik.$((e, hOffset) => {
|
|
374
|
+
const hueChange = qwik.$(async (e, hOffset) => {
|
|
375
375
|
const { y } = getMousePosition(e);
|
|
376
376
|
store.hue.position = clamp(maxHue - (y - hOffset), 0, maxHue);
|
|
377
377
|
const hsvColor2 = rgbToHsv(hexNumberToRgb(hexStringToNumber(store.value)));
|
|
@@ -383,12 +383,12 @@ const ColorPicker = qwik.component$(({ id, value = "#000000", colors = [
|
|
|
383
383
|
v: 1
|
|
384
384
|
}));
|
|
385
385
|
store.value = rgbToHex(hsvToRgb(hsvColor2));
|
|
386
|
-
onInput$?.(store.value);
|
|
386
|
+
await onInput$?.(store.value);
|
|
387
387
|
});
|
|
388
|
-
const hueMouseDown = qwik.$((e, el) => {
|
|
388
|
+
const hueMouseDown = qwik.$(async (e, el) => {
|
|
389
389
|
const hOffset = el.getBoundingClientRect().top;
|
|
390
|
-
hueChange(e, hOffset);
|
|
391
|
-
const eventListener = (e2) => hueChange(e2, hOffset);
|
|
390
|
+
await hueChange(e, hOffset);
|
|
391
|
+
const eventListener = (e2) => void hueChange(e2, hOffset);
|
|
392
392
|
window.addEventListener("mousemove", eventListener);
|
|
393
393
|
window.addEventListener("touchmove", eventListener);
|
|
394
394
|
const mouseUpListener = () => {
|
|
@@ -400,7 +400,7 @@ const ColorPicker = qwik.component$(({ id, value = "#000000", colors = [
|
|
|
400
400
|
window.addEventListener("mouseup", mouseUpListener);
|
|
401
401
|
window.addEventListener("touchend", mouseUpListener);
|
|
402
402
|
});
|
|
403
|
-
const sbChange = qwik.$((e, hOffset) => {
|
|
403
|
+
const sbChange = qwik.$(async (e, hOffset) => {
|
|
404
404
|
const { x, y } = getMousePosition(e);
|
|
405
405
|
store.bPosition = clamp(y - hOffset.top, 0, maxHue);
|
|
406
406
|
store.sPosition = clamp(x - hOffset.left, 0, width);
|
|
@@ -411,12 +411,12 @@ const ColorPicker = qwik.component$(({ id, value = "#000000", colors = [
|
|
|
411
411
|
s,
|
|
412
412
|
v
|
|
413
413
|
}));
|
|
414
|
-
onInput$?.(store.value);
|
|
414
|
+
await onInput$?.(store.value);
|
|
415
415
|
});
|
|
416
|
-
const sbMouseDown = qwik.$((e, el) => {
|
|
416
|
+
const sbMouseDown = qwik.$(async (e, el) => {
|
|
417
417
|
const offset = el.getBoundingClientRect();
|
|
418
|
-
sbChange(e, offset);
|
|
419
|
-
const eventListener = (e2) => sbChange(e2, offset);
|
|
418
|
+
await sbChange(e, offset);
|
|
419
|
+
const eventListener = (e2) => void sbChange(e2, offset);
|
|
420
420
|
window.addEventListener("mousemove", eventListener);
|
|
421
421
|
window.addEventListener("touchmove", eventListener);
|
|
422
422
|
const mouseUpListener = () => {
|
|
@@ -436,9 +436,9 @@ const ColorPicker = qwik.component$(({ id, value = "#000000", colors = [
|
|
|
436
436
|
...props.class
|
|
437
437
|
},
|
|
438
438
|
id,
|
|
439
|
-
onInput$: (e, el) => {
|
|
439
|
+
onInput$: async (e, el) => {
|
|
440
440
|
if (!el.dataset.value) return;
|
|
441
|
-
setColor(el.dataset.value);
|
|
441
|
+
await setColor(el.dataset.value);
|
|
442
442
|
},
|
|
443
443
|
children: [
|
|
444
444
|
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
@@ -515,7 +515,7 @@ const ColorPicker = qwik.component$(({ id, value = "#000000", colors = [
|
|
|
515
515
|
}),
|
|
516
516
|
/* @__PURE__ */ jsxRuntime.jsx("input", {
|
|
517
517
|
class: {
|
|
518
|
-
"w-full lum-input
|
|
518
|
+
"w-full lum-input p-1 text-xs": true,
|
|
519
519
|
"border-t-0 rounded-t-none": preview == "top",
|
|
520
520
|
"border-b-0 rounded-b-none": preview == "bottom"
|
|
521
521
|
},
|
|
@@ -524,8 +524,8 @@ const ColorPicker = qwik.component$(({ id, value = "#000000", colors = [
|
|
|
524
524
|
backgroundColor: `${store.value}`,
|
|
525
525
|
color: getBrightness(hexNumberToRgb(hexStringToNumber(store.value))) > 0.5 ? "black" : "white"
|
|
526
526
|
} : {},
|
|
527
|
-
onInput$: (e, el) => {
|
|
528
|
-
setColor(el.value);
|
|
527
|
+
onInput$: async (e, el) => {
|
|
528
|
+
await setColor(el.value);
|
|
529
529
|
}
|
|
530
530
|
})
|
|
531
531
|
]
|
|
@@ -533,22 +533,22 @@ const ColorPicker = qwik.component$(({ id, value = "#000000", colors = [
|
|
|
533
533
|
colors.map((color, i) => {
|
|
534
534
|
return /* @__PURE__ */ jsxRuntime.jsx("button", {
|
|
535
535
|
class: {
|
|
536
|
-
"w-[1.6rem] h-[1.6rem]
|
|
536
|
+
"w-[1.6rem] h-[1.6rem] lum-btn p-0 border-white/30 border-2 hover:border-white": true
|
|
537
537
|
},
|
|
538
538
|
style: {
|
|
539
539
|
background: color,
|
|
540
|
-
|
|
540
|
+
borderColor: color === store.value ? "#ffffff" : void 0
|
|
541
541
|
},
|
|
542
|
-
onClick$: () => {
|
|
543
|
-
setColor(color);
|
|
542
|
+
onClick$: async () => {
|
|
543
|
+
await setColor(color);
|
|
544
544
|
}
|
|
545
545
|
}, i);
|
|
546
546
|
}),
|
|
547
547
|
/* @__PURE__ */ jsxRuntime.jsx("button", {
|
|
548
|
-
class: "w-[1.6rem] h-[1.6rem]
|
|
549
|
-
onClick$: () => {
|
|
548
|
+
class: "w-[1.6rem] h-[1.6rem] lum-btn p-0.5",
|
|
549
|
+
onClick$: async () => {
|
|
550
550
|
const color = `#${Math.floor(Math.random() * 16777215).toString(16)}`;
|
|
551
|
-
setColor(color);
|
|
551
|
+
await setColor(color);
|
|
552
552
|
},
|
|
553
553
|
children: /* @__PURE__ */ jsxRuntime.jsx(Shuffle, {
|
|
554
554
|
class: "fill-current text-gray-300 pl-0.5 p-0.5"
|
|
@@ -616,7 +616,7 @@ const DropdownRaw = qwik.component$(({ id, values, class: Class, display, hover,
|
|
|
616
616
|
}),
|
|
617
617
|
/* @__PURE__ */ jsxRuntime.jsxs("button", {
|
|
618
618
|
class: {
|
|
619
|
-
"lum-btn
|
|
619
|
+
"lum-btn": true,
|
|
620
620
|
...Class
|
|
621
621
|
},
|
|
622
622
|
onClick$: () => {
|
|
@@ -634,7 +634,8 @@ const DropdownRaw = qwik.component$(({ id, values, class: Class, display, hover,
|
|
|
634
634
|
class: {
|
|
635
635
|
"motion-safe:transition-all ease-out": true,
|
|
636
636
|
"transform rotate-180": store.opened,
|
|
637
|
-
"group-hover:transform group-hover:rotate-180 duration-300 group-hover:duration-75": hover
|
|
637
|
+
"group-hover:transform group-hover:rotate-180 duration-300 group-hover:duration-75": hover,
|
|
638
|
+
"focus-within:transform focus-within:rotate-180 focus-within:duration-75": true
|
|
638
639
|
}
|
|
639
640
|
})
|
|
640
641
|
]
|
|
@@ -643,7 +644,8 @@ const DropdownRaw = qwik.component$(({ id, values, class: Class, display, hover,
|
|
|
643
644
|
class: {
|
|
644
645
|
"transition-all ease-out absolute top-full pt-2 left-0 z-[1000] ": true,
|
|
645
646
|
"opacity-0 scale-95 pointer-events-none": !store.opened,
|
|
646
|
-
"group-hover:pointer-events-auto group-hover:opacity-100 group-hover:scale-100 duration-300 group-hover:duration-75": hover
|
|
647
|
+
"group-hover:pointer-events-auto group-hover:opacity-100 group-hover:scale-100 duration-300 group-hover:duration-75": hover,
|
|
648
|
+
"focus-within:pointer-events-auto focus-within:opacity-100 focus-within:scale-100 focus-within:duration-75": true
|
|
647
649
|
},
|
|
648
650
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
649
651
|
id: `lui-${id}-opts`,
|
|
@@ -654,7 +656,7 @@ const DropdownRaw = qwik.component$(({ id, values, class: Class, display, hover,
|
|
|
654
656
|
values?.map(({ name, value }, i) => {
|
|
655
657
|
return /* @__PURE__ */ jsxRuntime.jsx("button", {
|
|
656
658
|
class: {
|
|
657
|
-
"lum-btn lum-
|
|
659
|
+
"lum-btn lum-bg-transparent": true
|
|
658
660
|
},
|
|
659
661
|
onClick$: () => {
|
|
660
662
|
store.opened = false;
|
|
@@ -693,45 +695,28 @@ const Link = qwik.component$((props) => {
|
|
|
693
695
|
})
|
|
694
696
|
});
|
|
695
697
|
});
|
|
696
|
-
const Header = qwik.component$(({ id, anchor,
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
698
|
+
const Header = qwik.component$(({ id, anchor, ...props }) => /* @__PURE__ */ jsxRuntime.jsxs("h2", {
|
|
699
|
+
class: {
|
|
700
|
+
"flex gap-2 group items-center font-bold text-xl sm:text-2xl whitespace-nowrap text-white": true,
|
|
701
|
+
...props.class
|
|
702
|
+
},
|
|
703
|
+
children: [
|
|
704
|
+
/* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {}),
|
|
705
|
+
id && /* @__PURE__ */ jsxRuntime.jsx(Anchor, {
|
|
706
|
+
id
|
|
707
|
+
}),
|
|
708
|
+
anchor && id && /* @__PURE__ */ jsxRuntime.jsx("a", {
|
|
709
|
+
href: `#${id}`,
|
|
710
|
+
onClick$: async () => {
|
|
711
|
+
await navigator.clipboard.writeText(window.location.href);
|
|
702
712
|
},
|
|
703
|
-
children:
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
}),
|
|
708
|
-
anchor && id && /* @__PURE__ */ jsxRuntime.jsx("a", {
|
|
709
|
-
href: `#${id}`,
|
|
710
|
-
onClick$: () => {
|
|
711
|
-
navigator.clipboard.writeText(window.location.href);
|
|
712
|
-
},
|
|
713
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Link, {
|
|
714
|
-
class: "transition-all opacity-10 group-hover:opacity-100 duration-300 group-hover:duration-75",
|
|
715
|
-
width: 24
|
|
716
|
-
})
|
|
717
|
-
})
|
|
718
|
-
]
|
|
713
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Link, {
|
|
714
|
+
class: "transition-all opacity-10 group-hover:opacity-100 duration-300 group-hover:duration-75",
|
|
715
|
+
width: 24
|
|
716
|
+
})
|
|
719
717
|
})
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
Component = /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
723
|
-
class: "flex flex-col gap-1",
|
|
724
|
-
children: [
|
|
725
|
-
Component,
|
|
726
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", {
|
|
727
|
-
class: "flex items-center text-gray-400 text-sm",
|
|
728
|
-
children: subheader
|
|
729
|
-
})
|
|
730
|
-
]
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
return Component;
|
|
734
|
-
});
|
|
718
|
+
]
|
|
719
|
+
}));
|
|
735
720
|
const Nav = qwik.component$(({ fixed, floating, nohamburger, colorClass = "lum-bg-gray-900", ...props }) => {
|
|
736
721
|
const menu = qwik.useSignal(false);
|
|
737
722
|
return /* @__PURE__ */ jsxRuntime.jsxs("nav", {
|
|
@@ -797,7 +782,7 @@ const Nav = qwik.component$(({ fixed, floating, nohamburger, colorClass = "lum-b
|
|
|
797
782
|
name: "end"
|
|
798
783
|
}),
|
|
799
784
|
!nohamburger && /* @__PURE__ */ jsxRuntime.jsx("button", {
|
|
800
|
-
class: "lum-btn
|
|
785
|
+
class: "lum-btn p-2 lum-bg-transparent sm:hidden",
|
|
801
786
|
onClick$: () => menu.value = !menu.value,
|
|
802
787
|
children: /* @__PURE__ */ jsxRuntime.jsx("svg", {
|
|
803
788
|
class: "w-6 h-6",
|
|
@@ -887,15 +872,15 @@ const NumberInputRaw = qwik.component$(({ input, onDecrement$, onIncrement$, val
|
|
|
887
872
|
children: [
|
|
888
873
|
/* @__PURE__ */ jsxRuntime.jsx("button", {
|
|
889
874
|
class: {
|
|
890
|
-
"lum-btn
|
|
875
|
+
"lum-btn p-2": true
|
|
891
876
|
},
|
|
892
877
|
"data-action": "decrement",
|
|
893
878
|
"aria-label": "Decrement",
|
|
894
879
|
disabled: props.min ? value <= props.min : false,
|
|
895
|
-
onClick$: input ? qwik.$((event, element) => {
|
|
880
|
+
onClick$: input ? qwik.$(async (event, element) => {
|
|
896
881
|
const siblingInput = element.nextElementSibling;
|
|
897
882
|
siblingInput.stepDown();
|
|
898
|
-
onDecrement$(event, element, siblingInput);
|
|
883
|
+
await onDecrement$(event, element, siblingInput);
|
|
899
884
|
}) : onDecrement$,
|
|
900
885
|
children: /* @__PURE__ */ jsxRuntime.jsx(Minus, {
|
|
901
886
|
width: "24",
|
|
@@ -908,22 +893,21 @@ const NumberInputRaw = qwik.component$(({ input, onDecrement$, onIncrement$, val
|
|
|
908
893
|
value,
|
|
909
894
|
step,
|
|
910
895
|
class: {
|
|
911
|
-
"lum-input text-
|
|
912
|
-
"text-center": true,
|
|
896
|
+
"lum-input text-center": true,
|
|
913
897
|
...props.class
|
|
914
898
|
}
|
|
915
899
|
}),
|
|
916
900
|
/* @__PURE__ */ jsxRuntime.jsx("button", {
|
|
917
901
|
class: {
|
|
918
|
-
"lum-btn
|
|
902
|
+
"lum-btn p-2": true
|
|
919
903
|
},
|
|
920
904
|
"data-action": "increment",
|
|
921
905
|
"aria-label": "Increment",
|
|
922
906
|
disabled: props.max ? value >= props.max : false,
|
|
923
|
-
onClick$: input ? qwik.$((event, element) => {
|
|
907
|
+
onClick$: input ? qwik.$(async (event, element) => {
|
|
924
908
|
const siblingInput = element.previousElementSibling;
|
|
925
909
|
siblingInput.stepUp();
|
|
926
|
-
onIncrement$(event, element, siblingInput);
|
|
910
|
+
await onIncrement$(event, element, siblingInput);
|
|
927
911
|
}) : onIncrement$,
|
|
928
912
|
children: /* @__PURE__ */ jsxRuntime.jsx(Plus, {
|
|
929
913
|
width: "24",
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx, jsxs
|
|
1
|
+
import { jsx, jsxs } from "@builder.io/qwik/jsx-runtime";
|
|
2
2
|
import { component$, useStore, $, Slot, useSignal, useStyles$ } from "@builder.io/qwik";
|
|
3
3
|
const Anchor = component$(({ id }) => /* @__PURE__ */ jsx("span", {
|
|
4
4
|
id,
|
|
@@ -354,7 +354,7 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
354
354
|
sPosition: hsvColor.s * width,
|
|
355
355
|
value
|
|
356
356
|
});
|
|
357
|
-
const setColor = $((color) => {
|
|
357
|
+
const setColor = $(async (color) => {
|
|
358
358
|
if (!color.match(/^#[0-9A-F]{6}$/i)) return;
|
|
359
359
|
const number = hexStringToNumber(color);
|
|
360
360
|
const hsv = rgbToHsv(hexNumberToRgb(number));
|
|
@@ -367,9 +367,9 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
367
367
|
store.sPosition = hsv.s * width;
|
|
368
368
|
store.bPosition = (1 - hsv.v) * maxHue;
|
|
369
369
|
store.value = color;
|
|
370
|
-
onInput$?.(store.value);
|
|
370
|
+
await onInput$?.(store.value);
|
|
371
371
|
});
|
|
372
|
-
const hueChange = $((e, hOffset) => {
|
|
372
|
+
const hueChange = $(async (e, hOffset) => {
|
|
373
373
|
const { y } = getMousePosition(e);
|
|
374
374
|
store.hue.position = clamp(maxHue - (y - hOffset), 0, maxHue);
|
|
375
375
|
const hsvColor2 = rgbToHsv(hexNumberToRgb(hexStringToNumber(store.value)));
|
|
@@ -381,12 +381,12 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
381
381
|
v: 1
|
|
382
382
|
}));
|
|
383
383
|
store.value = rgbToHex(hsvToRgb(hsvColor2));
|
|
384
|
-
onInput$?.(store.value);
|
|
384
|
+
await onInput$?.(store.value);
|
|
385
385
|
});
|
|
386
|
-
const hueMouseDown = $((e, el) => {
|
|
386
|
+
const hueMouseDown = $(async (e, el) => {
|
|
387
387
|
const hOffset = el.getBoundingClientRect().top;
|
|
388
|
-
hueChange(e, hOffset);
|
|
389
|
-
const eventListener = (e2) => hueChange(e2, hOffset);
|
|
388
|
+
await hueChange(e, hOffset);
|
|
389
|
+
const eventListener = (e2) => void hueChange(e2, hOffset);
|
|
390
390
|
window.addEventListener("mousemove", eventListener);
|
|
391
391
|
window.addEventListener("touchmove", eventListener);
|
|
392
392
|
const mouseUpListener = () => {
|
|
@@ -398,7 +398,7 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
398
398
|
window.addEventListener("mouseup", mouseUpListener);
|
|
399
399
|
window.addEventListener("touchend", mouseUpListener);
|
|
400
400
|
});
|
|
401
|
-
const sbChange = $((e, hOffset) => {
|
|
401
|
+
const sbChange = $(async (e, hOffset) => {
|
|
402
402
|
const { x, y } = getMousePosition(e);
|
|
403
403
|
store.bPosition = clamp(y - hOffset.top, 0, maxHue);
|
|
404
404
|
store.sPosition = clamp(x - hOffset.left, 0, width);
|
|
@@ -409,12 +409,12 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
409
409
|
s,
|
|
410
410
|
v
|
|
411
411
|
}));
|
|
412
|
-
onInput$?.(store.value);
|
|
412
|
+
await onInput$?.(store.value);
|
|
413
413
|
});
|
|
414
|
-
const sbMouseDown = $((e, el) => {
|
|
414
|
+
const sbMouseDown = $(async (e, el) => {
|
|
415
415
|
const offset = el.getBoundingClientRect();
|
|
416
|
-
sbChange(e, offset);
|
|
417
|
-
const eventListener = (e2) => sbChange(e2, offset);
|
|
416
|
+
await sbChange(e, offset);
|
|
417
|
+
const eventListener = (e2) => void sbChange(e2, offset);
|
|
418
418
|
window.addEventListener("mousemove", eventListener);
|
|
419
419
|
window.addEventListener("touchmove", eventListener);
|
|
420
420
|
const mouseUpListener = () => {
|
|
@@ -434,9 +434,9 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
434
434
|
...props.class
|
|
435
435
|
},
|
|
436
436
|
id,
|
|
437
|
-
onInput$: (e, el) => {
|
|
437
|
+
onInput$: async (e, el) => {
|
|
438
438
|
if (!el.dataset.value) return;
|
|
439
|
-
setColor(el.dataset.value);
|
|
439
|
+
await setColor(el.dataset.value);
|
|
440
440
|
},
|
|
441
441
|
children: [
|
|
442
442
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -513,7 +513,7 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
513
513
|
}),
|
|
514
514
|
/* @__PURE__ */ jsx("input", {
|
|
515
515
|
class: {
|
|
516
|
-
"w-full lum-input
|
|
516
|
+
"w-full lum-input p-1 text-xs": true,
|
|
517
517
|
"border-t-0 rounded-t-none": preview == "top",
|
|
518
518
|
"border-b-0 rounded-b-none": preview == "bottom"
|
|
519
519
|
},
|
|
@@ -522,8 +522,8 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
522
522
|
backgroundColor: `${store.value}`,
|
|
523
523
|
color: getBrightness(hexNumberToRgb(hexStringToNumber(store.value))) > 0.5 ? "black" : "white"
|
|
524
524
|
} : {},
|
|
525
|
-
onInput$: (e, el) => {
|
|
526
|
-
setColor(el.value);
|
|
525
|
+
onInput$: async (e, el) => {
|
|
526
|
+
await setColor(el.value);
|
|
527
527
|
}
|
|
528
528
|
})
|
|
529
529
|
]
|
|
@@ -531,22 +531,22 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
531
531
|
colors.map((color, i) => {
|
|
532
532
|
return /* @__PURE__ */ jsx("button", {
|
|
533
533
|
class: {
|
|
534
|
-
"w-[1.6rem] h-[1.6rem]
|
|
534
|
+
"w-[1.6rem] h-[1.6rem] lum-btn p-0 border-white/30 border-2 hover:border-white": true
|
|
535
535
|
},
|
|
536
536
|
style: {
|
|
537
537
|
background: color,
|
|
538
|
-
|
|
538
|
+
borderColor: color === store.value ? "#ffffff" : void 0
|
|
539
539
|
},
|
|
540
|
-
onClick$: () => {
|
|
541
|
-
setColor(color);
|
|
540
|
+
onClick$: async () => {
|
|
541
|
+
await setColor(color);
|
|
542
542
|
}
|
|
543
543
|
}, i);
|
|
544
544
|
}),
|
|
545
545
|
/* @__PURE__ */ jsx("button", {
|
|
546
|
-
class: "w-[1.6rem] h-[1.6rem]
|
|
547
|
-
onClick$: () => {
|
|
546
|
+
class: "w-[1.6rem] h-[1.6rem] lum-btn p-0.5",
|
|
547
|
+
onClick$: async () => {
|
|
548
548
|
const color = `#${Math.floor(Math.random() * 16777215).toString(16)}`;
|
|
549
|
-
setColor(color);
|
|
549
|
+
await setColor(color);
|
|
550
550
|
},
|
|
551
551
|
children: /* @__PURE__ */ jsx(Shuffle, {
|
|
552
552
|
class: "fill-current text-gray-300 pl-0.5 p-0.5"
|
|
@@ -614,7 +614,7 @@ const DropdownRaw = component$(({ id, values, class: Class, display, hover, ...p
|
|
|
614
614
|
}),
|
|
615
615
|
/* @__PURE__ */ jsxs("button", {
|
|
616
616
|
class: {
|
|
617
|
-
"lum-btn
|
|
617
|
+
"lum-btn": true,
|
|
618
618
|
...Class
|
|
619
619
|
},
|
|
620
620
|
onClick$: () => {
|
|
@@ -632,7 +632,8 @@ const DropdownRaw = component$(({ id, values, class: Class, display, hover, ...p
|
|
|
632
632
|
class: {
|
|
633
633
|
"motion-safe:transition-all ease-out": true,
|
|
634
634
|
"transform rotate-180": store.opened,
|
|
635
|
-
"group-hover:transform group-hover:rotate-180 duration-300 group-hover:duration-75": hover
|
|
635
|
+
"group-hover:transform group-hover:rotate-180 duration-300 group-hover:duration-75": hover,
|
|
636
|
+
"focus-within:transform focus-within:rotate-180 focus-within:duration-75": true
|
|
636
637
|
}
|
|
637
638
|
})
|
|
638
639
|
]
|
|
@@ -641,7 +642,8 @@ const DropdownRaw = component$(({ id, values, class: Class, display, hover, ...p
|
|
|
641
642
|
class: {
|
|
642
643
|
"transition-all ease-out absolute top-full pt-2 left-0 z-[1000] ": true,
|
|
643
644
|
"opacity-0 scale-95 pointer-events-none": !store.opened,
|
|
644
|
-
"group-hover:pointer-events-auto group-hover:opacity-100 group-hover:scale-100 duration-300 group-hover:duration-75": hover
|
|
645
|
+
"group-hover:pointer-events-auto group-hover:opacity-100 group-hover:scale-100 duration-300 group-hover:duration-75": hover,
|
|
646
|
+
"focus-within:pointer-events-auto focus-within:opacity-100 focus-within:scale-100 focus-within:duration-75": true
|
|
645
647
|
},
|
|
646
648
|
children: /* @__PURE__ */ jsxs("div", {
|
|
647
649
|
id: `lui-${id}-opts`,
|
|
@@ -652,7 +654,7 @@ const DropdownRaw = component$(({ id, values, class: Class, display, hover, ...p
|
|
|
652
654
|
values?.map(({ name, value }, i) => {
|
|
653
655
|
return /* @__PURE__ */ jsx("button", {
|
|
654
656
|
class: {
|
|
655
|
-
"lum-btn lum-
|
|
657
|
+
"lum-btn lum-bg-transparent": true
|
|
656
658
|
},
|
|
657
659
|
onClick$: () => {
|
|
658
660
|
store.opened = false;
|
|
@@ -691,45 +693,28 @@ const Link = component$((props) => {
|
|
|
691
693
|
})
|
|
692
694
|
});
|
|
693
695
|
});
|
|
694
|
-
const Header = component$(({ id, anchor,
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
696
|
+
const Header = component$(({ id, anchor, ...props }) => /* @__PURE__ */ jsxs("h2", {
|
|
697
|
+
class: {
|
|
698
|
+
"flex gap-2 group items-center font-bold text-xl sm:text-2xl whitespace-nowrap text-white": true,
|
|
699
|
+
...props.class
|
|
700
|
+
},
|
|
701
|
+
children: [
|
|
702
|
+
/* @__PURE__ */ jsx(Slot, {}),
|
|
703
|
+
id && /* @__PURE__ */ jsx(Anchor, {
|
|
704
|
+
id
|
|
705
|
+
}),
|
|
706
|
+
anchor && id && /* @__PURE__ */ jsx("a", {
|
|
707
|
+
href: `#${id}`,
|
|
708
|
+
onClick$: async () => {
|
|
709
|
+
await navigator.clipboard.writeText(window.location.href);
|
|
700
710
|
},
|
|
701
|
-
children:
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
}),
|
|
706
|
-
anchor && id && /* @__PURE__ */ jsx("a", {
|
|
707
|
-
href: `#${id}`,
|
|
708
|
-
onClick$: () => {
|
|
709
|
-
navigator.clipboard.writeText(window.location.href);
|
|
710
|
-
},
|
|
711
|
-
children: /* @__PURE__ */ jsx(Link, {
|
|
712
|
-
class: "transition-all opacity-10 group-hover:opacity-100 duration-300 group-hover:duration-75",
|
|
713
|
-
width: 24
|
|
714
|
-
})
|
|
715
|
-
})
|
|
716
|
-
]
|
|
711
|
+
children: /* @__PURE__ */ jsx(Link, {
|
|
712
|
+
class: "transition-all opacity-10 group-hover:opacity-100 duration-300 group-hover:duration-75",
|
|
713
|
+
width: 24
|
|
714
|
+
})
|
|
717
715
|
})
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
Component = /* @__PURE__ */ jsxs("div", {
|
|
721
|
-
class: "flex flex-col gap-1",
|
|
722
|
-
children: [
|
|
723
|
-
Component,
|
|
724
|
-
/* @__PURE__ */ jsx("h3", {
|
|
725
|
-
class: "flex items-center text-gray-400 text-sm",
|
|
726
|
-
children: subheader
|
|
727
|
-
})
|
|
728
|
-
]
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
return Component;
|
|
732
|
-
});
|
|
716
|
+
]
|
|
717
|
+
}));
|
|
733
718
|
const Nav = component$(({ fixed, floating, nohamburger, colorClass = "lum-bg-gray-900", ...props }) => {
|
|
734
719
|
const menu = useSignal(false);
|
|
735
720
|
return /* @__PURE__ */ jsxs("nav", {
|
|
@@ -795,7 +780,7 @@ const Nav = component$(({ fixed, floating, nohamburger, colorClass = "lum-bg-gra
|
|
|
795
780
|
name: "end"
|
|
796
781
|
}),
|
|
797
782
|
!nohamburger && /* @__PURE__ */ jsx("button", {
|
|
798
|
-
class: "lum-btn
|
|
783
|
+
class: "lum-btn p-2 lum-bg-transparent sm:hidden",
|
|
799
784
|
onClick$: () => menu.value = !menu.value,
|
|
800
785
|
children: /* @__PURE__ */ jsx("svg", {
|
|
801
786
|
class: "w-6 h-6",
|
|
@@ -885,15 +870,15 @@ const NumberInputRaw = component$(({ input, onDecrement$, onIncrement$, value =
|
|
|
885
870
|
children: [
|
|
886
871
|
/* @__PURE__ */ jsx("button", {
|
|
887
872
|
class: {
|
|
888
|
-
"lum-btn
|
|
873
|
+
"lum-btn p-2": true
|
|
889
874
|
},
|
|
890
875
|
"data-action": "decrement",
|
|
891
876
|
"aria-label": "Decrement",
|
|
892
877
|
disabled: props.min ? value <= props.min : false,
|
|
893
|
-
onClick$: input ? $((event, element) => {
|
|
878
|
+
onClick$: input ? $(async (event, element) => {
|
|
894
879
|
const siblingInput = element.nextElementSibling;
|
|
895
880
|
siblingInput.stepDown();
|
|
896
|
-
onDecrement$(event, element, siblingInput);
|
|
881
|
+
await onDecrement$(event, element, siblingInput);
|
|
897
882
|
}) : onDecrement$,
|
|
898
883
|
children: /* @__PURE__ */ jsx(Minus, {
|
|
899
884
|
width: "24",
|
|
@@ -906,22 +891,21 @@ const NumberInputRaw = component$(({ input, onDecrement$, onIncrement$, value =
|
|
|
906
891
|
value,
|
|
907
892
|
step,
|
|
908
893
|
class: {
|
|
909
|
-
"lum-input text-
|
|
910
|
-
"text-center": true,
|
|
894
|
+
"lum-input text-center": true,
|
|
911
895
|
...props.class
|
|
912
896
|
}
|
|
913
897
|
}),
|
|
914
898
|
/* @__PURE__ */ jsx("button", {
|
|
915
899
|
class: {
|
|
916
|
-
"lum-btn
|
|
900
|
+
"lum-btn p-2": true
|
|
917
901
|
},
|
|
918
902
|
"data-action": "increment",
|
|
919
903
|
"aria-label": "Increment",
|
|
920
904
|
disabled: props.max ? value >= props.max : false,
|
|
921
|
-
onClick$: input ? $((event, element) => {
|
|
905
|
+
onClick$: input ? $(async (event, element) => {
|
|
922
906
|
const siblingInput = element.previousElementSibling;
|
|
923
907
|
siblingInput.stepUp();
|
|
924
|
-
onIncrement$(event, element, siblingInput);
|
|
908
|
+
await onIncrement$(event, element, siblingInput);
|
|
925
909
|
}) : onIncrement$,
|
|
926
910
|
children: /* @__PURE__ */ jsx(Plus, {
|
|
927
911
|
width: "24",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './docs/Anchor';
|
|
2
|
+
export * from './docs/Blobs';
|
|
3
|
+
export * from './docs/ColorPicker';
|
|
4
|
+
export * from './docs/Dropdown';
|
|
5
|
+
export * from './docs/IconsLogos';
|
|
6
|
+
export * from './docs/Nav';
|
|
7
|
+
export * from './docs/NumberInput';
|
|
8
|
+
export * from './docs/Toggle';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PropsOf } from '@builder.io/qwik';
|
|
2
2
|
interface HeaderProps extends Omit<PropsOf<'h2'>, 'class'> {
|
|
3
3
|
class?: {
|
|
4
4
|
[key: string]: boolean;
|
|
5
5
|
};
|
|
6
6
|
id?: string;
|
|
7
7
|
anchor?: boolean;
|
|
8
|
-
subheader?: string | JSXOutput;
|
|
9
8
|
}
|
|
10
9
|
export declare const Header: import("@builder.io/qwik").Component<HeaderProps>;
|
|
11
10
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luminescent/ui-qwik",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.6-1",
|
|
4
4
|
"description": "Luminescent UI library",
|
|
5
5
|
"main": "./lib/index.qwik.mjs",
|
|
6
6
|
"qwik": "./lib/index.qwik.mjs",
|
|
@@ -29,23 +29,25 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@anuragroy/tailwindcss-animate": "^1.0.6",
|
|
32
|
-
"@builder.io/qwik": "1.
|
|
33
|
-
"@builder.io/qwik-city": "^1.
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@types/
|
|
37
|
-
"@
|
|
38
|
-
"@typescript-eslint/
|
|
39
|
-
"eslint": "^8.
|
|
40
|
-
"eslint
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
32
|
+
"@builder.io/qwik": "1.13.0",
|
|
33
|
+
"@builder.io/qwik-city": "^1.13.0",
|
|
34
|
+
"@eslint/js": "^9.26.0",
|
|
35
|
+
"@tailwindcss/vite": "^4.1.5",
|
|
36
|
+
"@types/eslint": "^9.6.1",
|
|
37
|
+
"@types/node": "^22.15.3",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^8.31.1",
|
|
39
|
+
"@typescript-eslint/parser": "^8.31.1",
|
|
40
|
+
"eslint": "^9.26.0",
|
|
41
|
+
"eslint-plugin-qwik": "^1.13.0",
|
|
42
|
+
"globals": "^16.0.0",
|
|
43
|
+
"tailwindcss": "4.1.5",
|
|
44
|
+
"typescript": "5.8.3",
|
|
45
|
+
"typescript-eslint": "^8.31.1",
|
|
46
|
+
"vite": "5.4.14",
|
|
45
47
|
"vite-tsconfig-paths": "^5.1.4"
|
|
46
48
|
},
|
|
47
49
|
"peerDependencies": {
|
|
48
|
-
"@luminescent/ui": "
|
|
50
|
+
"@luminescent/ui": "1.4.6-1"
|
|
49
51
|
},
|
|
50
52
|
"scripts": {
|
|
51
53
|
"build": "qwik build",
|