@memobit/libs 3.12.1 → 3.12.2

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.
@@ -2,8 +2,8 @@ import './ErrorBoundary.css';
2
2
  import { EmptyState as s } from "../EmptyState/EmptyState2.js";
3
3
  /* empty css */
4
4
  import { Component as a } from "react";
5
+ import { logger as c } from "@memobit/core";
5
6
  import { jsx as o } from "react/jsx-runtime";
6
- import { reportError as c } from "@memobit/core";
7
7
  var h = class extends a {
8
8
  constructor(...r) {
9
9
  super(...r), this.state = { error: null }, this.reset = () => {
@@ -14,7 +14,7 @@ var h = class extends a {
14
14
  return { error: r };
15
15
  }
16
16
  componentDidCatch(r, t) {
17
- c(r, { componentStack: t.componentStack ?? void 0 }), console.error("ErrorBoundary caught:", r, t.componentStack), this.props.onError?.(r, t);
17
+ c.error("ErrorBoundary caught an error", r, { componentStack: t.componentStack ?? void 0 }), this.props.onError?.(r, t);
18
18
  }
19
19
  render() {
20
20
  const { error: r } = this.state, { children: t, title: n, resetLabel: i, fallback: e } = this.props;
@@ -1,43 +1,44 @@
1
1
  import './Icon.css';
2
2
  /* empty css */
3
3
  import { useEffect as g, useState as I } from "react";
4
- import { canLoadMoreIcons as n, getIcon as y, loadIcon as N } from "@memobit/icons/map";
5
- import { jsx as $ } from "react/jsx-runtime";
6
- var c = /* @__PURE__ */ new Set(), a = (o) => {
7
- c.has(o) || (c.add(o), console.warn(n ? `[@memobit/libs] No icon named "${o}".` : `[@memobit/libs] No icon named "${o}". If this app trims icons with @memobit/icons/vite, add it to the plugin's \`include\` option or use \`lazy\` — a name that only exists at runtime cannot be found by the source scan.`));
8
- }, S = ({ className: o = "", fade: l, fadeOnHover: d, name: e, pulse: u, pulseOnHover: f, size: r, spin: p, spinOnHover: h, variant: t }) => {
9
- const m = [
4
+ import { logger as y } from "@memobit/core";
5
+ import { canLoadMoreIcons as n, getIcon as N, loadIcon as w } from "@memobit/icons/map";
6
+ import { jsx as x } from "react/jsx-runtime";
7
+ var c = /* @__PURE__ */ new Set(), a = (e) => {
8
+ c.has(e) || (c.add(e), y.warn(n ? "[@memobit/libs] No icon named <name>." : "[@memobit/libs] No icon named <name>. If this app trims icons with @memobit/icons/vite, add it to the plugin's `include` option or use `lazy` — a name that only exists at runtime cannot be found by the source scan.", { name: e }));
9
+ }, C = ({ className: e = "", fade: l, fadeOnHover: d, name: o, pulse: u, pulseOnHover: f, size: r, spin: p, spinOnHover: m, variant: t }) => {
10
+ const h = [
10
11
  "icon",
11
12
  r ? `icon--${r}` : "",
12
13
  t && t !== "default" ? `icon--${t}` : "",
13
14
  p ? "icon--spin" : "",
14
15
  l ? "icon--fade" : "",
15
16
  u ? "icon--pulse" : "",
16
- h ? "icon--spin-hover" : "",
17
+ m ? "icon--spin-hover" : "",
17
18
  d ? "icon--fade-hover" : "",
18
19
  f ? "icon--pulse-hover" : "",
19
- o
20
- ].filter(Boolean).join(" "), [, v] = I(null), i = y(e);
20
+ e
21
+ ].filter(Boolean).join(" "), [, v] = I(null), i = N(o);
21
22
  return g(() => {
22
23
  if (i !== void 0 || !n) return;
23
24
  let s = !0;
24
- return N(e).then((b) => {
25
+ return w(o).then((b) => {
25
26
  if (s) {
26
27
  if (b === void 0) {
27
- a(e);
28
+ a(o);
28
29
  return;
29
30
  }
30
- v(e);
31
+ v(o);
31
32
  }
32
33
  }, () => {
33
34
  }), () => {
34
35
  s = !1;
35
36
  };
36
- }, [i, e]), i === void 0 && !n && a(e), /* @__PURE__ */ $("span", {
37
- className: m,
37
+ }, [i, o]), i === void 0 && !n && a(o), /* @__PURE__ */ x("span", {
38
+ className: h,
38
39
  children: i
39
40
  });
40
41
  };
41
42
  export {
42
- S as Icon
43
+ C as Icon
43
44
  };
@@ -3,8 +3,8 @@ import { Modal as x } from "../Modal/Modal2.js";
3
3
  import { Radio as C } from "../Radio/Radio2.js";
4
4
  /* empty css */
5
5
  import { useEffect as S, useState as n } from "react";
6
- import { jsx as a, jsxs as b } from "react/jsx-runtime";
7
- import { logger as q } from "@memobit/core";
6
+ import { logger as b } from "@memobit/core";
7
+ import { jsx as a, jsxs as q } from "react/jsx-runtime";
8
8
  var U = ({ isOpen: m = !1, list: c, title: f, onClose: t, onSave: u, icon: v, value: i }) => {
9
9
  const [r, l] = n(i), [s, d] = n(!1), [p, o] = n("");
10
10
  S(() => {
@@ -24,11 +24,11 @@ var U = ({ isOpen: m = !1, list: c, title: f, onClose: t, onSave: u, icon: v, va
24
24
  d(!1);
25
25
  }
26
26
  }, h = (e) => {
27
- typeof e == "string" || typeof e == "number" ? l(e) : q.error("QuickOptionUpdate received an unsupported value type", void 0, { type: typeof e });
27
+ typeof e == "string" || typeof e == "number" ? l(e) : b.error("QuickOptionUpdate received an unsupported value type", void 0, { type: typeof e });
28
28
  };
29
29
  return /* @__PURE__ */ a("div", {
30
30
  className: "quick-set",
31
- children: /* @__PURE__ */ b(x, {
31
+ children: /* @__PURE__ */ q(x, {
32
32
  isOpen: m,
33
33
  titleIcon: v,
34
34
  title: f,
@@ -1,8 +1,8 @@
1
1
  import { HttpMethod as o, buildRequestHeaders as A } from "../../helpers/Http.js";
2
2
  import { AuthContext as U } from "./AuthContext.context.js";
3
3
  import { useCallback as i, useEffect as j, useState as c } from "react";
4
- import { jsx as B } from "react/jsx-runtime";
5
4
  import { logger as h } from "@memobit/core";
5
+ import { jsx as B } from "react/jsx-runtime";
6
6
  function C({ children: f, config: a }) {
7
7
  const [d, u] = c(null), [p, s] = c(!0);
8
8
  j(() => {
@@ -1,4 +1,8 @@
1
- var o = (r) => Number((typeof r == "number" ? r : Number(r)).toFixed(2)), a = (r, e) => (r > e && console.warn(`Could not get percent of value ${r} from a total ${e}. Total must be higher or at least equal to value.`), r === e ? r === 0 ? 0 : 100 : r / (e / 100)), n = (r, e) => {
1
+ import { logger as n } from "@memobit/core";
2
+ var m = (r) => Number((typeof r == "number" ? r : Number(r)).toFixed(2)), o = (r, e) => (r > e && n.warn("getPercent: value is higher than total", {
3
+ value: r,
4
+ total: e
5
+ }), r === e ? r === 0 ? 0 : 100 : r / (e / 100)), a = (r, e) => {
2
6
  const t = r + e;
3
7
  return t === 0 ? {
4
8
  a: 0,
@@ -7,10 +11,10 @@ var o = (r) => Number((typeof r == "number" ? r : Number(r)).toFixed(2)), a = (r
7
11
  a: Math.round(r / t * 100 * 10) / 10,
8
12
  b: Math.round(e / t * 100 * 10) / 10
9
13
  };
10
- }, m = (r, e, t) => Math.min(t, Math.max(e, r));
14
+ }, f = (r, e, t) => Math.min(t, Math.max(e, r));
11
15
  export {
12
- m as clamp,
13
- o as format2Digits,
14
- a as getPercent,
15
- n as getPercentsOf2Numbers
16
+ f as clamp,
17
+ m as format2Digits,
18
+ o as getPercent,
19
+ a as getPercentsOf2Numbers
16
20
  };
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 517,
26
+ libBuildNumber: 520,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
- var I = "3.12.1", B = 517, L = "020f557", _ = "2026-10-17T06:11:23.897Z", r = "517";
1
+ var I = "3.12.2", B = 520, L = "4308de2", _ = "2026-10-17T07:54:26.042Z", r = "520";
2
2
  export {
3
3
  _ as LIB_BUILD_DATE,
4
4
  r as LIB_BUILD_ID,
package/dist/version.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "3.12.1",
3
- "buildNumber": 517,
4
- "commit": "020f557",
5
- "buildDate": "2026-10-17T06:11:23.897Z"
2
+ "version": "3.12.2",
3
+ "buildNumber": 520,
4
+ "commit": "4308de2",
5
+ "buildDate": "2026-10-17T07:54:26.042Z"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memobit/libs",
3
- "version": "3.12.1",
3
+ "version": "3.12.2",
4
4
  "description": "React component library powering the Memobit apps — 100+ components, helpers and hooks. Icons ship as @memobit/icons and themes as @memobit/themes. TypeScript-first, ESM-only, React 19.",
5
5
  "keywords": [
6
6
  "react",
@@ -98,6 +98,7 @@
98
98
  "@memobit/icons": "file:../memobit-react-icons",
99
99
  "@memobit/themes": "file:../memobit-react-themes",
100
100
  "@microsoft/api-extractor": "7.59.2",
101
+ "@types/node": "25.9.8",
101
102
  "@types/react": "19.3.0",
102
103
  "@types/react-dom": "19.3.0",
103
104
  "@vitejs/plugin-react": "6.1.1",