@nr1e/qwik-ui 0.0.34 → 0.0.35
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.
|
@@ -3,7 +3,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
|
|
4
4
|
const qwik = require("@builder.io/qwik");
|
|
5
5
|
const AutoDismiss = qwik.component$((props) => {
|
|
6
|
-
if (props?.
|
|
6
|
+
if (props?.visible && !props.visible.value) return null;
|
|
7
|
+
qwik.useVisibleTask$(({ cleanup }) => {
|
|
8
|
+
const id = setTimeout(() => {
|
|
9
|
+
if (props?.visible) props.visible.value = false;
|
|
10
|
+
}, 6e3);
|
|
11
|
+
cleanup(() => clearTimeout(id));
|
|
12
|
+
});
|
|
7
13
|
return /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
8
14
|
class: [
|
|
9
15
|
"animate-fade animate-reverse animate-ease-in animate-duration-1000 animate-delay-5000",
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { jsx } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
-
import { component$, Slot } from "@builder.io/qwik";
|
|
2
|
+
import { component$, useVisibleTask$, Slot } from "@builder.io/qwik";
|
|
3
3
|
const AutoDismiss = component$((props) => {
|
|
4
|
-
if (props?.
|
|
4
|
+
if (props?.visible && !props.visible.value) return null;
|
|
5
|
+
useVisibleTask$(({ cleanup }) => {
|
|
6
|
+
const id = setTimeout(() => {
|
|
7
|
+
if (props?.visible) props.visible.value = false;
|
|
8
|
+
}, 6e3);
|
|
9
|
+
cleanup(() => clearTimeout(id));
|
|
10
|
+
});
|
|
5
11
|
return /* @__PURE__ */ jsx("div", {
|
|
6
12
|
class: [
|
|
7
13
|
"animate-fade animate-reverse animate-ease-in animate-duration-1000 animate-delay-5000",
|