@memobit/libs 3.8.3 → 3.9.0

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,26 +1,43 @@
1
1
  import './Icon.css';
2
2
  /* empty css */
3
- import "react";
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 }) => {
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 }) => {
7
9
  const m = [
8
10
  "icon",
9
- n ? `icon--${n}` : "",
10
- i && i !== "default" ? `icon--${i}` : "",
11
- l ? "icon--spin" : "",
12
- c ? "icon--fade" : "",
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", {
11
+ r ? `icon--${r}` : "",
12
+ t && t !== "default" ? `icon--${t}` : "",
13
+ p ? "icon--spin" : "",
14
+ l ? "icon--fade" : "",
15
+ u ? "icon--pulse" : "",
16
+ h ? "icon--spin-hover" : "",
17
+ d ? "icon--fade-hover" : "",
18
+ f ? "icon--pulse-hover" : "",
19
+ o
20
+ ].filter(Boolean).join(" "), [, v] = I(null), i = y(e);
21
+ return g(() => {
22
+ if (i !== void 0 || !n) return;
23
+ let s = !0;
24
+ return N(e).then((b) => {
25
+ if (s) {
26
+ if (b === void 0) {
27
+ a(e);
28
+ return;
29
+ }
30
+ v(e);
31
+ }
32
+ }, () => {
33
+ }), () => {
34
+ s = !1;
35
+ };
36
+ }, [i, e]), i === void 0 && !n && a(e), /* @__PURE__ */ $("span", {
20
37
  className: m,
21
- children: e
38
+ children: i
22
39
  });
23
40
  };
24
41
  export {
25
- x as Icon
42
+ S as Icon
26
43
  };
@@ -1,54 +1,68 @@
1
1
  import './IconPicker.css';
2
- import { Icon as _ } from "../Icon/Icon2.js";
3
- import { Tooltip as g } from "../Tooltip/Tooltip2.js";
4
- import { InputSearch as k } from "../InputSearch/InputSearch2.js";
2
+ import { Icon as N } from "../Icon/Icon2.js";
3
+ import { Tooltip as v } from "../Tooltip/Tooltip2.js";
4
+ import { InputSearch as y } from "../InputSearch/InputSearch2.js";
5
5
  /* empty css */
