@luminescent/ui-qwik 6.1.1 → 6.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.
@@ -685,8 +685,18 @@ const Menu = qwik.component$(({ size, ...props }) => {
685
685
  ]
686
686
  });
687
687
  });
688
- const Nav = qwik.component$(({ fixed, floating, noblur, nohamburger, colorClass = "lum-bg-lum-card-bg", ...props }) => {
688
+ const Nav = qwik.component$(({ fixed, floating, noblur, nohamburger, nodismiss, colorClass = "lum-bg-lum-card-bg", ...props }) => {
689
689
  const menu = qwik.useSignal(false);
690
+ qwik.useTask$(({ track }) => {
691
+ track(() => menu.value);
692
+ if (menu.value && !nodismiss) {
693
+ const onClick = () => {
694
+ menu.value = false;
695
+ window.removeEventListener("click", onClick);
696
+ };
697
+ window.addEventListener("click", onClick);
698
+ }
699
+ });
690
700
  return /* @__PURE__ */ jsxRuntime.jsxs("nav", {
691
701
  ...props,
692
702
  class: {
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "@builder.io/qwik/jsx-runtime";
2
- import { component$, Slot, useStore, $, useSignal, useStyles$ } from "@builder.io/qwik";
2
+ import { component$, Slot, useStore, $, useSignal, useTask$, useStyles$ } from "@builder.io/qwik";
3
3
  const Link = component$(({ size, ...props }) => {
4
4
  return /* @__PURE__ */ jsxs("svg", {
5
5
  xmlns: "http://www.w3.org/2000/svg",
@@ -683,8 +683,18 @@ const Menu = component$(({ size, ...props }) => {
683
683
  ]
684
684
  });
685
685
  });
686
- const Nav = component$(({ fixed, floating, noblur, nohamburger, colorClass = "lum-bg-lum-card-bg", ...props }) => {
686
+ const Nav = component$(({ fixed, floating, noblur, nohamburger, nodismiss, colorClass = "lum-bg-lum-card-bg", ...props }) => {
687
687
  const menu = useSignal(false);
688
+ useTask$(({ track }) => {
689
+ track(() => menu.value);
690
+ if (menu.value && !nodismiss) {
691
+ const onClick = () => {
692
+ menu.value = false;
693
+ window.removeEventListener("click", onClick);
694
+ };
695
+ window.addEventListener("click", onClick);
696
+ }
697
+ });
688
698
  return /* @__PURE__ */ jsxs("nav", {
689
699
  ...props,
690
700
  class: {
@@ -7,6 +7,7 @@ interface NavProps extends Omit<PropsOf<'nav'>, 'class'> {
7
7
  floating?: boolean;
8
8
  noblur?: boolean;
9
9
  nohamburger?: boolean;
10
+ nodismiss?: boolean;
10
11
  colorClass?: string;
11
12
  }
12
13
  export declare const Nav: import("@builder.io/qwik").Component<NavProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminescent/ui-qwik",
3
- "version": "6.1.1",
3
+ "version": "6.2.0",
4
4
  "description": "Luminescent UI library - Qwik",
5
5
  "main": "./lib/index.qwik.mjs",
6
6
  "qwik": "./lib/index.qwik.mjs",
@@ -50,7 +50,7 @@
50
50
  "vite-tsconfig-paths": "^5.1.4"
51
51
  },
52
52
  "peerDependencies": {
53
- "@luminescent/ui": "6.1.1"
53
+ "@luminescent/ui": "6.2.0"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "qwik build",