@luminescent/ui-qwik 1.4.6-0 → 2.0.0
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 +113 -128
- package/lib/index.qwik.mjs +114 -129
- package/lib-types/components/docs.d.ts +8 -0
- package/lib-types/components/elements/Blobs.d.ts +1 -1
- package/lib-types/components/elements/Header.d.ts +1 -2
- package/lib-types/components/elements/NumberInput.d.ts +2 -2
- package/lib-types/components/elements/Toggle.d.ts +2 -2
- package/package.json +27 -18
- package/{src/tailwind.config.js → tailwind.config.js} +38 -30
- package/lib-types/components/docs/Playground.d.ts +0 -2
package/lib/index.qwik.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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,
|
|
5
|
-
class: "
|
|
5
|
+
class: "pointer-events-none -mt-32 block h-32"
|
|
6
6
|
}));
|
|
7
7
|
const blobColorClasses = {
|
|
8
8
|
slate: [
|
|
@@ -140,7 +140,7 @@ const Blobs = component$(({ color = "darkgray", blur = "xl", ...props }) => {
|
|
|
140
140
|
const colorClass = typeof color == "string" ? blobColorClasses[color] : color;
|
|
141
141
|
return /* @__PURE__ */ jsxs("div", {
|
|
142
142
|
class: {
|
|
143
|
-
"
|
|
143
|
+
"animate-in fade-in anim-duration-[2s] absolute inset-0 transition-all motion-reduce:hidden": true,
|
|
144
144
|
...props.class
|
|
145
145
|
},
|
|
146
146
|
style: {
|
|
@@ -150,7 +150,8 @@ const Blobs = component$(({ color = "darkgray", blur = "xl", ...props }) => {
|
|
|
150
150
|
children: [
|
|
151
151
|
/* @__PURE__ */ jsx("div", {
|
|
152
152
|
class: {
|
|
153
|
-
"absolute top-0
|
|
153
|
+
"absolute top-0 h-[30cqw] w-[30cqw] rounded-full opacity-20 ease-in-out": true,
|
|
154
|
+
"blur-xs": blur === "xs",
|
|
154
155
|
"blur-sm": blur === "sm",
|
|
155
156
|
"blur-md": blur === "md",
|
|
156
157
|
"blur-lg": blur === "lg",
|
|
@@ -161,7 +162,8 @@ const Blobs = component$(({ color = "darkgray", blur = "xl", ...props }) => {
|
|
|
161
162
|
}),
|
|
162
163
|
/* @__PURE__ */ jsx("div", {
|
|
163
164
|
class: {
|
|
164
|
-
"absolute top-0
|
|
165
|
+
"absolute top-0 h-[30cqw] w-[30cqw] rounded-full opacity-20 ease-in-out": true,
|
|
166
|
+
"blur-xs": blur === "xs",
|
|
165
167
|
"blur-sm": blur === "sm",
|
|
166
168
|
"blur-md": blur === "md",
|
|
167
169
|
"blur-lg": blur === "lg",
|
|
@@ -173,7 +175,8 @@ const Blobs = component$(({ color = "darkgray", blur = "xl", ...props }) => {
|
|
|
173
175
|
}),
|
|
174
176
|
/* @__PURE__ */ jsx("div", {
|
|
175
177
|
class: {
|
|
176
|
-
"absolute top-0
|
|
178
|
+
"absolute top-0 h-[30cqw] w-[30cqw] rounded-full opacity-20 ease-in-out": true,
|
|
179
|
+
"blur-xs": blur === "xs",
|
|
177
180
|
"blur-sm": blur === "sm",
|
|
178
181
|
"blur-md": blur === "md",
|
|
179
182
|
"blur-lg": blur === "lg",
|
|
@@ -354,7 +357,7 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
354
357
|
sPosition: hsvColor.s * width,
|
|
355
358
|
value
|
|
356
359
|
});
|
|
357
|
-
const setColor = $((color) => {
|
|
360
|
+
const setColor = $(async (color) => {
|
|
358
361
|
if (!color.match(/^#[0-9A-F]{6}$/i)) return;
|
|
359
362
|
const number = hexStringToNumber(color);
|
|
360
363
|
const hsv = rgbToHsv(hexNumberToRgb(number));
|
|
@@ -367,9 +370,9 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
367
370
|
store.sPosition = hsv.s * width;
|
|
368
371
|
store.bPosition = (1 - hsv.v) * maxHue;
|
|
369
372
|
store.value = color;
|
|
370
|
-
onInput$?.(store.value);
|
|
373
|
+
await onInput$?.(store.value);
|
|
371
374
|
});
|
|
372
|
-
const hueChange = $((e, hOffset) => {
|
|
375
|
+
const hueChange = $(async (e, hOffset) => {
|
|
373
376
|
const { y } = getMousePosition(e);
|
|
374
377
|
store.hue.position = clamp(maxHue - (y - hOffset), 0, maxHue);
|
|
375
378
|
const hsvColor2 = rgbToHsv(hexNumberToRgb(hexStringToNumber(store.value)));
|
|
@@ -381,12 +384,12 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
381
384
|
v: 1
|
|
382
385
|
}));
|
|
383
386
|
store.value = rgbToHex(hsvToRgb(hsvColor2));
|
|
384
|
-
onInput$?.(store.value);
|
|
387
|
+
await onInput$?.(store.value);
|
|
385
388
|
});
|
|
386
|
-
const hueMouseDown = $((e, el) => {
|
|
389
|
+
const hueMouseDown = $(async (e, el) => {
|
|
387
390
|
const hOffset = el.getBoundingClientRect().top;
|
|
388
|
-
hueChange(e, hOffset);
|
|
389
|
-
const eventListener = (e2) => hueChange(e2, hOffset);
|
|
391
|
+
await hueChange(e, hOffset);
|
|
392
|
+
const eventListener = (e2) => void hueChange(e2, hOffset);
|
|
390
393
|
window.addEventListener("mousemove", eventListener);
|
|
391
394
|
window.addEventListener("touchmove", eventListener);
|
|
392
395
|
const mouseUpListener = () => {
|
|
@@ -398,7 +401,7 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
398
401
|
window.addEventListener("mouseup", mouseUpListener);
|
|
399
402
|
window.addEventListener("touchend", mouseUpListener);
|
|
400
403
|
});
|
|
401
|
-
const sbChange = $((e, hOffset) => {
|
|
404
|
+
const sbChange = $(async (e, hOffset) => {
|
|
402
405
|
const { x, y } = getMousePosition(e);
|
|
403
406
|
store.bPosition = clamp(y - hOffset.top, 0, maxHue);
|
|
404
407
|
store.sPosition = clamp(x - hOffset.left, 0, width);
|
|
@@ -409,12 +412,12 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
409
412
|
s,
|
|
410
413
|
v
|
|
411
414
|
}));
|
|
412
|
-
onInput$?.(store.value);
|
|
415
|
+
await onInput$?.(store.value);
|
|
413
416
|
});
|
|
414
|
-
const sbMouseDown = $((e, el) => {
|
|
417
|
+
const sbMouseDown = $(async (e, el) => {
|
|
415
418
|
const offset = el.getBoundingClientRect();
|
|
416
|
-
sbChange(e, offset);
|
|
417
|
-
const eventListener = (e2) => sbChange(e2, offset);
|
|
419
|
+
await sbChange(e, offset);
|
|
420
|
+
const eventListener = (e2) => void sbChange(e2, offset);
|
|
418
421
|
window.addEventListener("mousemove", eventListener);
|
|
419
422
|
window.addEventListener("touchmove", eventListener);
|
|
420
423
|
const mouseUpListener = () => {
|
|
@@ -428,22 +431,22 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
428
431
|
});
|
|
429
432
|
return /* @__PURE__ */ jsxs("div", {
|
|
430
433
|
class: {
|
|
431
|
-
"
|
|
432
|
-
|
|
434
|
+
"lum-bg-gray-900 flex touch-none gap-4 rounded-lg p-4 motion-safe:transition-all": true,
|
|
435
|
+
flex: true,
|
|
433
436
|
"flex-col": !horizontal,
|
|
434
437
|
...props.class
|
|
435
438
|
},
|
|
436
439
|
id,
|
|
437
|
-
onInput$: (e, el) => {
|
|
440
|
+
onInput$: async (e, el) => {
|
|
438
441
|
if (!el.dataset.value) return;
|
|
439
|
-
setColor(el.dataset.value);
|
|
442
|
+
await setColor(el.dataset.value);
|
|
440
443
|
},
|
|
441
444
|
children: [
|
|
442
445
|
/* @__PURE__ */ jsxs("div", {
|
|
443
446
|
class: "flex gap-4",
|
|
444
447
|
children: [
|
|
445
448
|
/* @__PURE__ */ jsxs("div", {
|
|
446
|
-
class: "
|
|
449
|
+
class: "relative h-[150px] w-[125px] rounded-md",
|
|
447
450
|
style: {
|
|
448
451
|
background: `linear-gradient(to right, #FFFFFF, ${store.hue.color})`
|
|
449
452
|
},
|
|
@@ -453,11 +456,11 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
453
456
|
"preventdefault:touchstart": true,
|
|
454
457
|
children: [
|
|
455
458
|
/* @__PURE__ */ jsx("div", {
|
|
456
|
-
class: "
|
|
459
|
+
class: "h-[150px] w-[125px] rounded-[0.3rem] border border-gray-700 bg-gradient-to-b from-transparent to-black"
|
|
457
460
|
}),
|
|
458
461
|
/* @__PURE__ */ jsx("div", {
|
|
459
462
|
class: {
|
|
460
|
-
"absolute -top-2 -left-2
|
|
463
|
+
"absolute -top-2 -left-2 h-4 w-4 rounded-full border bg-white": true,
|
|
461
464
|
"border-white": getBrightness(hexNumberToRgb(hexStringToNumber(store.value))) < 0.5,
|
|
462
465
|
"border-black": getBrightness(hexNumberToRgb(hexStringToNumber(store.value))) > 0.5
|
|
463
466
|
},
|
|
@@ -469,7 +472,7 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
469
472
|
]
|
|
470
473
|
}),
|
|
471
474
|
/* @__PURE__ */ jsx("div", {
|
|
472
|
-
class: "h-[150px]
|
|
475
|
+
class: "relative h-[150px] w-2 rounded-md border border-gray-700",
|
|
473
476
|
style: {
|
|
474
477
|
background: "linear-gradient(to bottom, #ff0000, #ff00ff, #0000ff, #00ffff, #00ff00, #ffff00, #ff0000)"
|
|
475
478
|
},
|
|
@@ -478,7 +481,7 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
478
481
|
"preventdefault:mousedown": true,
|
|
479
482
|
"preventdefault:touchstart": true,
|
|
480
483
|
children: /* @__PURE__ */ jsx("div", {
|
|
481
|
-
class: "absolute -bottom-2 -left-[5px]
|
|
484
|
+
class: "absolute -bottom-2 -left-[5px] h-4 w-4 rounded-full border border-white bg-[#ff0000]",
|
|
482
485
|
style: {
|
|
483
486
|
transform: `translateY(${-store.hue.position}px)`,
|
|
484
487
|
background: store.hue.color
|
|
@@ -488,11 +491,11 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
488
491
|
]
|
|
489
492
|
}),
|
|
490
493
|
/* @__PURE__ */ jsxs("div", {
|
|
491
|
-
class: "w-[150px] flex
|
|
494
|
+
class: "flex w-[150px] flex-wrap justify-between gap-1",
|
|
492
495
|
children: [
|
|
493
496
|
showInput && /* @__PURE__ */ jsxs("div", {
|
|
494
497
|
class: {
|
|
495
|
-
"flex w-[150px]
|
|
498
|
+
"mb-2 flex w-[150px] border-b border-b-gray-700 pb-3": true,
|
|
496
499
|
"flex-row gap-1": preview == "left",
|
|
497
500
|
"flex-row-reverse gap-1": preview == "right",
|
|
498
501
|
"flex-col": preview == "top",
|
|
@@ -502,8 +505,8 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
502
505
|
preview != "full" && /* @__PURE__ */ jsx("div", {
|
|
503
506
|
class: {
|
|
504
507
|
"border border-gray-700": true,
|
|
505
|
-
"h-full
|
|
506
|
-
"w-full
|
|
508
|
+
"aspect-square h-full rounded-md": preview == "left" || preview == "right",
|
|
509
|
+
"h-3 w-full": preview == "top" || preview == "bottom",
|
|
507
510
|
"rounded-t-md": preview == "top",
|
|
508
511
|
"rounded-b-md": preview == "bottom"
|
|
509
512
|
},
|
|
@@ -513,17 +516,17 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
513
516
|
}),
|
|
514
517
|
/* @__PURE__ */ jsx("input", {
|
|
515
518
|
class: {
|
|
516
|
-
"
|
|
517
|
-
"
|
|
518
|
-
"
|
|
519
|
+
"lum-input w-full p-1 text-xs": true,
|
|
520
|
+
"rounded-t-none border-t-0": preview == "top",
|
|
521
|
+
"rounded-b-none border-b-0": preview == "bottom"
|
|
519
522
|
},
|
|
520
523
|
value: store.value,
|
|
521
524
|
style: preview == "full" ? {
|
|
522
525
|
backgroundColor: `${store.value}`,
|
|
523
526
|
color: getBrightness(hexNumberToRgb(hexStringToNumber(store.value))) > 0.5 ? "black" : "white"
|
|
524
527
|
} : {},
|
|
525
|
-
onInput$: (e, el) => {
|
|
526
|
-
setColor(el.value);
|
|
528
|
+
onInput$: async (e, el) => {
|
|
529
|
+
await setColor(el.value);
|
|
527
530
|
}
|
|
528
531
|
})
|
|
529
532
|
]
|
|
@@ -531,25 +534,25 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
|
|
|
531
534
|
colors.map((color, i) => {
|
|
532
535
|
return /* @__PURE__ */ jsx("button", {
|
|
533
536
|
class: {
|
|
534
|
-
"
|
|
537
|
+
"lum-btn h-[1.6rem] w-[1.6rem] border-2 border-white/30 p-0 hover:border-white": true
|
|
535
538
|
},
|
|
536
539
|
style: {
|
|
537
540
|
background: color,
|
|
538
|
-
|
|
541
|
+
borderColor: color === store.value ? "#ffffff" : void 0
|
|
539
542
|
},
|
|
540
|
-
onClick$: () => {
|
|
541
|
-
setColor(color);
|
|
543
|
+
onClick$: async () => {
|
|
544
|
+
await setColor(color);
|
|
542
545
|
}
|
|
543
546
|
}, i);
|
|
544
547
|
}),
|
|
545
548
|
/* @__PURE__ */ jsx("button", {
|
|
546
|
-
class: "
|
|
547
|
-
onClick$: () => {
|
|
549
|
+
class: "lum-btn h-[1.6rem] w-[1.6rem] p-0.5",
|
|
550
|
+
onClick$: async () => {
|
|
548
551
|
const color = `#${Math.floor(Math.random() * 16777215).toString(16)}`;
|
|
549
|
-
setColor(color);
|
|
552
|
+
await setColor(color);
|
|
550
553
|
},
|
|
551
554
|
children: /* @__PURE__ */ jsx(Shuffle, {
|
|
552
|
-
class: "fill-current
|
|
555
|
+
class: "fill-current p-0.5 pl-0.5 text-gray-300"
|
|
553
556
|
})
|
|
554
557
|
})
|
|
555
558
|
]
|
|
@@ -579,7 +582,7 @@ const Dropdown = component$((props) => {
|
|
|
579
582
|
children: [
|
|
580
583
|
/* @__PURE__ */ jsx("label", {
|
|
581
584
|
for: props.id,
|
|
582
|
-
class: "text-gray-300
|
|
585
|
+
class: "pb-1 text-gray-300 select-none",
|
|
583
586
|
children: /* @__PURE__ */ jsx(Slot, {})
|
|
584
587
|
}),
|
|
585
588
|
/* @__PURE__ */ jsx(DropdownRaw, {
|
|
@@ -596,14 +599,14 @@ const DropdownRaw = component$(({ id, values, class: Class, display, hover, ...p
|
|
|
596
599
|
return /* @__PURE__ */ jsxs("div", {
|
|
597
600
|
class: {
|
|
598
601
|
"relative touch-manipulation": true,
|
|
599
|
-
|
|
602
|
+
group: hover
|
|
600
603
|
},
|
|
601
604
|
children: [
|
|
602
605
|
values && /* @__PURE__ */ jsx("select", {
|
|
603
606
|
...props,
|
|
604
607
|
id,
|
|
605
608
|
class: {
|
|
606
|
-
|
|
609
|
+
hidden: true
|
|
607
610
|
},
|
|
608
611
|
children: values.map((value, i) => {
|
|
609
612
|
return /* @__PURE__ */ jsx("option", {
|
|
@@ -614,7 +617,7 @@ const DropdownRaw = component$(({ id, values, class: Class, display, hover, ...p
|
|
|
614
617
|
}),
|
|
615
618
|
/* @__PURE__ */ jsxs("button", {
|
|
616
619
|
class: {
|
|
617
|
-
"lum-btn
|
|
620
|
+
"lum-btn": true,
|
|
618
621
|
...Class
|
|
619
622
|
},
|
|
620
623
|
onClick$: () => {
|
|
@@ -630,31 +633,31 @@ const DropdownRaw = component$(({ id, values, class: Class, display, hover, ...p
|
|
|
630
633
|
/* @__PURE__ */ jsx(ChevronDown, {
|
|
631
634
|
width: 16,
|
|
632
635
|
class: {
|
|
633
|
-
"motion-safe:transition-all
|
|
634
|
-
"
|
|
635
|
-
"
|
|
636
|
-
"focus-within:
|
|
636
|
+
"ease-out motion-safe:transition-all": true,
|
|
637
|
+
"rotate-180 transform": store.opened,
|
|
638
|
+
"duration-300 group-hover:rotate-180 group-hover:transform group-hover:duration-75": hover,
|
|
639
|
+
"focus-within:rotate-180 focus-within:transform focus-within:duration-75": true
|
|
637
640
|
}
|
|
638
641
|
})
|
|
639
642
|
]
|
|
640
643
|
}),
|
|
641
644
|
/* @__PURE__ */ jsx("div", {
|
|
642
645
|
class: {
|
|
643
|
-
"
|
|
644
|
-
"
|
|
645
|
-
"group-hover:pointer-events-auto group-hover:
|
|
646
|
-
"focus-within:pointer-events-auto focus-within:
|
|
646
|
+
"absolute top-full left-0 z-[1000] pt-2 transition-all ease-out": true,
|
|
647
|
+
"pointer-events-none scale-95 opacity-0": !store.opened,
|
|
648
|
+
"duration-300 group-hover:pointer-events-auto group-hover:scale-100 group-hover:opacity-100 group-hover:duration-75": hover,
|
|
649
|
+
"focus-within:pointer-events-auto focus-within:scale-100 focus-within:opacity-100 focus-within:duration-75": true
|
|
647
650
|
},
|
|
648
651
|
children: /* @__PURE__ */ jsxs("div", {
|
|
649
652
|
id: `lui-${id}-opts`,
|
|
650
653
|
class: {
|
|
651
|
-
"
|
|
654
|
+
"lum-bg-gray-800 lum-scroll flex max-h-72 flex-col gap-1 overflow-auto rounded-md border p-1 backdrop-blur-xl select-none motion-safe:transition-all": true
|
|
652
655
|
},
|
|
653
656
|
children: [
|
|
654
657
|
values?.map(({ name, value }, i) => {
|
|
655
658
|
return /* @__PURE__ */ jsx("button", {
|
|
656
659
|
class: {
|
|
657
|
-
"lum-btn lum-
|
|
660
|
+
"lum-btn lum-bg-transparent": true
|
|
658
661
|
},
|
|
659
662
|
onClick$: () => {
|
|
660
663
|
store.opened = false;
|
|
@@ -693,68 +696,51 @@ const Link = component$((props) => {
|
|
|
693
696
|
})
|
|
694
697
|
});
|
|
695
698
|
});
|
|
696
|
-
const Header = component$(({ id, anchor,
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
699
|
+
const Header = component$(({ id, anchor, ...props }) => /* @__PURE__ */ jsxs("h2", {
|
|
700
|
+
class: {
|
|
701
|
+
"group flex items-center gap-2 text-xl font-bold whitespace-nowrap text-white sm:text-2xl": true,
|
|
702
|
+
...props.class
|
|
703
|
+
},
|
|
704
|
+
children: [
|
|
705
|
+
/* @__PURE__ */ jsx(Slot, {}),
|
|
706
|
+
id && /* @__PURE__ */ jsx(Anchor, {
|
|
707
|
+
id
|
|
708
|
+
}),
|
|
709
|
+
anchor && id && /* @__PURE__ */ jsx("a", {
|
|
710
|
+
href: `#${id}`,
|
|
711
|
+
onClick$: async () => {
|
|
712
|
+
await navigator.clipboard.writeText(window.location.href);
|
|
702
713
|
},
|
|
703
|
-
children:
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
}),
|
|
708
|
-
anchor && id && /* @__PURE__ */ jsx("a", {
|
|
709
|
-
href: `#${id}`,
|
|
710
|
-
onClick$: () => {
|
|
711
|
-
navigator.clipboard.writeText(window.location.href);
|
|
712
|
-
},
|
|
713
|
-
children: /* @__PURE__ */ jsx(Link, {
|
|
714
|
-
class: "transition-all opacity-10 group-hover:opacity-100 duration-300 group-hover:duration-75",
|
|
715
|
-
width: 24
|
|
716
|
-
})
|
|
717
|
-
})
|
|
718
|
-
]
|
|
714
|
+
children: /* @__PURE__ */ jsx(Link, {
|
|
715
|
+
class: "opacity-10 transition-all duration-300 group-hover:opacity-100 group-hover:duration-75",
|
|
716
|
+
width: 24
|
|
717
|
+
})
|
|
719
718
|
})
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
Component = /* @__PURE__ */ jsxs("div", {
|
|
723
|
-
class: "flex flex-col gap-1",
|
|
724
|
-
children: [
|
|
725
|
-
Component,
|
|
726
|
-
/* @__PURE__ */ jsx("h3", {
|
|
727
|
-
class: "flex items-center text-gray-400 text-sm",
|
|
728
|
-
children: subheader
|
|
729
|
-
})
|
|
730
|
-
]
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
return Component;
|
|
734
|
-
});
|
|
719
|
+
]
|
|
720
|
+
}));
|
|
735
721
|
const Nav = component$(({ fixed, floating, nohamburger, colorClass = "lum-bg-gray-900", ...props }) => {
|
|
736
722
|
const menu = useSignal(false);
|
|
737
723
|
return /* @__PURE__ */ jsxs("nav", {
|
|
738
724
|
...props,
|
|
739
725
|
class: {
|
|
740
|
-
"
|
|
741
|
-
|
|
742
|
-
|
|
726
|
+
"top-0 left-0 z-50 flex w-full flex-col duration-200 motion-safe:transition-all": true,
|
|
727
|
+
fixed,
|
|
728
|
+
absolute: !fixed,
|
|
743
729
|
...props.class
|
|
744
730
|
},
|
|
745
731
|
children: [
|
|
746
732
|
!nohamburger && /* @__PURE__ */ jsx("div", {
|
|
747
733
|
class: {
|
|
748
|
-
"
|
|
734
|
+
"absolute top-full flex w-full flex-col items-center px-2 motion-safe:transition-all sm:hidden": true,
|
|
749
735
|
"mt-2": menu.value,
|
|
750
|
-
"
|
|
736
|
+
"pointer-events-none opacity-0": !menu.value,
|
|
751
737
|
"before:backdrop-blur-lg": !colorClass.includes("transparent"),
|
|
752
|
-
'before:absolute before:
|
|
738
|
+
'before:absolute before:-z-10 before:h-full before:w-full before:rounded-lg before:drop-shadow-xl before:content-[""]': true
|
|
753
739
|
},
|
|
754
740
|
children: /* @__PURE__ */ jsx("div", {
|
|
755
741
|
class: {
|
|
756
742
|
[colorClass]: true,
|
|
757
|
-
"flex flex-col gap-2
|
|
743
|
+
"flex w-full max-w-7xl flex-col gap-2 rounded-lg border px-2 py-4 motion-safe:transition-all": true
|
|
758
744
|
},
|
|
759
745
|
children: /* @__PURE__ */ jsx(Slot, {
|
|
760
746
|
name: "mobile"
|
|
@@ -764,43 +750,43 @@ const Nav = component$(({ fixed, floating, nohamburger, colorClass = "lum-bg-gra
|
|
|
764
750
|
/* @__PURE__ */ jsx("div", {
|
|
765
751
|
class: {
|
|
766
752
|
[colorClass]: !floating,
|
|
767
|
-
"!border-
|
|
753
|
+
"!border-x-0 !border-t-0": !floating,
|
|
768
754
|
"before:backdrop-blur-lg": !colorClass.includes("transparent") && !floating,
|
|
769
|
-
'before:absolute before
|
|
770
|
-
"relative
|
|
755
|
+
'before:absolute before:-z-10 before:h-full before:w-full before:drop-shadow-xl before:content-[""]': !floating,
|
|
756
|
+
"relative mx-2 mt-2": floating
|
|
771
757
|
},
|
|
772
758
|
children: /* @__PURE__ */ jsxs("div", {
|
|
773
759
|
class: {
|
|
774
|
-
"flex
|
|
760
|
+
"mx-auto flex w-full max-w-7xl justify-evenly px-2": true,
|
|
775
761
|
[colorClass]: floating,
|
|
776
|
-
"
|
|
762
|
+
"rounded-lg border": floating,
|
|
777
763
|
"before:backdrop-blur-lg": !colorClass.includes("transparent") && floating,
|
|
778
|
-
'before:absolute before:
|
|
764
|
+
'before:absolute before:-z-10 before:h-full before:w-full before:max-w-7xl before:rounded-lg before:drop-shadow-xl before:content-[""]': floating
|
|
779
765
|
},
|
|
780
766
|
children: [
|
|
781
767
|
/* @__PURE__ */ jsx("div", {
|
|
782
|
-
class: "flex items-center
|
|
768
|
+
class: "flex flex-1 items-center justify-start gap-2 py-2",
|
|
783
769
|
children: /* @__PURE__ */ jsx(Slot, {
|
|
784
770
|
name: "start"
|
|
785
771
|
})
|
|
786
772
|
}),
|
|
787
773
|
/* @__PURE__ */ jsx("div", {
|
|
788
|
-
class: "flex items-center
|
|
774
|
+
class: "flex flex-1 items-center justify-center gap-2 py-2",
|
|
789
775
|
children: /* @__PURE__ */ jsx(Slot, {
|
|
790
776
|
name: "center"
|
|
791
777
|
})
|
|
792
778
|
}),
|
|
793
779
|
/* @__PURE__ */ jsxs("div", {
|
|
794
|
-
class: "flex items-center
|
|
780
|
+
class: "flex flex-1 items-center justify-end gap-2 py-2",
|
|
795
781
|
children: [
|
|
796
782
|
/* @__PURE__ */ jsx(Slot, {
|
|
797
783
|
name: "end"
|
|
798
784
|
}),
|
|
799
785
|
!nohamburger && /* @__PURE__ */ jsx("button", {
|
|
800
|
-
class: "lum-btn lum-
|
|
786
|
+
class: "lum-btn lum-bg-transparent p-2 sm:hidden",
|
|
801
787
|
onClick$: () => menu.value = !menu.value,
|
|
802
788
|
children: /* @__PURE__ */ jsx("svg", {
|
|
803
|
-
class: "
|
|
789
|
+
class: "h-6 w-6",
|
|
804
790
|
fill: "none",
|
|
805
791
|
stroke: "currentColor",
|
|
806
792
|
viewBox: "0 0 24 24",
|
|
@@ -859,7 +845,7 @@ const NumberInput = component$((props) => {
|
|
|
859
845
|
children: [
|
|
860
846
|
/* @__PURE__ */ jsx("label", {
|
|
861
847
|
for: props.id,
|
|
862
|
-
class: "text-gray-300
|
|
848
|
+
class: "pb-1 text-gray-300 select-none",
|
|
863
849
|
children: /* @__PURE__ */ jsx(Slot, {})
|
|
864
850
|
}),
|
|
865
851
|
/* @__PURE__ */ jsx(NumberInputRaw, {
|
|
@@ -882,20 +868,20 @@ const NumberInputRaw = component$(({ input, onDecrement$, onIncrement$, value =
|
|
|
882
868
|
`);
|
|
883
869
|
return /* @__PURE__ */ jsxs("div", {
|
|
884
870
|
class: {
|
|
885
|
-
"flex gap-2 text-gray-50
|
|
871
|
+
"flex touch-manipulation gap-2 text-gray-50": true
|
|
886
872
|
},
|
|
887
873
|
children: [
|
|
888
874
|
/* @__PURE__ */ jsx("button", {
|
|
889
875
|
class: {
|
|
890
|
-
"lum-btn
|
|
876
|
+
"lum-btn p-2": true
|
|
891
877
|
},
|
|
892
878
|
"data-action": "decrement",
|
|
893
879
|
"aria-label": "Decrement",
|
|
894
880
|
disabled: props.min ? value <= props.min : false,
|
|
895
|
-
onClick$: input ? $((event, element) => {
|
|
881
|
+
onClick$: input ? $(async (event, element) => {
|
|
896
882
|
const siblingInput = element.nextElementSibling;
|
|
897
883
|
siblingInput.stepDown();
|
|
898
|
-
onDecrement$(event, element, siblingInput);
|
|
884
|
+
await onDecrement$(event, element, siblingInput);
|
|
899
885
|
}) : onDecrement$,
|
|
900
886
|
children: /* @__PURE__ */ jsx(Minus, {
|
|
901
887
|
width: "24",
|
|
@@ -908,22 +894,21 @@ const NumberInputRaw = component$(({ input, onDecrement$, onIncrement$, value =
|
|
|
908
894
|
value,
|
|
909
895
|
step,
|
|
910
896
|
class: {
|
|
911
|
-
"lum-input text-
|
|
912
|
-
"text-center": true,
|
|
897
|
+
"lum-input text-center": true,
|
|
913
898
|
...props.class
|
|
914
899
|
}
|
|
915
900
|
}),
|
|
916
901
|
/* @__PURE__ */ jsx("button", {
|
|
917
902
|
class: {
|
|
918
|
-
"lum-btn
|
|
903
|
+
"lum-btn p-2": true
|
|
919
904
|
},
|
|
920
905
|
"data-action": "increment",
|
|
921
906
|
"aria-label": "Increment",
|
|
922
907
|
disabled: props.max ? value >= props.max : false,
|
|
923
|
-
onClick$: input ? $((event, element) => {
|
|
908
|
+
onClick$: input ? $(async (event, element) => {
|
|
924
909
|
const siblingInput = element.previousElementSibling;
|
|
925
910
|
siblingInput.stepUp();
|
|
926
|
-
onIncrement$(event, element, siblingInput);
|
|
911
|
+
await onIncrement$(event, element, siblingInput);
|
|
927
912
|
}) : onIncrement$,
|
|
928
913
|
children: /* @__PURE__ */ jsx(Plus, {
|
|
929
914
|
width: "24",
|
|
@@ -1132,25 +1117,25 @@ const toggleOffColorClasses = {
|
|
|
1132
1117
|
const Toggle = component$(({ checkbox, round, center, label, onColor = "blue", offColor = "darkgray", ...props }) => {
|
|
1133
1118
|
return /* @__PURE__ */ jsxs("div", {
|
|
1134
1119
|
class: {
|
|
1135
|
-
"flex
|
|
1120
|
+
"flex touch-manipulation items-center gap-3": true,
|
|
1136
1121
|
"justify-center": center
|
|
1137
1122
|
},
|
|
1138
1123
|
children: [
|
|
1139
1124
|
/* @__PURE__ */ jsxs("label", {
|
|
1140
|
-
class: "inline-flex
|
|
1125
|
+
class: "relative inline-flex cursor-pointer items-center",
|
|
1141
1126
|
children: [
|
|
1142
1127
|
/* @__PURE__ */ jsx("input", {
|
|
1143
1128
|
type: "checkbox",
|
|
1144
1129
|
...props,
|
|
1145
1130
|
class: {
|
|
1146
|
-
"sr-only
|
|
1131
|
+
"peer sr-only": true,
|
|
1147
1132
|
...props.class
|
|
1148
1133
|
}
|
|
1149
1134
|
}),
|
|
1150
1135
|
/* @__PURE__ */ jsx("div", {
|
|
1151
1136
|
class: {
|
|
1152
|
-
"
|
|
1153
|
-
"after:
|
|
1137
|
+
"peer h-7 border duration-300 ease-out hover:shadow-lg hover:duration-75 motion-safe:transition": true,
|
|
1138
|
+
"after:absolute after:top-[4px] after:left-[4px] after:h-5 after:w-5 after:border after:duration-300 after:ease-out after:content-[''] after:hover:duration-75 after:motion-safe:transition-all": true,
|
|
1154
1139
|
"rounded-md after:rounded-[0.2rem]": !round,
|
|
1155
1140
|
"rounded-full after:rounded-full": round,
|
|
1156
1141
|
"w-12 peer-checked:after:translate-x-full": !checkbox,
|
|
@@ -1165,7 +1150,7 @@ const Toggle = component$(({ checkbox, round, center, label, onColor = "blue", o
|
|
|
1165
1150
|
}),
|
|
1166
1151
|
label && /* @__PURE__ */ jsx("label", {
|
|
1167
1152
|
for: props.id,
|
|
1168
|
-
class: "text-gray-300
|
|
1153
|
+
class: "flex gap-2 text-gray-300 select-none",
|
|
1169
1154
|
children: label
|
|
1170
1155
|
})
|
|
1171
1156
|
]
|
|
@@ -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';
|
|
@@ -6,7 +6,7 @@ export interface BlobProps {
|
|
|
6
6
|
[key: string]: string | number;
|
|
7
7
|
};
|
|
8
8
|
color?: keyof typeof blobColorClasses | [string, string, string];
|
|
9
|
-
blur?: 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
+
blur?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
10
10
|
}
|
|
11
11
|
export declare const blobColorClasses: {
|
|
12
12
|
slate: string[];
|
|
@@ -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 {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PropsOf, QRL } from '@builder.io/qwik';
|
|
2
|
-
interface NumberInputRawProps extends Omit<
|
|
2
|
+
interface NumberInputRawProps extends Omit<PropsOf<'input'> & {
|
|
3
3
|
type: 'number';
|
|
4
|
-
}
|
|
4
|
+
}, 'class' | 'type'> {
|
|
5
5
|
onDecrement$: QRL<(event: PointerEvent, element: HTMLButtonElement, inputElement?: HTMLInputElement) => void>;
|
|
6
6
|
onIncrement$: QRL<(event: PointerEvent, element: HTMLButtonElement, inputElement?: HTMLInputElement) => void>;
|
|
7
7
|
input?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JSXOutput, PropsOf } from '@builder.io/qwik';
|
|
2
|
-
interface ToggleProps extends Omit<
|
|
2
|
+
interface ToggleProps extends Omit<PropsOf<'input'> & {
|
|
3
3
|
type: 'checkbox';
|
|
4
|
-
}
|
|
4
|
+
}, 'class' | 'bind:checked' | 'type' | 'children'> {
|
|
5
5
|
class?: {
|
|
6
6
|
[key: string]: boolean;
|
|
7
7
|
};
|