@luminescent/ui-qwik 4.2.1 → 4.3.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
CHANGED
|
@@ -636,7 +636,7 @@ const Dropdown = qwik.component$(({ class: Class, hover, opened, ...props }) =>
|
|
|
636
636
|
return /* @__PURE__ */ jsxRuntime.jsxs("button", {
|
|
637
637
|
type: "button",
|
|
638
638
|
class: {
|
|
639
|
-
"lum-btn": true,
|
|
639
|
+
"group lum-btn": true,
|
|
640
640
|
...Class
|
|
641
641
|
},
|
|
642
642
|
...props,
|
|
@@ -657,127 +657,6 @@ const Dropdown = qwik.component$(({ class: Class, hover, opened, ...props }) =>
|
|
|
657
657
|
]
|
|
658
658
|
});
|
|
659
659
|
});
|
|
660
|
-
const SelectMenu = qwik.component$((props) => {
|
|
661
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
662
|
-
class: "flex flex-col",
|
|
663
|
-
children: [
|
|
664
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", {
|
|
665
|
-
for: props.id,
|
|
666
|
-
class: "pb-1 text-lum-text select-none",
|
|
667
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
|
|
668
|
-
}),
|
|
669
|
-
/* @__PURE__ */ jsxRuntime.jsxs(SelectMenuRaw, {
|
|
670
|
-
...props,
|
|
671
|
-
children: [
|
|
672
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
673
|
-
"q:slot": "dropdown",
|
|
674
|
-
children: (props.customDropdown || !props.values?.length) && /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
|
|
675
|
-
name: "dropdown"
|
|
676
|
-
})
|
|
677
|
-
}),
|
|
678
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
679
|
-
"q:slot": "extra-buttons",
|
|
680
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
|
|
681
|
-
name: "extra-buttons"
|
|
682
|
-
})
|
|
683
|
-
})
|
|
684
|
-
]
|
|
685
|
-
})
|
|
686
|
-
]
|
|
687
|
-
});
|
|
688
|
-
});
|
|
689
|
-
const SelectMenuRaw = qwik.component$(({ id, values, class: Class, customDropdown, hover, align, ...props }) => {
|
|
690
|
-
const store = qwik.useStore({
|
|
691
|
-
opened: false,
|
|
692
|
-
value: props.value
|
|
693
|
-
});
|
|
694
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
695
|
-
class: {
|
|
696
|
-
"relative touch-manipulation": true,
|
|
697
|
-
group: hover
|
|
698
|
-
},
|
|
699
|
-
children: [
|
|
700
|
-
values && /* @__PURE__ */ jsxRuntime.jsx("select", {
|
|
701
|
-
...props,
|
|
702
|
-
id,
|
|
703
|
-
class: {
|
|
704
|
-
hidden: true
|
|
705
|
-
},
|
|
706
|
-
children: values.map((value, i) => {
|
|
707
|
-
return /* @__PURE__ */ jsxRuntime.jsx("option", {
|
|
708
|
-
value: value.value,
|
|
709
|
-
children: `${value.value}`
|
|
710
|
-
}, i);
|
|
711
|
-
})
|
|
712
|
-
}),
|
|
713
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Dropdown, {
|
|
714
|
-
opened: store.opened,
|
|
715
|
-
class: {
|
|
716
|
-
"w-full": true,
|
|
717
|
-
...Class
|
|
718
|
-
},
|
|
719
|
-
onClick$: () => {
|
|
720
|
-
if (!hover) store.opened = !store.opened;
|
|
721
|
-
},
|
|
722
|
-
children: [
|
|
723
|
-
customDropdown && /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
|
|
724
|
-
name: "dropdown"
|
|
725
|
-
}),
|
|
726
|
-
!customDropdown && /* @__PURE__ */ jsxRuntime.jsxs("span", {
|
|
727
|
-
id: `lui-${id}-name`,
|
|
728
|
-
children: [
|
|
729
|
-
values && (values.find((value) => value.value.toString() === store.value)?.name ?? values[0].name),
|
|
730
|
-
!values && /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
|
|
731
|
-
name: "dropdown"
|
|
732
|
-
})
|
|
733
|
-
]
|
|
734
|
-
})
|
|
735
|
-
]
|
|
736
|
-
}),
|
|
737
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
738
|
-
id: `lui-${id}-opts-container`,
|
|
739
|
-
class: {
|
|
740
|
-
"absolute z-[1000] pt-2 transition-all ease-out": true,
|
|
741
|
-
"left-0": align === "left",
|
|
742
|
-
"right-0": align === "right",
|
|
743
|
-
"left-1/2 -translate-x-1/2": align === "center",
|
|
744
|
-
"pointer-events-none scale-95 opacity-0": !store.opened,
|
|
745
|
-
"duration-300 group-hover:pointer-events-auto group-hover:scale-100 group-hover:opacity-100 group-hover:duration-75": hover,
|
|
746
|
-
"focus-within:pointer-events-auto focus-within:scale-100 focus-within:opacity-100 focus-within:duration-75": true
|
|
747
|
-
},
|
|
748
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
749
|
-
id: `lui-${id}-opts`,
|
|
750
|
-
class: {
|
|
751
|
-
"lum-bg-lum-input-bg lum-scroll flex max-h-72 flex-col gap-1 overflow-auto rounded-lum border p-1 select-none motion-safe:transition-all": true
|
|
752
|
-
},
|
|
753
|
-
children: [
|
|
754
|
-
values?.map(({ name, value }, i) => {
|
|
755
|
-
return /* @__PURE__ */ jsxRuntime.jsx("button", {
|
|
756
|
-
type: "button",
|
|
757
|
-
class: {
|
|
758
|
-
"lum-btn lum-bg-transparent rounded-lum-1": true
|
|
759
|
-
},
|
|
760
|
-
onClick$: () => {
|
|
761
|
-
store.opened = false;
|
|
762
|
-
const select = document.getElementById(id);
|
|
763
|
-
if (select) {
|
|
764
|
-
select.value = value.toString();
|
|
765
|
-
select.dispatchEvent(new Event("change"));
|
|
766
|
-
}
|
|
767
|
-
store.value = value.toString();
|
|
768
|
-
},
|
|
769
|
-
children: name
|
|
770
|
-
}, i);
|
|
771
|
-
}),
|
|
772
|
-
/* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
|
|
773
|
-
name: "extra-buttons"
|
|
774
|
-
})
|
|
775
|
-
]
|
|
776
|
-
})
|
|
777
|
-
})
|
|
778
|
-
]
|
|
779
|
-
});
|
|
780
|
-
});
|
|
781
660
|
const Menu = qwik.component$(({ size, ...props }) => {
|
|
782
661
|
return /* @__PURE__ */ jsxRuntime.jsxs("svg", {
|
|
783
662
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1003,6 +882,183 @@ const NumberInputRaw = qwik.component$(({ input, onDecrement$, onIncrement$, val
|
|
|
1003
882
|
]
|
|
1004
883
|
});
|
|
1005
884
|
});
|
|
885
|
+
const SelectMenu = qwik.component$((props) => {
|
|
886
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
887
|
+
class: "flex flex-col",
|
|
888
|
+
children: [
|
|
889
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", {
|
|
890
|
+
for: props.id,
|
|
891
|
+
class: "pb-1 text-lum-text select-none",
|
|
892
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
|
|
893
|
+
}),
|
|
894
|
+
/* @__PURE__ */ jsxRuntime.jsxs(SelectMenuRaw, {
|
|
895
|
+
...props,
|
|
896
|
+
children: [
|
|
897
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
898
|
+
"q:slot": "dropdown",
|
|
899
|
+
children: (props.customDropdown || !props.values?.length) && /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
|
|
900
|
+
name: "dropdown"
|
|
901
|
+
})
|
|
902
|
+
}),
|
|
903
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
904
|
+
"q:slot": "extra-buttons",
|
|
905
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
|
|
906
|
+
name: "extra-buttons"
|
|
907
|
+
})
|
|
908
|
+
})
|
|
909
|
+
]
|
|
910
|
+
})
|
|
911
|
+
]
|
|
912
|
+
});
|
|
913
|
+
});
|
|
914
|
+
const SelectMenuRaw = qwik.component$(({ id, values, class: Class, customDropdown, hover, align, ...props }) => {
|
|
915
|
+
const store = qwik.useStore({
|
|
916
|
+
opened: false,
|
|
917
|
+
value: props.value
|
|
918
|
+
});
|
|
919
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
920
|
+
class: {
|
|
921
|
+
"relative touch-manipulation": true,
|
|
922
|
+
group: hover
|
|
923
|
+
},
|
|
924
|
+
children: [
|
|
925
|
+
values && /* @__PURE__ */ jsxRuntime.jsx("select", {
|
|
926
|
+
...props,
|
|
927
|
+
id,
|
|
928
|
+
class: {
|
|
929
|
+
hidden: true
|
|
930
|
+
},
|
|
931
|
+
children: values.map((value, i) => {
|
|
932
|
+
return /* @__PURE__ */ jsxRuntime.jsx("option", {
|
|
933
|
+
value: value.value,
|
|
934
|
+
children: `${value.value}`
|
|
935
|
+
}, i);
|
|
936
|
+
})
|
|
937
|
+
}),
|
|
938
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Dropdown, {
|
|
939
|
+
opened: store.opened,
|
|
940
|
+
class: {
|
|
941
|
+
"w-full": true,
|
|
942
|
+
...Class
|
|
943
|
+
},
|
|
944
|
+
onClick$: () => {
|
|
945
|
+
if (!hover) store.opened = !store.opened;
|
|
946
|
+
},
|
|
947
|
+
children: [
|
|
948
|
+
customDropdown && /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
|
|
949
|
+
name: "dropdown"
|
|
950
|
+
}),
|
|
951
|
+
!customDropdown && /* @__PURE__ */ jsxRuntime.jsxs("span", {
|
|
952
|
+
id: `lui-${id}-name`,
|
|
953
|
+
children: [
|
|
954
|
+
values && (values.find((value) => value.value.toString() === store.value)?.name ?? values[0].name),
|
|
955
|
+
!values && /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
|
|
956
|
+
name: "dropdown"
|
|
957
|
+
})
|
|
958
|
+
]
|
|
959
|
+
})
|
|
960
|
+
]
|
|
961
|
+
}),
|
|
962
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
963
|
+
id: `lui-${id}-opts-container`,
|
|
964
|
+
class: {
|
|
965
|
+
"absolute z-[1000] pt-2 transition-all ease-out": true,
|
|
966
|
+
"left-0": align === "left",
|
|
967
|
+
"right-0": align === "right",
|
|
968
|
+
"left-1/2 -translate-x-1/2": align === "center",
|
|
969
|
+
"pointer-events-none scale-95 opacity-0": !store.opened,
|
|
970
|
+
"duration-300 group-hover:pointer-events-auto group-hover:scale-100 group-hover:opacity-100 group-hover:duration-75": hover,
|
|
971
|
+
"focus-within:pointer-events-auto focus-within:scale-100 focus-within:opacity-100 focus-within:duration-75": true
|
|
972
|
+
},
|
|
973
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
974
|
+
id: `lui-${id}-opts`,
|
|
975
|
+
class: {
|
|
976
|
+
"lum-bg-lum-input-bg lum-scroll flex max-h-72 flex-col gap-1 overflow-auto rounded-lum border p-1 select-none motion-safe:transition-all": true
|
|
977
|
+
},
|
|
978
|
+
children: [
|
|
979
|
+
values?.map(({ name, value }, i) => {
|
|
980
|
+
return /* @__PURE__ */ jsxRuntime.jsx("button", {
|
|
981
|
+
type: "button",
|
|
982
|
+
class: {
|
|
983
|
+
"lum-btn lum-bg-transparent rounded-lum-1": true
|
|
984
|
+
},
|
|
985
|
+
onClick$: () => {
|
|
986
|
+
store.opened = false;
|
|
987
|
+
const select = document.getElementById(id);
|
|
988
|
+
if (select) {
|
|
989
|
+
select.value = value.toString();
|
|
990
|
+
select.dispatchEvent(new Event("change"));
|
|
991
|
+
}
|
|
992
|
+
store.value = value.toString();
|
|
993
|
+
},
|
|
994
|
+
children: name
|
|
995
|
+
}, i);
|
|
996
|
+
}),
|
|
997
|
+
/* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
|
|
998
|
+
name: "extra-buttons"
|
|
999
|
+
})
|
|
1000
|
+
]
|
|
1001
|
+
})
|
|
1002
|
+
})
|
|
1003
|
+
]
|
|
1004
|
+
});
|
|
1005
|
+
});
|
|
1006
|
+
const Sidebar = qwik.component$(({ floating, ...props }) => {
|
|
1007
|
+
const menu = qwik.useSignal(false);
|
|
1008
|
+
return /* @__PURE__ */ jsxRuntime.jsx("aside", {
|
|
1009
|
+
...props,
|
|
1010
|
+
class: {
|
|
1011
|
+
"lg:w-100 fixed lg:sticky lum-card top-0 left-0 z-[40] px-0 lg:px-6 pb-0": true,
|
|
1012
|
+
"w-full rounded-none pt-14 lg:pt-20 lg:h-dvh lg:border-y-0 border-l-0": !floating,
|
|
1013
|
+
"mt-16 lg:mt-22 lg:ml-4 pt-4 mx-2 w-[calc(100%-16px)]": floating,
|
|
1014
|
+
...props.class
|
|
1015
|
+
},
|
|
1016
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("nav", {
|
|
1017
|
+
id: "docs-sidebar",
|
|
1018
|
+
class: "min-h-full relative",
|
|
1019
|
+
children: [
|
|
1020
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
1021
|
+
class: "flex items-center gap-3 pb-3 px-2 border-b border-lum-border/10",
|
|
1022
|
+
children: [
|
|
1023
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
1024
|
+
class: "flex-1",
|
|
1025
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
|
|
1026
|
+
name: "title"
|
|
1027
|
+
})
|
|
1028
|
+
}),
|
|
1029
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", {
|
|
1030
|
+
class: "lum-btn lum-bg-transparent p-2 lg:hidden",
|
|
1031
|
+
onClick$: () => {
|
|
1032
|
+
menu.value = !menu.value;
|
|
1033
|
+
const abortController = new AbortController();
|
|
1034
|
+
document.addEventListener("click", (e) => {
|
|
1035
|
+
if (!e.composedPath().includes(document.querySelector("aside")) || e.target instanceof HTMLAnchorElement) {
|
|
1036
|
+
menu.value = false;
|
|
1037
|
+
abortController.abort();
|
|
1038
|
+
}
|
|
1039
|
+
}, {
|
|
1040
|
+
signal: abortController.signal
|
|
1041
|
+
});
|
|
1042
|
+
},
|
|
1043
|
+
"aria-label": "Toggle Menu",
|
|
1044
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Menu, {
|
|
1045
|
+
size: 24
|
|
1046
|
+
})
|
|
1047
|
+
})
|
|
1048
|
+
]
|
|
1049
|
+
}),
|
|
1050
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
1051
|
+
class: {
|
|
1052
|
+
"flex-col gap-3 my-4 mx-4 lg:mx-0": true,
|
|
1053
|
+
"hidden lg:flex": !menu.value,
|
|
1054
|
+
"flex": menu.value
|
|
1055
|
+
},
|
|
1056
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
|
|
1057
|
+
})
|
|
1058
|
+
]
|
|
1059
|
+
})
|
|
1060
|
+
});
|
|
1061
|
+
});
|
|
1006
1062
|
const Toggle = qwik.component$(({ checkbox, round, label, ...props }) => {
|
|
1007
1063
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
1008
1064
|
class: {
|
|
@@ -1517,5 +1573,6 @@ exports.NumberInput = NumberInput;
|
|
|
1517
1573
|
exports.NumberInputRaw = NumberInputRaw;
|
|
1518
1574
|
exports.SelectMenu = SelectMenu;
|
|
1519
1575
|
exports.SelectMenuRaw = SelectMenuRaw;
|
|
1576
|
+
exports.Sidebar = Sidebar;
|
|
1520
1577
|
exports.Toggle = Toggle;
|
|
1521
1578
|
exports.blobColorClasses = blobColorClasses;
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -634,7 +634,7 @@ const Dropdown = component$(({ class: Class, hover, opened, ...props }) => {
|
|
|
634
634
|
return /* @__PURE__ */ jsxs("button", {
|
|
635
635
|
type: "button",
|
|
636
636
|
class: {
|
|
637
|
-
"lum-btn": true,
|
|
637
|
+
"group lum-btn": true,
|
|
638
638
|
...Class
|
|
639
639
|
},
|
|
640
640
|
...props,
|
|
@@ -655,127 +655,6 @@ const Dropdown = component$(({ class: Class, hover, opened, ...props }) => {
|
|
|
655
655
|
]
|
|
656
656
|
});
|
|
657
657
|
});
|
|
658
|
-
const SelectMenu = component$((props) => {
|
|
659
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
660
|
-
class: "flex flex-col",
|
|
661
|
-
children: [
|
|
662
|
-
/* @__PURE__ */ jsx("label", {
|
|
663
|
-
for: props.id,
|
|
664
|
-
class: "pb-1 text-lum-text select-none",
|
|
665
|
-
children: /* @__PURE__ */ jsx(Slot, {})
|
|
666
|
-
}),
|
|
667
|
-
/* @__PURE__ */ jsxs(SelectMenuRaw, {
|
|
668
|
-
...props,
|
|
669
|
-
children: [
|
|
670
|
-
/* @__PURE__ */ jsx("div", {
|
|
671
|
-
"q:slot": "dropdown",
|
|
672
|
-
children: (props.customDropdown || !props.values?.length) && /* @__PURE__ */ jsx(Slot, {
|
|
673
|
-
name: "dropdown"
|
|
674
|
-
})
|
|
675
|
-
}),
|
|
676
|
-
/* @__PURE__ */ jsx("div", {
|
|
677
|
-
"q:slot": "extra-buttons",
|
|
678
|
-
children: /* @__PURE__ */ jsx(Slot, {
|
|
679
|
-
name: "extra-buttons"
|
|
680
|
-
})
|
|
681
|
-
})
|
|
682
|
-
]
|
|
683
|
-
})
|
|
684
|
-
]
|
|
685
|
-
});
|
|
686
|
-
});
|
|
687
|
-
const SelectMenuRaw = component$(({ id, values, class: Class, customDropdown, hover, align, ...props }) => {
|
|
688
|
-
const store = useStore({
|
|
689
|
-
opened: false,
|
|
690
|
-
value: props.value
|
|
691
|
-
});
|
|
692
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
693
|
-
class: {
|
|
694
|
-
"relative touch-manipulation": true,
|
|
695
|
-
group: hover
|
|
696
|
-
},
|
|
697
|
-
children: [
|
|
698
|
-
values && /* @__PURE__ */ jsx("select", {
|
|
699
|
-
...props,
|
|
700
|
-
id,
|
|
701
|
-
class: {
|
|
702
|
-
hidden: true
|
|
703
|
-
},
|
|
704
|
-
children: values.map((value, i) => {
|
|
705
|
-
return /* @__PURE__ */ jsx("option", {
|
|
706
|
-
value: value.value,
|
|
707
|
-
children: `${value.value}`
|
|
708
|
-
}, i);
|
|
709
|
-
})
|
|
710
|
-
}),
|
|
711
|
-
/* @__PURE__ */ jsxs(Dropdown, {
|
|
712
|
-
opened: store.opened,
|
|
713
|
-
class: {
|
|
714
|
-
"w-full": true,
|
|
715
|
-
...Class
|
|
716
|
-
},
|
|
717
|
-
onClick$: () => {
|
|
718
|
-
if (!hover) store.opened = !store.opened;
|
|
719
|
-
},
|
|
720
|
-
children: [
|
|
721
|
-
customDropdown && /* @__PURE__ */ jsx(Slot, {
|
|
722
|
-
name: "dropdown"
|
|
723
|
-
}),
|
|
724
|
-
!customDropdown && /* @__PURE__ */ jsxs("span", {
|
|
725
|
-
id: `lui-${id}-name`,
|
|
726
|
-
children: [
|
|
727
|
-
values && (values.find((value) => value.value.toString() === store.value)?.name ?? values[0].name),
|
|
728
|
-
!values && /* @__PURE__ */ jsx(Slot, {
|
|
729
|
-
name: "dropdown"
|
|
730
|
-
})
|
|
731
|
-
]
|
|
732
|
-
})
|
|
733
|
-
]
|
|
734
|
-
}),
|
|
735
|
-
/* @__PURE__ */ jsx("div", {
|
|
736
|
-
id: `lui-${id}-opts-container`,
|
|
737
|
-
class: {
|
|
738
|
-
"absolute z-[1000] pt-2 transition-all ease-out": true,
|
|
739
|
-
"left-0": align === "left",
|
|
740
|
-
"right-0": align === "right",
|
|
741
|
-
"left-1/2 -translate-x-1/2": align === "center",
|
|
742
|
-
"pointer-events-none scale-95 opacity-0": !store.opened,
|
|
743
|
-
"duration-300 group-hover:pointer-events-auto group-hover:scale-100 group-hover:opacity-100 group-hover:duration-75": hover,
|
|
744
|
-
"focus-within:pointer-events-auto focus-within:scale-100 focus-within:opacity-100 focus-within:duration-75": true
|
|
745
|
-
},
|
|
746
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
747
|
-
id: `lui-${id}-opts`,
|
|
748
|
-
class: {
|
|
749
|
-
"lum-bg-lum-input-bg lum-scroll flex max-h-72 flex-col gap-1 overflow-auto rounded-lum border p-1 select-none motion-safe:transition-all": true
|
|
750
|
-
},
|
|
751
|
-
children: [
|
|
752
|
-
values?.map(({ name, value }, i) => {
|
|
753
|
-
return /* @__PURE__ */ jsx("button", {
|
|
754
|
-
type: "button",
|
|
755
|
-
class: {
|
|
756
|
-
"lum-btn lum-bg-transparent rounded-lum-1": true
|
|
757
|
-
},
|
|
758
|
-
onClick$: () => {
|
|
759
|
-
store.opened = false;
|
|
760
|
-
const select = document.getElementById(id);
|
|
761
|
-
if (select) {
|
|
762
|
-
select.value = value.toString();
|
|
763
|
-
select.dispatchEvent(new Event("change"));
|
|
764
|
-
}
|
|
765
|
-
store.value = value.toString();
|
|
766
|
-
},
|
|
767
|
-
children: name
|
|
768
|
-
}, i);
|
|
769
|
-
}),
|
|
770
|
-
/* @__PURE__ */ jsx(Slot, {
|
|
771
|
-
name: "extra-buttons"
|
|
772
|
-
})
|
|
773
|
-
]
|
|
774
|
-
})
|
|
775
|
-
})
|
|
776
|
-
]
|
|
777
|
-
});
|
|
778
|
-
});
|
|
779
658
|
const Menu = component$(({ size, ...props }) => {
|
|
780
659
|
return /* @__PURE__ */ jsxs("svg", {
|
|
781
660
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1001,6 +880,183 @@ const NumberInputRaw = component$(({ input, onDecrement$, onIncrement$, value =
|
|
|
1001
880
|
]
|
|
1002
881
|
});
|
|
1003
882
|
});
|
|
883
|
+
const SelectMenu = component$((props) => {
|
|
884
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
885
|
+
class: "flex flex-col",
|
|
886
|
+
children: [
|
|
887
|
+
/* @__PURE__ */ jsx("label", {
|
|
888
|
+
for: props.id,
|
|
889
|
+
class: "pb-1 text-lum-text select-none",
|
|
890
|
+
children: /* @__PURE__ */ jsx(Slot, {})
|
|
891
|
+
}),
|
|
892
|
+
/* @__PURE__ */ jsxs(SelectMenuRaw, {
|
|
893
|
+
...props,
|
|
894
|
+
children: [
|
|
895
|
+
/* @__PURE__ */ jsx("div", {
|
|
896
|
+
"q:slot": "dropdown",
|
|
897
|
+
children: (props.customDropdown || !props.values?.length) && /* @__PURE__ */ jsx(Slot, {
|
|
898
|
+
name: "dropdown"
|
|
899
|
+
})
|
|
900
|
+
}),
|
|
901
|
+
/* @__PURE__ */ jsx("div", {
|
|
902
|
+
"q:slot": "extra-buttons",
|
|
903
|
+
children: /* @__PURE__ */ jsx(Slot, {
|
|
904
|
+
name: "extra-buttons"
|
|
905
|
+
})
|
|
906
|
+
})
|
|
907
|
+
]
|
|
908
|
+
})
|
|
909
|
+
]
|
|
910
|
+
});
|
|
911
|
+
});
|
|
912
|
+
const SelectMenuRaw = component$(({ id, values, class: Class, customDropdown, hover, align, ...props }) => {
|
|
913
|
+
const store = useStore({
|
|
914
|
+
opened: false,
|
|
915
|
+
value: props.value
|
|
916
|
+
});
|
|
917
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
918
|
+
class: {
|
|
919
|
+
"relative touch-manipulation": true,
|
|
920
|
+
group: hover
|
|
921
|
+
},
|
|
922
|
+
children: [
|
|
923
|
+
values && /* @__PURE__ */ jsx("select", {
|
|
924
|
+
...props,
|
|
925
|
+
id,
|
|
926
|
+
class: {
|
|
927
|
+
hidden: true
|
|
928
|
+
},
|
|
929
|
+
children: values.map((value, i) => {
|
|
930
|
+
return /* @__PURE__ */ jsx("option", {
|
|
931
|
+
value: value.value,
|
|
932
|
+
children: `${value.value}`
|
|
933
|
+
}, i);
|
|
934
|
+
})
|
|
935
|
+
}),
|
|
936
|
+
/* @__PURE__ */ jsxs(Dropdown, {
|
|
937
|
+
opened: store.opened,
|
|
938
|
+
class: {
|
|
939
|
+
"w-full": true,
|
|
940
|
+
...Class
|
|
941
|
+
},
|
|
942
|
+
onClick$: () => {
|
|
943
|
+
if (!hover) store.opened = !store.opened;
|
|
944
|
+
},
|
|
945
|
+
children: [
|
|
946
|
+
customDropdown && /* @__PURE__ */ jsx(Slot, {
|
|
947
|
+
name: "dropdown"
|
|
948
|
+
}),
|
|
949
|
+
!customDropdown && /* @__PURE__ */ jsxs("span", {
|
|
950
|
+
id: `lui-${id}-name`,
|
|
951
|
+
children: [
|
|
952
|
+
values && (values.find((value) => value.value.toString() === store.value)?.name ?? values[0].name),
|
|
953
|
+
!values && /* @__PURE__ */ jsx(Slot, {
|
|
954
|
+
name: "dropdown"
|
|
955
|
+
})
|
|
956
|
+
]
|
|
957
|
+
})
|
|
958
|
+
]
|
|
959
|
+
}),
|
|
960
|
+
/* @__PURE__ */ jsx("div", {
|
|
961
|
+
id: `lui-${id}-opts-container`,
|
|
962
|
+
class: {
|
|
963
|
+
"absolute z-[1000] pt-2 transition-all ease-out": true,
|
|
964
|
+
"left-0": align === "left",
|
|
965
|
+
"right-0": align === "right",
|
|
966
|
+
"left-1/2 -translate-x-1/2": align === "center",
|
|
967
|
+
"pointer-events-none scale-95 opacity-0": !store.opened,
|
|
968
|
+
"duration-300 group-hover:pointer-events-auto group-hover:scale-100 group-hover:opacity-100 group-hover:duration-75": hover,
|
|
969
|
+
"focus-within:pointer-events-auto focus-within:scale-100 focus-within:opacity-100 focus-within:duration-75": true
|
|
970
|
+
},
|
|
971
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
972
|
+
id: `lui-${id}-opts`,
|
|
973
|
+
class: {
|
|
974
|
+
"lum-bg-lum-input-bg lum-scroll flex max-h-72 flex-col gap-1 overflow-auto rounded-lum border p-1 select-none motion-safe:transition-all": true
|
|
975
|
+
},
|
|
976
|
+
children: [
|
|
977
|
+
values?.map(({ name, value }, i) => {
|
|
978
|
+
return /* @__PURE__ */ jsx("button", {
|
|
979
|
+
type: "button",
|
|
980
|
+
class: {
|
|
981
|
+
"lum-btn lum-bg-transparent rounded-lum-1": true
|
|
982
|
+
},
|
|
983
|
+
onClick$: () => {
|
|
984
|
+
store.opened = false;
|
|
985
|
+
const select = document.getElementById(id);
|
|
986
|
+
if (select) {
|
|
987
|
+
select.value = value.toString();
|
|
988
|
+
select.dispatchEvent(new Event("change"));
|
|
989
|
+
}
|
|
990
|
+
store.value = value.toString();
|
|
991
|
+
},
|
|
992
|
+
children: name
|
|
993
|
+
}, i);
|
|
994
|
+
}),
|
|
995
|
+
/* @__PURE__ */ jsx(Slot, {
|
|
996
|
+
name: "extra-buttons"
|
|
997
|
+
})
|
|
998
|
+
]
|
|
999
|
+
})
|
|
1000
|
+
})
|
|
1001
|
+
]
|
|
1002
|
+
});
|
|
1003
|
+
});
|
|
1004
|
+
const Sidebar = component$(({ floating, ...props }) => {
|
|
1005
|
+
const menu = useSignal(false);
|
|
1006
|
+
return /* @__PURE__ */ jsx("aside", {
|
|
1007
|
+
...props,
|
|
1008
|
+
class: {
|
|
1009
|
+
"lg:w-100 fixed lg:sticky lum-card top-0 left-0 z-[40] px-0 lg:px-6 pb-0": true,
|
|
1010
|
+
"w-full rounded-none pt-14 lg:pt-20 lg:h-dvh lg:border-y-0 border-l-0": !floating,
|
|
1011
|
+
"mt-16 lg:mt-22 lg:ml-4 pt-4 mx-2 w-[calc(100%-16px)]": floating,
|
|
1012
|
+
...props.class
|
|
1013
|
+
},
|
|
1014
|
+
children: /* @__PURE__ */ jsxs("nav", {
|
|
1015
|
+
id: "docs-sidebar",
|
|
1016
|
+
class: "min-h-full relative",
|
|
1017
|
+
children: [
|
|
1018
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1019
|
+
class: "flex items-center gap-3 pb-3 px-2 border-b border-lum-border/10",
|
|
1020
|
+
children: [
|
|
1021
|
+
/* @__PURE__ */ jsx("div", {
|
|
1022
|
+
class: "flex-1",
|
|
1023
|
+
children: /* @__PURE__ */ jsx(Slot, {
|
|
1024
|
+
name: "title"
|
|
1025
|
+
})
|
|
1026
|
+
}),
|
|
1027
|
+
/* @__PURE__ */ jsx("button", {
|
|
1028
|
+
class: "lum-btn lum-bg-transparent p-2 lg:hidden",
|
|
1029
|
+
onClick$: () => {
|
|
1030
|
+
menu.value = !menu.value;
|
|
1031
|
+
const abortController = new AbortController();
|
|
1032
|
+
document.addEventListener("click", (e) => {
|
|
1033
|
+
if (!e.composedPath().includes(document.querySelector("aside")) || e.target instanceof HTMLAnchorElement) {
|
|
1034
|
+
menu.value = false;
|
|
1035
|
+
abortController.abort();
|
|
1036
|
+
}
|
|
1037
|
+
}, {
|
|
1038
|
+
signal: abortController.signal
|
|
1039
|
+
});
|
|
1040
|
+
},
|
|
1041
|
+
"aria-label": "Toggle Menu",
|
|
1042
|
+
children: /* @__PURE__ */ jsx(Menu, {
|
|
1043
|
+
size: 24
|
|
1044
|
+
})
|
|
1045
|
+
})
|
|
1046
|
+
]
|
|
1047
|
+
}),
|
|
1048
|
+
/* @__PURE__ */ jsx("div", {
|
|
1049
|
+
class: {
|
|
1050
|
+
"flex-col gap-3 my-4 mx-4 lg:mx-0": true,
|
|
1051
|
+
"hidden lg:flex": !menu.value,
|
|
1052
|
+
"flex": menu.value
|
|
1053
|
+
},
|
|
1054
|
+
children: /* @__PURE__ */ jsx(Slot, {})
|
|
1055
|
+
})
|
|
1056
|
+
]
|
|
1057
|
+
})
|
|
1058
|
+
});
|
|
1059
|
+
});
|
|
1004
1060
|
const Toggle = component$(({ checkbox, round, label, ...props }) => {
|
|
1005
1061
|
return /* @__PURE__ */ jsxs("div", {
|
|
1006
1062
|
class: {
|
|
@@ -1516,6 +1572,7 @@ export {
|
|
|
1516
1572
|
NumberInputRaw,
|
|
1517
1573
|
SelectMenu,
|
|
1518
1574
|
SelectMenuRaw,
|
|
1575
|
+
Sidebar,
|
|
1519
1576
|
Toggle,
|
|
1520
1577
|
blobColorClasses
|
|
1521
1578
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsOf } from '@builder.io/qwik';
|
|
2
|
+
interface SidebarProps extends Omit<PropsOf<'aside'>, 'class'> {
|
|
3
|
+
class?: {
|
|
4
|
+
[key: string]: boolean;
|
|
5
|
+
};
|
|
6
|
+
floating?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const Sidebar: import("@builder.io/qwik").Component<SidebarProps>;
|
|
9
|
+
export {};
|
|
@@ -2,7 +2,8 @@ export * from './elements/Anchor';
|
|
|
2
2
|
export * from './elements/Blobs';
|
|
3
3
|
export * from './elements/ColorPicker';
|
|
4
4
|
export * from './elements/Dropdown';
|
|
5
|
-
export * from './elements/SelectMenu';
|
|
6
5
|
export * from './elements/Nav';
|
|
7
6
|
export * from './elements/NumberInput';
|
|
7
|
+
export * from './elements/SelectMenu';
|
|
8
|
+
export * from './elements/Sidebar';
|
|
8
9
|
export * from './elements/Toggle';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luminescent/ui-qwik",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0-0",
|
|
4
4
|
"description": "Luminescent UI library",
|
|
5
5
|
"main": "./lib/index.qwik.mjs",
|
|
6
6
|
"qwik": "./lib/index.qwik.mjs",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"vite-tsconfig-paths": "^5.1.4"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@luminescent/ui": "4.
|
|
55
|
+
"@luminescent/ui": "4.3.0-0"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "qwik build",
|