@memobit/libs 3.11.0 → 3.11.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,70 +1,76 @@
1
1
  import './Tooltip.css';
2
2
  /* empty css */
3
3
  import { useEffect as b, useRef as h, useState as B } from "react";
4
- import { Fragment as V, jsx as D, jsxs as N } from "react/jsx-runtime";
5
- import { createPortal as O } from "react-dom";
4
+ import { Fragment as S, jsx as N, jsxs as D } from "react/jsx-runtime";
5
+ import { createPortal as V } from "react-dom";
6
6
  var K = ({ title: L, position: T = "top", delay: _ = 200, children: k, disabled: $ = !1, className: F = "", maxWidth: p, maxHeight: a }) => {
7
- const [f, s] = B(!1), [M, I] = B({
7
+ const [f, u] = B(!1), [M, I] = B({
8
8
  top: 0,
9
9
  left: 0
10
- }), c = h(null), t = h(null), l = h(null), g = h(null), w = h(!1), m = a !== void 0, R = m ? 150 : 0, d = () => {
11
- if (!l.current || !g.current) return;
12
- const r = l.current.firstElementChild?.getBoundingClientRect();
13
- let e = r && r.width > 0 ? r : l.current.getBoundingClientRect();
10
+ }), c = h(null), r = h(null), l = h(null), d = h(null), g = h(!1), w = a !== void 0, v = w ? 150 : 0, R = () => {
11
+ if (!l.current || !d.current) return;
12
+ const t = l.current.firstElementChild?.getBoundingClientRect();
13
+ let e = t && t.width > 0 ? t : l.current.getBoundingClientRect();
14
14
  if (e.width === 0 && e.height === 0) {
15
15
  const C = document.createRange();
16
16
  C.selectNodeContents(l.current);
17
17
  const E = C.getBoundingClientRect();
18
18
  (E.width > 0 || E.height > 0) && (e = E);
19
19
  }
20
- const n = g.current.getBoundingClientRect(), v = 8;
20
+ const n = d.current.getBoundingClientRect(), m = 8;
21
21
  let o = 0, i = 0;
22
22
  switch (T) {
23
23
  case "top":
24
- o = e.top - n.height - v, i = e.left + e.width / 2 - n.width / 2;
24
+ o = e.top - n.height - m, i = e.left + e.width / 2 - n.width / 2;
25
25
  break;
26
26
  case "bottom":
27
- o = e.bottom + v, i = e.left + e.width / 2 - n.width / 2;
27
+ o = e.bottom + m, i = e.left + e.width / 2 - n.width / 2;
28
28
  break;
29
29
  case "left":
30
- o = e.top + e.height / 2 - n.height / 2, i = e.left - n.width - v;
30
+ o = e.top + e.height / 2 - n.height / 2, i = e.left - n.width - m;
31
31
  break;
32
32
  case "right":
33
- o = e.top + e.height / 2 - n.height / 2, i = e.right + v;
33
+ o = e.top + e.height / 2 - n.height / 2, i = e.right + m;
34
34
  }
35
- const u = 8;
36
- i < u && (i = u), i + n.width > window.innerWidth - u && (i = window.innerWidth - n.width - u), o < u && (o = u), o + n.height > window.innerHeight - u && (o = window.innerHeight - n.height - u), I({
35
+ const s = 8;
36
+ i < s && (i = s), i + n.width > window.innerWidth - s && (i = window.innerWidth - n.width - s), o < s && (o = s), o + n.height > window.innerHeight - s && (o = window.innerHeight - n.height - s), I({
37
37
  top: o,
38
38
  left: i
39
39
  });
40
40
  }, P = () => {
41
- $ || w.current || (t.current && (clearTimeout(t.current), t.current = null), c.current = setTimeout(() => {
42
- s(!0);
41
+ $ || g.current || (r.current && (clearTimeout(r.current), r.current = null), c.current = setTimeout(() => {
42
+ u(!0);
43
43
  }, _));
44
44
  }, y = () => {
45
- w.current || (c.current && clearTimeout(c.current), R > 0 ? t.current = setTimeout(() => s(!1), R) : s(!1));
46
- }, j = (r) => {
47
- r.pointerType !== "touch" && r.pointerType !== "pen" || $ || (w.current = !0, c.current && (clearTimeout(c.current), c.current = null), r.stopPropagation(), s((e) => !e));
45
+ g.current || (c.current && clearTimeout(c.current), v > 0 ? r.current = setTimeout(() => u(!1), v) : u(!1));
46
+ }, j = (t) => {
47
+ t.pointerType !== "touch" && t.pointerType !== "pen" || $ || (g.current = !0, c.current && (clearTimeout(c.current), c.current = null), t.stopPropagation(), u((e) => !e));
48
48
  };
49
- b(() => (f && (d(), window.addEventListener("scroll", d, !0), window.addEventListener("resize", d)), () => {
50
- window.removeEventListener("scroll", d, !0), window.removeEventListener("resize", d);
51
- }), [f]), b(() => {
49
+ b(() => {
52
50
  if (!f) return;
53
- const r = (e) => {
54
- l.current?.contains(e.target) || g.current?.contains(e.target) || s(!1);
51
+ const t = (e) => {
52
+ e.target instanceof Node && d.current?.contains(e.target) || u(!1);
55
53
  };
56
- return document.addEventListener("pointerdown", r), () => {
57
- document.removeEventListener("pointerdown", r), w.current = !1;
54
+ return R(), window.addEventListener("scroll", t, !0), window.addEventListener("resize", R), () => {
55
+ window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", R);
56
+ };
57
+ }, [f]), b(() => {
58
+ if (!f) return;
59
+ const t = (e) => {
60
+ l.current?.contains(e.target) || d.current?.contains(e.target) || u(!1);
61
+ };
62
+ return document.addEventListener("pointerdown", t), () => {
63
+ document.removeEventListener("pointerdown", t), g.current = !1;
58
64
  };
59
65
  }, [f]), b(() => () => {
60
- c.current && clearTimeout(c.current), t.current && clearTimeout(t.current);
66
+ c.current && clearTimeout(c.current), r.current && clearTimeout(r.current);
61
67
  }, []);
62
68
  const x = () => {
63
- m && t.current && (clearTimeout(t.current), t.current = null);
69
+ w && r.current && (clearTimeout(r.current), r.current = null);
64
70
  }, z = () => {
65
- m && (t.current = setTimeout(() => s(!1), R));
71
+ w && (r.current = setTimeout(() => u(!1), v));
66
72
  };
67
- return /* @__PURE__ */ N(V, { children: [/* @__PURE__ */ D("span", {
73
+ return /* @__PURE__ */ D(S, { children: [/* @__PURE__ */ N("span", {
68
74
  ref: l,
69
75
  className: "tooltip-trigger",
70
76
  onMouseEnter: P,
@@ -73,9 +79,9 @@ var K = ({ title: L, position: T = "top", delay: _ = 200, children: k, disabled:
73
79
  onBlur: y,
74
80
  onPointerDown: j,
75
81
  children: k
76
- }), f && L && O(/* @__PURE__ */ N("div", {
77
- ref: g,
78
- className: `tooltip tooltip--${T} ${m ? "tooltip--scrollable" : ""} ${F}`,
82
+ }), f && L && V(/* @__PURE__ */ D("div", {
83
+ ref: d,
84
+ className: `tooltip tooltip--${T} ${w ? "tooltip--scrollable" : ""} ${F}`,
79
85
  style: {
80
86
  top: `${M.top}px`,
81
87
  left: `${M.left}px`,
@@ -84,7 +90,7 @@ var K = ({ title: L, position: T = "top", delay: _ = 200, children: k, disabled:
84
90
  },
85
91
  onMouseEnter: x,
86
92
  onMouseLeave: z,
87
- children: [L, /* @__PURE__ */ D("div", { className: `tooltip__arrow tooltip__arrow--${T}` })]
93
+ children: [L, /* @__PURE__ */ N("div", { className: `tooltip__arrow tooltip__arrow--${T}` })]
88
94
  }), document.body)] });
89
95
  };
90
96
  export {
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 504,
26
+ libBuildNumber: 509,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
@@ -5,14 +5,54 @@
5
5
  "arrow-left",
6
6
  "arrow-right",
7
7
  "arrow-up",
8
+ "bullet",
9
+ "burst",
10
+ "calendar",
8
11
  "calendar-month",
9
12
  "calendar-week",
10
13
  "caret-down",
11
14
  "caret-left",
12
15
  "caret-right",
13
16
  "caret-up",
17
+ "checkmark",
18
+ "clear",
19
+ "clipboard",
20
+ "comment",
21
+ "confetti",
14
22
  "credit-card",
23
+ "empty",
24
+ "file",
25
+ "filters",
26
+ "fireworks",
27
+ "folder",
28
+ "food",
29
+ "gallery",
30
+ "grid",
31
+ "key",
32
+ "link",
33
+ "lock",
34
+ "logout",
35
+ "map",
15
36
  "menu-hamburger",
16
- "theme-picker"
37
+ "next",
38
+ "other",
39
+ "ownership",
40
+ "pin",
41
+ "plus",
42
+ "previous",
43
+ "radio",
44
+ "return",
45
+ "save",
46
+ "scss",
47
+ "search",
48
+ "sparkle",
49
+ "star",
50
+ "table",
51
+ "target",
52
+ "theme-picker",
53
+ "time",
54
+ "tree",
55
+ "tune",
56
+ "warning"
17
57
  ]
18
58
  }
package/dist/version.js CHANGED
@@ -1,7 +1,7 @@
1
- var I = "3.11.0", B = 504, L = "7cca07f", _ = "2026-10-16T16:12:33.803Z", a = "504";
1
+ var I = "3.11.2", B = 509, L = "4f8444c", _ = "2026-10-16T18:10:37.543Z", r = "509";
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.11.0",
3
- "buildNumber": 504,
4
- "commit": "7cca07f",
5
- "buildDate": "2026-10-16T16:12:33.803Z"
2
+ "version": "3.11.2",
3
+ "buildNumber": 509,
4
+ "commit": "4f8444c",
5
+ "buildDate": "2026-10-16T18:10:37.543Z"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memobit/libs",
3
- "version": "3.11.0",
3
+ "version": "3.11.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",