@memobit/libs 3.1.0 → 3.1.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.
@@ -1,23 +1,26 @@
1
1
  import './Icon.css';
2
2
  /* empty css */
3
3
  import "react";
4
- import { iconMap as s } from "@memobit/icons/map";
5
- import { jsx as t } from "react/jsx-runtime";
6
- var v = ({ className: n = "", fade: c, fadeOnHover: e, name: r, pulse: p, pulseOnHover: m, size: i, spin: f, spinOnHover: l, variant: o }) => /* @__PURE__ */ t("span", {
7
- className: [
4
+ import { iconMap as h } from "@memobit/icons/map";
5
+ import { jsx as f } from "react/jsx-runtime";
6
+ var t = /* @__PURE__ */ new Set(), x = ({ className: s = "", fade: c, fadeOnHover: r, name: o, pulse: a, pulseOnHover: p, size: n, spin: l, spinOnHover: d, variant: i }) => {
7
+ const m = [
8
8
  "icon",
9
- i ? `icon--${i}` : "",
10
- o && o !== "default" ? `icon--${o}` : "",
11
- f ? "icon--spin" : "",
9
+ n ? `icon--${n}` : "",
10
+ i && i !== "default" ? `icon--${i}` : "",
11
+ l ? "icon--spin" : "",
12
12
  c ? "icon--fade" : "",
13
- p ? "icon--pulse" : "",
14
- l ? "icon--spin-hover" : "",
15
- e ? "icon--fade-hover" : "",
16
- m ? "icon--pulse-hover" : "",
17
- n
18
- ].filter(Boolean).join(" "),
19
- children: s[r]
20
- });
13
+ a ? "icon--pulse" : "",
14
+ d ? "icon--spin-hover" : "",
15
+ r ? "icon--fade-hover" : "",
16
+ p ? "icon--pulse-hover" : "",
17
+ s
18
+ ].filter(Boolean).join(" "), e = h[o];
19
+ return e === void 0 && !t.has(o) && (t.add(o), console.warn(`[@memobit/libs] No icon named "${o}". If this app trims icons with @memobit/icons/vite, add it to the plugin's \`include\` option — a name that only exists at runtime cannot be found by the source scan.`)), /* @__PURE__ */ f("span", {
20
+ className: m,
21
+ children: e
22
+ });
23
+ };
21
24
  export {
22
- v as Icon
25
+ x as Icon
23
26
  };
