@luminescent/ui-qwik 5.0.1 → 5.2.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.
@@ -586,6 +586,7 @@ const ColorPicker = qwik.component$(({ id, value = "#000000", colors = [
586
586
  colors.map((color, i) => {
587
587
  return /* @__PURE__ */ jsxRuntime.jsx("button", {
588
588
  type: "button",
589
+ name: color,
589
590
  class: {
590
591
  "lum-btn rounded-sm h-[1.6rem] w-[1.6rem] border-2 border-white/30 p-0 hover:border-white": true
591
592
  },
@@ -601,6 +602,7 @@ const ColorPicker = qwik.component$(({ id, value = "#000000", colors = [
601
602
  /* @__PURE__ */ jsxRuntime.jsx("button", {
602
603
  type: "button",
603
604
  class: "lum-btn rounded-sm h-[1.6rem] w-[1.6rem] p-0.5",
605
+ name: "Randomize",
604
606
  onClick$: async () => {
605
607
  const color = `#${Math.floor(Math.random() * 16777215).toString(16)}`;
606
608
  await setColor(color);
@@ -742,6 +744,7 @@ const Nav = qwik.component$(({ fixed, floating, noblur, nohamburger, colorClass
742
744
  name: "end"
743
745
  }),
744
746
  !nohamburger && /* @__PURE__ */ jsxRuntime.jsx("button", {
747
+ name: "Navigation Menu",
745
748
  class: "lum-btn lum-bg-transparent p-2 sm:hidden",
746
749
  onClick$: () => menu.value = !menu.value,
747
750
  children: /* @__PURE__ */ jsxRuntime.jsx(Menu, {
@@ -905,12 +908,13 @@ const SelectMenu = qwik.component$((props) => {
905
908
  ]
906
909
  });
907
910
  });
908
- const SelectMenuRaw = qwik.component$(({ values, class: Class, panelClass = "lum-bg-lum-input-bg", btnClass = "lum-bg-transparent", noblur, customDropdown, hover, align, ...props }) => {
911
+ const SelectMenuRaw = qwik.component$(({ values, class: Class, panelClass = "lum-bg-lum-input-bg", btnClass = "lum-bg-transparent", noblur, nocloseonclick, customDropdown, hover, align, ...props }) => {
909
912
  const store = qwik.useStore({
910
913
  opened: false,
911
914
  value: props.value
912
915
  });
913
916
  const selectRef = qwik.useSignal();
917
+ const selected = values?.find((v) => v.value === store.value);
914
918
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
915
919
  class: {
916
920
  "relative touch-manipulation": true,
@@ -934,21 +938,26 @@ const SelectMenuRaw = qwik.component$(({ values, class: Class, panelClass = "lum
934
938
  "w-full": true,
935
939
  ...Class
936
940
  },
937
- onClick$: () => {
938
- if (!hover) store.opened = !store.opened;
941
+ onClick$: (e, el) => {
942
+ if (hover) return;
943
+ store.opened = !store.opened;
944
+ if (nocloseonclick) return;
945
+ const listener = (e2) => {
946
+ if (!store.opened) return document.removeEventListener("click", listener);
947
+ const path = e2.composedPath();
948
+ if (path.includes(el)) return;
949
+ store.opened = false;
950
+ document.removeEventListener("click", listener);
951
+ };
952
+ document.addEventListener("click", listener);
939
953
  },
940
954
  children: [
941
955
  customDropdown && /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
942
956
  name: "dropdown"
943
957
  }),
944
- !customDropdown && /* @__PURE__ */ jsxRuntime.jsxs("span", {
945
- children: [
946
- values && (values.find((value) => value.value.toString() === store.value)?.name ?? values[0].name),
947
- !values && /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
948
- name: "dropdown"
949
- })
950
- ]
951
- })
958
+ !customDropdown && (selected?.name ?? values?.[0]?.name ?? /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {
959
+ name: "dropdown"
960
+ }))
952
961
  ]
953
962
  }),
954
963
  hover && /* @__PURE__ */ jsxRuntime.jsx("div", {
@@ -975,7 +984,8 @@ const SelectMenuRaw = qwik.component$(({ values, class: Class, panelClass = "lum
975
984
  "lum-btn rounded-lum-1": true,
976
985
  [btnClass]: true
977
986
  },
978
- onClick$: () => {
987
+ onClick$: (e, el) => {
988
+ el.blur();
979
989
  store.opened = false;
980
990
  const select = selectRef.value;
981
991
  if (select) {
@@ -1027,7 +1037,7 @@ const Sidebar = qwik.component$(({ position, ...props }) => {
1027
1037
  })
1028
1038
  });
1029
1039
  });
1030
- const Toggle = qwik.component$(({ checkbox, round, label, ...props }) => {
1040
+ const Toggle = qwik.component$(({ checkbox, round, ...props }) => {
1031
1041
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
1032
1042
  class: "flex touch-manipulation items-center gap-3",
1033
1043
  children: [
@@ -1053,10 +1063,10 @@ const Toggle = qwik.component$(({ checkbox, round, label, ...props }) => {
1053
1063
  })
1054
1064
  ]
1055
1065
  }),
1056
- label && /* @__PURE__ */ jsxRuntime.jsx("label", {
1066
+ /* @__PURE__ */ jsxRuntime.jsx("label", {
1057
1067
  for: props.id,
1058
- class: "flex gap-2 text-lum-text select-none",
1059
- children: label
1068
+ class: "flex gap-2 text-lum-text select-none empty:hidden",
1069
+ children: /* @__PURE__ */ jsxRuntime.jsx(qwik.Slot, {})
1060
1070
  })
1061
1071
  ]
1062
1072
  });
@@ -584,6 +584,7 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
584
584
  colors.map((color, i) => {
585
585
  return /* @__PURE__ */ jsx("button", {
586
586
  type: "button",
587
+ name: color,
587
588
  class: {
588
589
  "lum-btn rounded-sm h-[1.6rem] w-[1.6rem] border-2 border-white/30 p-0 hover:border-white": true
589
590
  },
@@ -599,6 +600,7 @@ const ColorPicker = component$(({ id, value = "#000000", colors = [
599
600
  /* @__PURE__ */ jsx("button", {
600
601
  type: "button",
601
602
  class: "lum-btn rounded-sm h-[1.6rem] w-[1.6rem] p-0.5",
603
+ name: "Randomize",
602
604
  onClick$: async () => {
603
605
  const color = `#${Math.floor(Math.random() * 16777215).toString(16)}`;
604
606
  await setColor(color);
@@ -740,6 +742,7 @@ const Nav = component$(({ fixed, floating, noblur, nohamburger, colorClass = "lu
740
742
  name: "end"
741
743
  }),
742
744
  !nohamburger && /* @__PURE__ */ jsx("button", {
745
+ name: "Navigation Menu",
743
746
  class: "lum-btn lum-bg-transparent p-2 sm:hidden",
744
747
  onClick$: () => menu.value = !menu.value,
745
748
  children: /* @__PURE__ */ jsx(Menu, {
@@ -903,12 +906,13 @@ const SelectMenu = component$((props) => {
903
906
  ]
904
907
  });
905
908
  });
906
- const SelectMenuRaw = component$(({ values, class: Class, panelClass = "lum-bg-lum-input-bg", btnClass = "lum-bg-transparent", noblur, customDropdown, hover, align, ...props }) => {
909
+ const SelectMenuRaw = component$(({ values, class: Class, panelClass = "lum-bg-lum-input-bg", btnClass = "lum-bg-transparent", noblur, nocloseonclick, customDropdown, hover, align, ...props }) => {
907
910
  const store = useStore({
908
911
  opened: false,
909
912
  value: props.value
910
913
  });
911
914
  const selectRef = useSignal();
915
+ const selected = values?.find((v) => v.value === store.value);
912
916
  return /* @__PURE__ */ jsxs("div", {
913
917
  class: {
914
918
  "relative touch-manipulation": true,
@@ -932,21 +936,26 @@ const SelectMenuRaw = component$(({ values, class: Class, panelClass = "lum-bg-l
932
936
  "w-full": true,
933
937
  ...Class
934
938
  },
935
- onClick$: () => {
936
- if (!hover) store.opened = !store.opened;
939
+ onClick$: (e, el) => {
940
+ if (hover) return;
941
+ store.opened = !store.opened;
942
+ if (nocloseonclick) return;
943
+ const listener = (e2) => {
944
+ if (!store.opened) return document.removeEventListener("click", listener);
945
+ const path = e2.composedPath();
946
+ if (path.includes(el)) return;
947
+ store.opened = false;
948
+ document.removeEventListener("click", listener);
949
+ };
950
+ document.addEventListener("click", listener);
937
951
  },
938
952
  children: [
939
953
  customDropdown && /* @__PURE__ */ jsx(Slot, {
940
954
  name: "dropdown"
941
955
  }),
942
- !customDropdown && /* @__PURE__ */ jsxs("span", {
943
- children: [
944
- values && (values.find((value) => value.value.toString() === store.value)?.name ?? values[0].name),
945
- !values && /* @__PURE__ */ jsx(Slot, {
946
- name: "dropdown"
947
- })
948
- ]
949
- })
956
+ !customDropdown && (selected?.name ?? values?.[0]?.name ?? /* @__PURE__ */ jsx(Slot, {
957
+ name: "dropdown"
958
+ }))
950
959
  ]
951
960
  }),
952
961
  hover && /* @__PURE__ */ jsx("div", {
@@ -973,7 +982,8 @@ const SelectMenuRaw = component$(({ values, class: Class, panelClass = "lum-bg-l
973
982
  "lum-btn rounded-lum-1": true,
974
983
  [btnClass]: true
975
984
  },
976
- onClick$: () => {
985
+ onClick$: (e, el) => {
986
+ el.blur();
977
987
  store.opened = false;
978
988
  const select = selectRef.value;
979
989
  if (select) {
@@ -1025,7 +1035,7 @@ const Sidebar = component$(({ position, ...props }) => {
1025
1035
  })
1026
1036
  });
1027
1037
  });
1028
- const Toggle = component$(({ checkbox, round, label, ...props }) => {
1038
+ const Toggle = component$(({ checkbox, round, ...props }) => {
1029
1039
  return /* @__PURE__ */ jsxs("div", {
1030
1040
  class: "flex touch-manipulation items-center gap-3",
1031
1041
  children: [
@@ -1051,10 +1061,10 @@ const Toggle = component$(({ checkbox, round, label, ...props }) => {
1051
1061
  })
1052
1062
  ]
1053
1063
  }),
1054
- label && /* @__PURE__ */ jsx("label", {
1064
+ /* @__PURE__ */ jsx("label", {
1055
1065
  for: props.id,
1056
- class: "flex gap-2 text-lum-text select-none",
1057
- children: label
1066
+ class: "flex gap-2 text-lum-text select-none empty:hidden",
1067
+ children: /* @__PURE__ */ jsx(Slot, {})
1058
1068
  })
1059
1069
  ]
1060
1070
  });
@@ -6,6 +6,7 @@ interface SelectMenuProps extends Omit<PropsOf<'select'>, 'class' | 'size'> {
6
6
  panelClass?: string;
7
7
  btnClass?: string;
8
8
  noblur?: boolean;
9
+ nocloseonclick?: boolean;
9
10
  customDropdown?: boolean;
10
11
  hover?: boolean;
11
12
  align?: 'left' | 'right' | 'center';
@@ -1,11 +1,10 @@
1
- import type { JSXOutput, PropsOf } from '@builder.io/qwik';
1
+ import type { PropsOf } from '@builder.io/qwik';
2
2
  interface ToggleProps extends Omit<PropsOf<'input'> & {
3
3
  type: 'checkbox';
4
4
  }, 'class' | 'bind:checked' | 'type' | 'children'> {
5
5
  class?: string;
6
6
  checkbox?: boolean;
7
7
  round?: boolean;
8
- label?: string | JSXOutput;
9
8
  }
10
9
  export declare const Toggle: import("@builder.io/qwik").Component<ToggleProps>;
11
10
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminescent/ui-qwik",
3
- "version": "5.0.1",
3
+ "version": "5.2.0",
4
4
  "description": "Luminescent UI library - Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",
@@ -32,25 +32,25 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@anuragroy/tailwindcss-animate": "^1.0.6",
35
- "@builder.io/qwik": "1.14.1",
36
- "@builder.io/qwik-city": "^1.14.1",
37
- "@eslint/js": "^9.30.1",
35
+ "@builder.io/qwik": "1.15.0",
36
+ "@builder.io/qwik-city": "^1.15.0",
37
+ "@eslint/js": "^9.32.0",
38
38
  "@tailwindcss/vite": "^4.1.11",
39
39
  "@types/eslint": "^9.6.1",
40
- "@types/node": "^24.0.10",
41
- "eslint": "^9.30.1",
42
- "eslint-plugin-qwik": "^1.14.1",
40
+ "@types/node": "^24.1.0",
41
+ "eslint": "^9.32.0",
42
+ "eslint-plugin-qwik": "^1.15.0",
43
43
  "globals": "^16.3.0",
44
44
  "prettier": "^3.6.2",
45
- "prettier-plugin-tailwindcss": "^0.6.13",
45
+ "prettier-plugin-tailwindcss": "^0.6.14",
46
46
  "tailwindcss": "4.1.11",
47
47
  "typescript": "5.8.3",
48
- "typescript-eslint": "^8.35.1",
48
+ "typescript-eslint": "^8.38.0",
49
49
  "vite": "5.4.14",
50
50
  "vite-tsconfig-paths": "^5.1.4"
51
51
  },
52
52
  "peerDependencies": {
53
- "@luminescent/ui": "5.0.1"
53
+ "@luminescent/ui": "5.2.0"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "qwik build",