@kashifd/jwero-components 0.7.23 → 0.7.25

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/dist/index.es.js CHANGED
@@ -58239,36 +58239,41 @@ const uz = ({ name: e, data: t, labels: r }) => {
58239
58239
  width: "100%"
58240
58240
  }
58241
58241
  );
58242
- }, dz = (e) => {
58242
+ }, dz = (e, t) => {
58243
+ if (t) {
58244
+ const r = e.toFixed(2);
58245
+ return r.endsWith(".00") ? `${Math.floor(e)}%` : `${r}%`;
58246
+ }
58243
58247
  if (e >= 1e9) {
58244
- const t = (e / 1e9).toFixed(2);
58245
- return t.endsWith(".00") ? `${Math.floor(e / 1e9)}B` : t + "B";
58248
+ const r = (e / 1e9).toFixed(2);
58249
+ return r.endsWith(".00") ? `${Math.floor(e / 1e9)}B` : r + "B";
58246
58250
  }
58247
58251
  if (e >= 1e6) {
58248
- const t = (e / 1e6).toFixed(2);
58249
- return t.endsWith(".00") ? `${Math.floor(e / 1e6)}M` : t + "M";
58252
+ const r = (e / 1e6).toFixed(2);
58253
+ return r.endsWith(".00") ? `${Math.floor(e / 1e6)}M` : r + "M";
58250
58254
  }
58251
58255
  if (e >= 1e3) {
58252
- const t = (e / 1e3).toFixed(2);
58253
- return t.endsWith(".00") ? `${Math.floor(e / 1e3)}k` : t + "k";
58256
+ const r = (e / 1e3).toFixed(2);
58257
+ return r.endsWith(".00") ? `${Math.floor(e / 1e3)}k` : r + "k";
58254
58258
  }
58255
58259
  return e.toString();
58256
58260
  }, fz = ({
58257
58261
  value: e,
58258
58262
  duration: t = 1500,
58259
- styles: r
58263
+ styles: r,
58264
+ isPercentage: a = !1
58260
58265
  }) => {
58261
- const [a, s] = _r("0"), c = ui(null), d = ui();
58262
- return Si(() => {
58263
- const m = e - 0, v = (w) => {
58264
- c.current || (c.current = w);
58265
- const T = w - c.current, O = Math.min(T / t, 1), P = Math.floor(0 + m * O);
58266
- s(dz(P)), O < 1 && (d.current = requestAnimationFrame(v));
58266
+ const [s, c] = _r("0"), d = ui(null), g = ui();
58267
+ return console.log("value", e), Si(() => {
58268
+ const v = e - 0, w = (T) => {
58269
+ d.current || (d.current = T);
58270
+ const O = T - d.current, P = Math.min(O / t, 1), I = Math.floor(0 + v * P), j = e >= 1 ? dz(I, a) : (e == null ? void 0 : e.toString()) + (a ? "%" : "");
58271
+ console.log(e, e > 0, j), c(j), P < 1 && (g.current = requestAnimationFrame(w));
58267
58272
  };
58268
- return d.current = requestAnimationFrame(v), () => {
58269
- cancelAnimationFrame(d.current), c.current = null;
58273
+ return g.current = requestAnimationFrame(w), () => {
58274
+ cancelAnimationFrame(g.current), d.current = null;
58270
58275
  };
58271
- }, [e, t]), /* @__PURE__ */ b.jsx(
58276
+ }, [e, t, a]), /* @__PURE__ */ b.jsx(
58272
58277
  "span",
58273
58278
  {
58274
58279
  style: {
@@ -58278,7 +58283,7 @@ const uz = ({ name: e, data: t, labels: r }) => {
58278
58283
  transition: "transform 0.3s ease-out",
58279
58284
  ...r
58280
58285
  },
58281
- children: a
58286
+ children: s
58282
58287
  }
58283
58288
  );
58284
58289
  }, hz = (e, t, r) => {
@@ -58308,7 +58313,7 @@ const uz = ({ name: e, data: t, labels: r }) => {
58308
58313
  );
58309
58314
  P(z > 200 * 0.5);
58310
58315
  }
58311
- }, [(I = e == null ? void 0 : e.customChipProps) == null ? void 0 : I.label]), /* @__PURE__ */ b.jsxs(
58316
+ }, [(I = e == null ? void 0 : e.customChipProps) == null ? void 0 : I.label]), console.log(e.total_number, Number(e.total_number)), /* @__PURE__ */ b.jsxs(
58312
58317
  $t,
58313
58318
  {
58314
58319
  sx: {
@@ -58340,7 +58345,13 @@ const uz = ({ name: e, data: t, labels: r }) => {
58340
58345
  alignItems: "flex-start"
58341
58346
  },
58342
58347
  children: [
58343
- v != null && v.flag ? /* @__PURE__ */ b.jsx(fz, { value: Number(e == null ? void 0 : e.total_number) }) : /* @__PURE__ */ b.jsx(vt, { variant: "xxlSemibold", ...c, children: e == null ? void 0 : e.total_number }),
58348
+ v != null && v.flag ? /* @__PURE__ */ b.jsx(
58349
+ fz,
58350
+ {
58351
+ value: Number(e == null ? void 0 : e.total_number),
58352
+ isPercentage: e == null ? void 0 : e.is_percentage
58353
+ }
58354
+ ) : /* @__PURE__ */ b.jsx(vt, { variant: "xxlSemibold", ...c, children: e == null ? void 0 : e.total_number }),
58344
58355
  (t || a && (e == null ? void 0 : e.subData)) && /* @__PURE__ */ b.jsxs(Ye, { sx: { gap: "0.75rem", width: "100%" }, children: [
58345
58356
  t && /* @__PURE__ */ b.jsx(
58346
58357
  lo,