@nr1e/qwik-ui 0.0.2 → 0.0.3

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.
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
4
+ const qwik = require("@builder.io/qwik");
5
+ const PaceBar = qwik.component$((props) => {
6
+ const value = qwik.useSignal(props.value);
7
+ qwik.useVisibleTask$(({ cleanup }) => {
8
+ if (props.value && props.value != -1 && props.asymptotic) {
9
+ const easing = props.easing ?? 4e-3;
10
+ const intervalMs = props.intervalMs ?? 10;
11
+ const id = setInterval(() => {
12
+ const delta = (100 - (value.value ?? 0)) * easing;
13
+ if (delta < 1e-4) {
14
+ clearInterval(id);
15
+ return;
16
+ }
17
+ value.value = (value.value ?? 0) + delta;
18
+ if (value.value >= 100) value.value = 99.999999;
19
+ }, intervalMs);
20
+ cleanup(() => clearInterval(id));
21
+ }
22
+ });
23
+ return /* @__PURE__ */ jsxRuntime.jsx("progress", {
24
+ class: `progress w-full ${value.value ? "block" : "hidden"} h-0.5 leading-none ${props.class}`,
25
+ value: value.value && value.value < 0 ? void 0 : value.value,
26
+ max: 100
27
+ });
28
+ });
29
+ exports.PaceBar = PaceBar;
@@ -0,0 +1,29 @@
1
+ import { jsx } from "@builder.io/qwik/jsx-runtime";
2
+ import { component$, useSignal, useVisibleTask$ } from "@builder.io/qwik";
3
+ const PaceBar = component$((props) => {
4
+ const value = useSignal(props.value);
5
+ useVisibleTask$(({ cleanup }) => {
6
+ if (props.value && props.value != -1 && props.asymptotic) {
7
+ const easing = props.easing ?? 4e-3;
8
+ const intervalMs = props.intervalMs ?? 10;
9
+ const id = setInterval(() => {
10
+ const delta = (100 - (value.value ?? 0)) * easing;
11
+ if (delta < 1e-4) {
12
+ clearInterval(id);
13
+ return;
14
+ }
15
+ value.value = (value.value ?? 0) + delta;
16
+ if (value.value >= 100) value.value = 99.999999;
17
+ }, intervalMs);
18
+ cleanup(() => clearInterval(id));
19
+ }
20
+ });
21
+ return /* @__PURE__ */ jsx("progress", {
22
+ class: `progress w-full ${value.value ? "block" : "hidden"} h-0.5 leading-none ${props.class}`,
23
+ value: value.value && value.value < 0 ? void 0 : value.value,
24
+ max: 100
25
+ });
26
+ });
27
+ export {
28
+ PaceBar
29
+ };
@@ -1 +1,4 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const paceBar = require("./components/pace-bar.qwik.cjs");
4
+ exports.PaceBar = paceBar.PaceBar;
@@ -1 +1,4 @@
1
-
1
+ import { PaceBar } from "./components/pace-bar.qwik.mjs";
2
+ export {
3
+ PaceBar
4
+ };
@@ -0,0 +1 @@
1
+ export * from './components/pace-bar';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nr1e/qwik-ui",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "NR1E Qwik UI Library",
5
5
  "author": "NR1E, Inc.",
6
6
  "publishConfig": {