@@ -1,18 +1,20 @@
1
- import { ThemeContext as R } from "./ThemeContextValue.js";
2
- import { Tooltip as B } from "../Tooltip/Tooltip2.js";
3
- import { THEME_CONFIGS as c, getThemeConfig as H } from "./themeConfig.js";
4
- import { useCallback as f, useEffect as I, useState as E } from "react";
5
- import { jsx as m, jsxs as v } from "react/jsx-runtime";
6
- var _ = "theme-stylesheet", k = "theme-font-link", b = "theme-font-link-display", w = "theme-font-link-mono", X = ({ children: L, theme: C, effects: M, onSave: y, allowedThemes: s }) => {
7
- const [d, l] = E(null), [N, a] = E(null), [P, g] = E(!1), i = d ?? C, p = N ?? M;
8
- I(() => {
9
- document.documentElement.setAttribute("data-theme", i);
10
- const o = (typeof __MEMOBIT_THEME_URLS__ > "u" ? void 0 : __MEMOBIT_THEME_URLS__)?.[i];
11
- if (o !== void 0) {
12
- let e = document.getElementById(_);
13
- e || (e = document.createElement("link"), e.id = _, e.rel = "stylesheet", document.head.appendChild(e)), e.href !== new URL(o, document.baseURI).href && (e.href = o);
1
+ import { ThemeContext as B } from "./ThemeContextValue.js";
2
+ import { Tooltip as H } from "../Tooltip/Tooltip2.js";
3
+ import { THEME_CONFIGS as c, getThemeConfig as R } from "./themeConfig.js";
4
+ import { useCallback as m, useEffect as _, useState as v } from "react";
5
+ import { jsx as f, jsxs as E } from "react/jsx-runtime";
6
+ var I = "theme-stylesheet", k = "theme-font-link", b = "theme-font-link-display", w = "theme-font-link-mono", X = ({ children: L, theme: C, effects: M, onSave: y, allowedThemes: s }) => {
7
+ const [d, l] = v(null), [N, a] = v(null), [P, g] = v(!1), o = d ?? C, p = N ?? M;
8
+ _(() => {
9
+ document.documentElement.setAttribute("data-theme", o);
10
+ const i = (typeof __MEMOBIT_THEME_URLS__ > "u" ? void 0 : __MEMOBIT_THEME_URLS__)?.[o];
11
+ if (i !== void 0) {
12
+ let e = document.getElementById(I);
13
+ e || (e = document.createElement("link"), e.id = I, e.rel = "stylesheet", document.head.appendChild(e));
14
+ const t = new URL(i, import.meta.url).href;
15
+ e.href !== t && (e.href = t);
14
16
  }
15
- const r = H(i);
17
+ const r = R(o);
16
18
  if (r) {
17
19
  let e = document.getElementById(k);
18
20
  e || (e = document.createElement("link"), e.id = k, e.rel = "stylesheet", document.head.appendChild(e)), e.href = r.fontUrl;
@@ -21,55 +23,55 @@ var _ = "theme-stylesheet", k = "theme-font-link", b = "theme-font-link-display"
21
23
  let n = document.getElementById(w);
22
24
  r.fontUrlMono ? (n || (n = document.createElement("link"), n.id = w, n.rel = "stylesheet", document.head.appendChild(n)), n.href = r.fontUrlMono) : n?.remove();
23
25
  }
24
- }, [i]);
25
- const S = f((o) => {
26
- l(o);
27
- }, []), U = f((o) => {
28
- a(o);
29
- }, []), D = f(() => {
26
+ }, [o]);
27
+ const S = m((i) => {
28
+ l(i);
29
+ }, []), D = m((i) => {
30
+ a(i);
31
+ }, []), O = m(() => {
30
32
  l(null), a(null);
31
33
  }, []);
32
- I(() => {
33
- const o = (e) => {
34
+ _(() => {
35
+ const i = (e) => {
34
36
  if (!(e instanceof HTMLElement)) return !1;
35
37
  const t = e.tagName;
36
38
  return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable;
37
39
  }, r = (e) => {
38
- if (!(e.ctrlKey || e.metaKey || e.altKey) && !o(e.target))
40
+ if (!(e.ctrlKey || e.metaKey || e.altKey) && !i(e.target))
39
41
  if (e.key === "[" || e.key === "]") {
40
42
  e.preventDefault();
41
43
  const t = c.map((u) => u.value), n = s && s.length > 0 ? t.filter((u) => s.includes(u)) : t;
42
44
  if (n.length === 0) return;
43
- const T = n.indexOf(i), K = ((T === -1 ? 0 : T) + (e.key === "]" ? 1 : -1) + n.length) % n.length;
45
+ const T = n.indexOf(o), K = ((T === -1 ? 0 : T) + (e.key === "]" ? 1 : -1) + n.length) % n.length;
44
46
  l(n[K]);
45
47
  } else e.key === "Escape" && d && (e.preventDefault(), l(null), a(null));
46
48
  };
47
49
  return window.addEventListener("keydown", r), () => window.removeEventListener("keydown", r);
48
50
  }, [
49
- i,
51
+ o,
50
52
  d,
51
53
  s
52
54
  ]);
53
- const h = c.findIndex((o) => o.value === i), x = h >= 0 ? c[h].label : i, O = f(() => {
55
+ const h = c.findIndex((i) => i.value === o), x = h >= 0 ? c[h].label : o, U = m(() => {
54
56
  y?.({
55
- theme: i,
57
+ theme: o,
56
58
  effects: p
57
59
  }), l(null), a(null);
58
60
  }, [
59
- i,
61
+ o,
60
62
  p,
61
63
  y
62
64
  ]);
63
- return /* @__PURE__ */ v(R.Provider, {
65
+ return /* @__PURE__ */ E(B.Provider, {
64
66
  value: {
65
- theme: i,
67
+ theme: o,
66
68
  effects: p,
67
69
  setPreviewTheme: S,
68
- setPreviewEffects: U,
69
- commitPreview: O,
70
- clearPreview: D
70
+ setPreviewEffects: D,
71
+ commitPreview: U,
72
+ clearPreview: O
71
73
  },
72
- children: [L, d && /* @__PURE__ */ v("div", {
74
+ children: [L, d && /* @__PURE__ */ E("div", {
73
75
  style: {
74
76
  position: "fixed",
75
77
  bottom: 16,
@@ -83,9 +85,9 @@ var _ = "theme-stylesheet", k = "theme-font-link", b = "theme-font-link-display"
83
85
  boxShadow: "0 4px 16px rgba(0, 0, 0, 0.3)"
84
86
  },
85
87
  children: [
86
- /* @__PURE__ */ m(B, {
88
+ /* @__PURE__ */ f(H, {
87
89
  title: "Copy theme name",
88
- children: /* @__PURE__ */ m("span", {
90
+ children: /* @__PURE__ */ f("span", {
89
91
  onClick: () => {
90
92
  navigator.clipboard.writeText(x), g(!0), window.setTimeout(() => g(!1), 1500);
91
93
  },
@@ -93,7 +95,7 @@ var _ = "theme-stylesheet", k = "theme-font-link", b = "theme-font-link-display"
93
95
  children: x
94
96
  })
95
97
  }),
96
- /* @__PURE__ */ v("span", {
98
+ /* @__PURE__ */ E("span", {
97
99
  style: {
98
100
  opacity: 0.6,
99
101
  marginLeft: 8,
@@ -105,7 +107,7 @@ var _ = "theme-stylesheet", k = "theme-font-link", b = "theme-font-link-display"
105
107
  c.length
106
108
  ]
107
109
  }),
108
- /* @__PURE__ */ m("div", {
110
+ /* @__PURE__ */ f("div", {
109
111
  style: {
110
112
  opacity: 0.5,
111
113
  fontSize: 11,
@@ -114,7 +116,7 @@ var _ = "theme-stylesheet", k = "theme-font-link", b = "theme-font-link-display"
114
116
  },
115
117
  children: "[ prev · ] next · Esc revert"
116
118
  }),
117
- P && /* @__PURE__ */ m("div", {
119
+ P && /* @__PURE__ */ f("div", {
118
120
  style: {
119
121
  position: "absolute",
120
122
  bottom: "calc(100% + 6px)",
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 434,
26
+ libBuildNumber: 439,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
@@ -5,21 +5,52 @@
5
5
  "arrow-left",
6
6
  "arrow-right",
7
7
  "arrow-up",
8
- "asc",
8
+ "bullet",
9
+ "burst",
9
10
  "calendar",
11
+ "calendar-month",
12
+ "calendar-week",
10
13
  "caret-down",
14
+ "caret-left",
11
15
  "caret-right",
12
16
  "caret-up",
13
17
  "checkmark",
14
18
  "clear",
15
- "desc",
19
+ "clipboard",
20
+ "comment",
21
+ "confetti",
22
+ "credit-card",
23
+ "empty",
24
+ "file",
25
+ "filters",
26
+ "fireworks",
16
27
  "folder",
28
+ "food",
29
+ "gallery",
30
+ "grid",
31
+ "key",
17
32
  "link",
33
+ "lock",
34
+ "map",
35
+ "menu-hamburger",
18
36
  "next",
37
+ "other",
38
+ "ownership",
19
39
  "pin",
20
40
  "plus",
41
+ "previous",
42
+ "radio",
43
+ "return",
44
+ "save",
45
+ "scss",
21
46
  "search",
22
47
  "sparkle",
23
- "time"
48
+ "star",
49
+ "table",
50
+ "target",
51
+ "time",
52
+ "tree",
53
+ "tune",
54
+ "warning"
24
55
  ]
25
56
  }
package/dist/version.js CHANGED
@@ -1,7 +1,7 @@
1
- var I = "3.1.0", B = 434, L = "1fa93d2", _ = "2026-09-30T07:20:59.920Z", a = "434";
1
+ var I = "3.1.2", B = 439, L = "1cdcc0c", _ = "2026-10-02T05:56:33.724Z", r = "439";
2
2
  export {
3
3
  _ as LIB_BUILD_DATE,
4
- a as LIB_BUILD_ID,
4
+ r as LIB_BUILD_ID,
5
5
  B as LIB_BUILD_NUMBER,
6
6
  L as LIB_COMMIT,
7
7
  I as LIB_VERSION
package/dist/version.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "3.1.0",
3
- "buildNumber": 434,
4
- "commit": "1fa93d2",
5
- "buildDate": "2026-09-30T07:20:59.920Z"
2
+ "version": "3.1.2",
3
+ "buildNumber": 439,
4
+ "commit": "1cdcc0c",
5
+ "buildDate": "2026-10-02T05:56:33.724Z"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memobit/libs",
3
- "version": "3.1.0",
3
+ "version": "3.1.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",