6
- import { useMemo as a, useState as v } from "react";
7
- import { iconMap as N } from "@memobit/icons/map";
8
- import { jsx as c, jsxs as S } from "react/jsx-runtime";
9
- import { iconAliases as b } from "@memobit/icons";
10
- var y = Object.keys(N), M = ({ color: s, emptyLabel: p = "No icons match", icons: n, onChange: m, placeholder: h = "Search icons...", value: d }) => {
11
- const [i, u] = v(""), o = a(() => n ?? y, [n]), t = a(() => {
12
- const e = i.trim().toLowerCase();
13
- if (!e) return o;
14
- const f = e.replace(/[\s-]+/g, ""), l = (r) => r.includes(e) || r.replace(/-/g, "").includes(f);
15
- return o.filter((r) => l(r) || (b[r] ?? []).some(l));
16
- }, [o, i]);
17
- return /* @__PURE__ */ S("div", {
6
+ import { useEffect as C, useMemo as h, useState as d } from "react";
7
+ import { canLoadMoreIcons as S, iconMap as b, loadAllIcons as j } from "@memobit/icons/map";
8
+ import { jsx as c, jsxs as A } from "react/jsx-runtime";
9
+ import { iconAliases as L } from "@memobit/icons";
10
+ var T = S ? null : Object.keys(b), q = ({ color: a, emptyLabel: u = "No icons match", icons: o, onChange: f, placeholder: _ = "Search icons...", value: g }) => {
11
+ const [s, k] = d(""), [r, I] = d(T);
12
+ C(() => {
13
+ if (r || o) return;
14
+ let e = !0;
15
+ return j().then((l) => {
16
+ e && I(Object.keys(l));
17
+ }, () => {
18
+ }), () => {
19
+ e = !1;
20
+ };
21
+ }, [r, o]);
22
+ const t = h(() => o ?? r ?? [], [r, o]), p = !o && !r, n = h(() => {
23
+ const e = s.trim().toLowerCase();
24
+ if (!e) return t;
25
+ const l = e.replace(/[\s-]+/g, ""), m = (i) => i.includes(e) || i.replace(/-/g, "").includes(l);
26
+ return t.filter((i) => m(i) || (L[i] ?? []).some(m));
27
+ }, [t, s]);
28
+ return /* @__PURE__ */ A("div", {
18
29
  className: "icon-picker",
19
30
  children: [
20
31
  /* @__PURE__ */ c("div", {
21
32
  className: "icon-picker__search",
22
- children: /* @__PURE__ */ c(k, {
33
+ children: /* @__PURE__ */ c(y, {
23
34
  autoFocus: !0,
24
- onChange: u,
25
- placeholder: h,
26
- value: i
35
+ onChange: k,
36
+ placeholder: _,
37
+ value: s
27
38
  })
28
39
  }),
29
40
  /* @__PURE__ */ c("div", {
30
41
  className: "icon-picker__grid",
31
- children: t.length === 0 ? /* @__PURE__ */ c("p", {
42
+ children: p ? /* @__PURE__ */ c("p", {
32
43
  className: "icon-picker__empty",
33
- children: p
34
- }) : t.map((e) => /* @__PURE__ */ c(g, {
44
+ children: "Loading icons..."
45
+ }) : n.length === 0 ? /* @__PURE__ */ c("p", {
46
+ className: "icon-picker__empty",
47
+ children: u
48
+ }) : n.map((e) => /* @__PURE__ */ c(v, {
35
49
  title: e,
36
50
  children: /* @__PURE__ */ c("button", {
37
- className: `icon-picker__icon${d === e ? " is-selected" : ""}`,
38
- onClick: () => m?.(e),
39
- style: s ? { color: s } : void 0,
51
+ className: `icon-picker__icon${g === e ? " is-selected" : ""}`,
52
+ onClick: () => f?.(e),
53
+ style: a ? { color: a } : void 0,
40
54
  type: "button",
41
- children: /* @__PURE__ */ c(_, { name: e })
55
+ children: /* @__PURE__ */ c(N, { name: e })
42
56
  })
43
57
  }, e))
44
58
  }),
45
- /* @__PURE__ */ c("p", {
59
+ !p && /* @__PURE__ */ c("p", {
46
60
  className: "icon-picker__count",
47
- children: t.length === o.length ? `${o.length} icons` : `${t.length} of ${o.length}`
61
+ children: n.length === t.length ? `${t.length} icons` : `${n.length} of ${t.length}`
48
62
  })
49
63
  ]
50
64
  });
51
65
  };
52
66
  export {
53
- M as IconPicker
67
+ q as IconPicker
54
68
  };
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 3,
26
+ libBuildNumber: 496,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
@@ -1,36 +1,36 @@
1
- // Universal body painting + sizing. Consumed via themes.scss so every memobit
2
- // app picks it up automatically.
3
- //
4
- // Why this lives here:
5
- // Theme backgrounds are gradients (multi-stop linear/radial). If the body is
6
- // shorter than the viewport during initial render — empty content, loading
7
- // state — the gradient gets tiled vertically by default, producing visible
8
- // horizontal banding. `min-height: 100vh` ensures the body is at least as tall
9
- // as the viewport so the gradient renders at full size on first paint;
10
- // `background-repeat: no-repeat` is a defensive guard for edge cases (zoom,
11
- // tall viewport with short content after HMR).
12
- //
13
- // Do NOT use the `background` shorthand in consumer App.scss — it resets
14
- // `background-repeat` to its initial `repeat` value and re-introduces the
15
- // banding. Set `background-image` long-hand if a per-project override is
16
- // needed; otherwise omit and let this rule own it.
17
-
18
- html,
19
- body {
20
- background: var(--body-background);
21
- background-repeat: no-repeat;
22
- margin: 0;
23
- padding: 0;
24
- min-height: 100vh;
25
- }
26
-
27
- // Ambient glow overlay — themes opt in via `--body-background-glow`. Pinned to
28
- // the viewport so it stays put on scroll; z-index: -1 keeps it behind app content.
29
- body::before {
30
- content: '';
31
- position: fixed;
32
- inset: 0;
33
- z-index: -1;
34
- background: var(--body-background-glow, none);
35
- pointer-events: none;
36
- }
1
+ // Universal body painting + sizing. Consumed via themes.scss so every memobit
2
+ // app picks it up automatically.
3
+ //
4
+ // Why this lives here:
5
+ // Theme backgrounds are gradients (multi-stop linear/radial). If the body is
6
+ // shorter than the viewport during initial render — empty content, loading
7
+ // state — the gradient gets tiled vertically by default, producing visible
8
+ // horizontal banding. `min-height: 100vh` ensures the body is at least as tall
9
+ // as the viewport so the gradient renders at full size on first paint;
10
+ // `background-repeat: no-repeat` is a defensive guard for edge cases (zoom,
11
+ // tall viewport with short content after HMR).
12
+ //
13
+ // Do NOT use the `background` shorthand in consumer App.scss — it resets
14
+ // `background-repeat` to its initial `repeat` value and re-introduces the
15
+ // banding. Set `background-image` long-hand if a per-project override is
16
+ // needed; otherwise omit and let this rule own it.
17
+
18
+ html,
19
+ body {
20
+ background: var(--body-background);
21
+ background-repeat: no-repeat;
22
+ margin: 0;
23
+ padding: 0;
24
+ min-height: 100vh;
25
+ }
26
+
27
+ // Ambient glow overlay — themes opt in via `--body-background-glow`. Pinned to
28
+ // the viewport so it stays put on scroll; z-index: -1 keeps it behind app content.
29
+ body::before {
30
+ content: '';
31
+ position: fixed;
32
+ inset: 0;
33
+ z-index: -1;
34
+ background: var(--body-background-glow, none);
35
+ pointer-events: none;
36
+ }
@@ -1,72 +1,72 @@
1
- .note-container-effect {
2
- font-size: var(--font-size-md);
3
- line-height: 1.6;
4
- padding: var(--spacing-16);
5
- border-radius: var(--spacing-12);
6
- border-left: var(--spacing-2) solid var(--note-container-effect-border-left-color);
7
- background-color: var(--note-container-effect-background-color);
8
- color: var(--note-container-effect-color);
9
- }
10
-
11
- .infuse-effect {
12
- border-width: var(--spacing-1);
13
- border-style: solid;
14
- transition: all 0.3s;
15
- position: relative;
16
-
17
- &::before {
18
- content: '';
19
- position: absolute;
20
- top: 0;
21
- left: 0;
22
- background: var(--infuse-effect-before-background);
23
- width: var(--spacing-4);
24
- height: 100%;
25
- opacity: 0;
26
- transition: opacity 0.3s;
27
- }
28
-
29
- &:hover {
30
- transform: translateY(-5px);
31
- border-color: var(--infuse-effect-hover-border-color);
32
- box-shadow: 0 var(--spacing-12) var(--spacing-24) var(--infuse-effect-hover-box-shadow-color);
33
-
34
- &::before {
35
- opacity: 1;
36
- }
37
- }
38
- }
39
-
40
- .up-lift-effect {
41
- border-width: var(--spacing-1);
42
- border-style: solid;
43
- box-shadow: 0 var(--spacing-4) var(--spacing-12) var(--up-lift-effect-box-shadow-color);
44
- transition: all 0.3s ease;
45
- position: relative;
46
-
47
- &::before {
48
- content: '';
49
- position: absolute;
50
- top: 0;
51
- left: 0;
52
- width: 5px;
53
- height: 100%;
54
- background: var(--up-lift-effect-before-background);
55
- }
56
-
57
- &:hover {
58
- transform: translateY(-5px);
59
- border-color: var(--up-lift-effect-hover-border-color);
60
- box-shadow: 0 var(--spacing-12) var(--spacing-24) var(--up-lift-effect-hover-box-shadow-color);
61
- }
62
- }
63
-
64
- .glow-effect {
65
- transition: 0.3s;
66
-
67
- &:hover {
68
- box-shadow: var(--glow-box-shadow-color);
69
- transform: translateY(-2px);
70
- border-color: var(--glow-hover-border-color);
71
- }
72
- }
1
+ .note-container-effect {
2
+ font-size: var(--font-size-md);
3
+ line-height: 1.6;
4
+ padding: var(--spacing-16);
5
+ border-radius: var(--spacing-12);
6
+ border-left: var(--spacing-2) solid var(--note-container-effect-border-left-color);
7
+ background-color: var(--note-container-effect-background-color);
8
+ color: var(--note-container-effect-color);
9
+ }
10
+
11
+ .infuse-effect {
12
+ border-width: var(--spacing-1);
13
+ border-style: solid;
14
+ transition: all 0.3s;
15
+ position: relative;
16
+
17
+ &::before {
18
+ content: '';
19
+ position: absolute;
20
+ top: 0;
21
+ left: 0;
22
+ background: var(--infuse-effect-before-background);
23
+ width: var(--spacing-4);
24
+ height: 100%;
25
+ opacity: 0;
26
+ transition: opacity 0.3s;
27
+ }
28
+
29
+ &:hover {
30
+ transform: translateY(-5px);
31
+ border-color: var(--infuse-effect-hover-border-color);
32
+ box-shadow: 0 var(--spacing-12) var(--spacing-24) var(--infuse-effect-hover-box-shadow-color);
33
+
34
+ &::before {
35
+ opacity: 1;
36
+ }
37
+ }
38
+ }
39
+
40
+ .up-lift-effect {
41
+ border-width: var(--spacing-1);
42
+ border-style: solid;
43
+ box-shadow: 0 var(--spacing-4) var(--spacing-12) var(--up-lift-effect-box-shadow-color);
44
+ transition: all 0.3s ease;
45
+ position: relative;
46
+
47
+ &::before {
48
+ content: '';
49
+ position: absolute;
50
+ top: 0;
51
+ left: 0;
52
+ width: 5px;
53
+ height: 100%;
54
+ background: var(--up-lift-effect-before-background);
55
+ }
56
+
57
+ &:hover {
58
+ transform: translateY(-5px);
59
+ border-color: var(--up-lift-effect-hover-border-color);
60
+ box-shadow: 0 var(--spacing-12) var(--spacing-24) var(--up-lift-effect-hover-box-shadow-color);
61
+ }
62
+ }
63
+
64
+ .glow-effect {
65
+ transition: 0.3s;
66
+
67
+ &:hover {
68
+ box-shadow: var(--glow-box-shadow-color);
69
+ transform: translateY(-2px);
70
+ border-color: var(--glow-hover-border-color);
71
+ }
72
+ }
@@ -1,30 +1,30 @@
1
- :root {
2
- --scrollbar-size: 6px;
3
- --scrollbar-track-color: transparent;
4
- --scrollbar-thumb-color: var(--delimiter-color, rgba(128, 128, 128, 0.45));
5
- --scrollbar-thumb-hover-color: var(--body-color-muted, rgba(128, 128, 128, 0.65));
6
- --scrollbar-radius: var(--radius-full, 9999px);
7
- }
8
-
9
- * {
10
- scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track-color);
11
- scrollbar-width: thin;
12
- }
13
-
14
- *::-webkit-scrollbar {
15
- width: var(--scrollbar-size);
16
- height: var(--scrollbar-size);
17
- }
18
-
19
- *::-webkit-scrollbar-track {
20
- background: var(--scrollbar-track-color);
21
- }
22
-
23
- *::-webkit-scrollbar-thumb {
24
- background: var(--scrollbar-thumb-color);
25
- border-radius: var(--scrollbar-radius);
26
- }
27
-
28
- *::-webkit-scrollbar-thumb:hover {
29
- background: var(--scrollbar-thumb-hover-color);
30
- }
1
+ :root {
2
+ --scrollbar-size: 6px;
3
+ --scrollbar-track-color: transparent;
4
+ --scrollbar-thumb-color: var(--delimiter-color, rgba(128, 128, 128, 0.45));
5
+ --scrollbar-thumb-hover-color: var(--body-color-muted, rgba(128, 128, 128, 0.65));
6
+ --scrollbar-radius: var(--radius-full, 9999px);
7
+ }
8
+
9
+ * {
10
+ scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track-color);
11
+ scrollbar-width: thin;
12
+ }
13
+
14
+ *::-webkit-scrollbar {
15
+ width: var(--scrollbar-size);
16
+ height: var(--scrollbar-size);
17
+ }
18
+
19
+ *::-webkit-scrollbar-track {
20
+ background: var(--scrollbar-track-color);
21
+ }
22
+
23
+ *::-webkit-scrollbar-thumb {
24
+ background: var(--scrollbar-thumb-color);
25
+ border-radius: var(--scrollbar-radius);
26
+ }
27
+
28
+ *::-webkit-scrollbar-thumb:hover {
29
+ background: var(--scrollbar-thumb-hover-color);
30
+ }