@cronocode/react-box 2.0.7 → 3.0.0-alpha.3
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/box.cjs +1 -1
- package/box.d.ts +15 -8
- package/box.mjs +15 -9
- package/components/baseSvg.d.ts +3 -4
- package/components/button.cjs +1 -1
- package/components/button.d.ts +4 -5
- package/components/button.mjs +1 -1
- package/components/checkbox.cjs +1 -1
- package/components/checkbox.d.ts +1 -4
- package/components/checkbox.mjs +10 -10
- package/components/dataGrid/dataGridContract.d.ts +19 -11
- package/components/dataGrid/useGridData.d.ts +7 -0
- package/components/dataGrid.cjs +1 -1
- package/components/dataGrid.d.ts +5 -3
- package/components/dataGrid.mjs +17 -28
- package/components/flex.d.ts +3 -6
- package/components/form.cjs +1 -1
- package/components/form.d.ts +3 -5
- package/components/form.mjs +1 -1
- package/components/grid.d.ts +3 -6
- package/components/label.d.ts +0 -1
- package/components/radioButton.cjs +1 -1
- package/components/radioButton.d.ts +5 -7
- package/components/radioButton.mjs +9 -9
- package/components/textarea.cjs +1 -1
- package/components/textarea.d.ts +5 -6
- package/components/textarea.mjs +8 -9
- package/components/textbox.cjs +1 -1
- package/components/textbox.d.ts +4 -6
- package/components/textbox.mjs +1 -1
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.d.ts +2 -4
- package/components/tooltip.mjs +34 -40
- package/core/boxExtends.d.ts +6 -0
- package/core/boxStyles.d.ts +701 -1217
- package/core/boxStylesFormatters.d.ts +2 -2
- package/core/coreTypes.d.ts +31 -0
- package/core/theme.d.ts +13 -32
- package/core/useStyles.d.ts +12 -3
- package/core/useTheme.d.ts +7 -10
- package/core.cjs +4 -34
- package/core.mjs +1397 -1158
- package/package.json +20 -25
- package/ssg.d.ts +0 -1
- package/types.d.ts +26 -0
- package/utils/object/objectUtils.d.ts +2 -0
- package/components/dataGrid/useGrid.d.ts +0 -3
- package/core/stylesContext.d.ts +0 -13
- package/core/theme.cjs +0 -1
- package/core/theme.mjs +0 -4
- package/core/types.d.ts +0 -60
- package/utils.cjs +0 -1
- package/utils.mjs +0 -63
package/components/tooltip.mjs
CHANGED
|
@@ -1,63 +1,57 @@
|
|
|
1
|
-
import { jsxs as v, Fragment as
|
|
2
|
-
import { createPortal as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const l = 2;
|
|
13
|
-
function M(i) {
|
|
14
|
-
const { onPositionChange: r } = i, c = C(null), [t, p] = g(), m = y(), w = f(
|
|
15
|
-
(n, e) => {
|
|
16
|
-
const o = (s) => {
|
|
17
|
-
s.target.contains(n) && e(n);
|
|
1
|
+
import { jsxs as v, Fragment as x, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { createPortal as b } from "react-dom";
|
|
3
|
+
import u from "../box.mjs";
|
|
4
|
+
import { useRef as E, useState as L, useCallback as d, useLayoutEffect as g } from "react";
|
|
5
|
+
import { a as z } from "../core.mjs";
|
|
6
|
+
const i = 2;
|
|
7
|
+
function y(f) {
|
|
8
|
+
const { onPositionChange: c } = f, s = E(null), [t, p] = L(), m = z(), w = d(
|
|
9
|
+
(o, e) => {
|
|
10
|
+
const r = (n) => {
|
|
11
|
+
n.target.contains(o) && e(o);
|
|
18
12
|
};
|
|
19
|
-
return document.addEventListener("scroll",
|
|
20
|
-
document.removeEventListener("scroll",
|
|
13
|
+
return document.addEventListener("scroll", r, { capture: !0 }), () => {
|
|
14
|
+
document.removeEventListener("scroll", r, { capture: !0 });
|
|
21
15
|
};
|
|
22
16
|
},
|
|
23
17
|
[t]
|
|
24
|
-
), h =
|
|
25
|
-
(
|
|
26
|
-
const
|
|
27
|
-
e(
|
|
18
|
+
), h = d(
|
|
19
|
+
(o, e) => {
|
|
20
|
+
const r = (n) => {
|
|
21
|
+
e(o);
|
|
28
22
|
};
|
|
29
|
-
return window.addEventListener("resize",
|
|
30
|
-
window.removeEventListener("resize",
|
|
23
|
+
return window.addEventListener("resize", r, { capture: !0 }), () => {
|
|
24
|
+
window.removeEventListener("resize", r, { capture: !0 });
|
|
31
25
|
};
|
|
32
26
|
},
|
|
33
27
|
[t]
|
|
34
|
-
),
|
|
35
|
-
(
|
|
36
|
-
const e =
|
|
37
|
-
((t == null ? void 0 : t.top) !==
|
|
28
|
+
), l = d(
|
|
29
|
+
(o) => {
|
|
30
|
+
const e = o.getBoundingClientRect(), r = Math.round((e.top + window.scrollY) * i) / i, n = Math.round((e.left + window.scrollX) * i) / i;
|
|
31
|
+
((t == null ? void 0 : t.top) !== r || (t == null ? void 0 : t.left) !== n) && (c == null || c({ top: r, left: n }), p({ top: r, left: n, width: e.width > 0 ? e.width : void 0 }));
|
|
38
32
|
},
|
|
39
33
|
[t]
|
|
40
34
|
);
|
|
41
|
-
return
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
const
|
|
35
|
+
return g(() => {
|
|
36
|
+
if (s.current) {
|
|
37
|
+
l(s.current);
|
|
38
|
+
const o = w(s.current, l), e = h(s.current, l);
|
|
45
39
|
return () => {
|
|
46
|
-
|
|
40
|
+
o(), e();
|
|
47
41
|
};
|
|
48
42
|
}
|
|
49
|
-
}, [t]), /* @__PURE__ */ v(
|
|
50
|
-
/* @__PURE__ */ a(
|
|
51
|
-
t &&
|
|
43
|
+
}, [t]), /* @__PURE__ */ v(x, { children: [
|
|
44
|
+
/* @__PURE__ */ a(u, { ref: s }),
|
|
45
|
+
t && b(
|
|
52
46
|
/* @__PURE__ */ a(
|
|
53
|
-
|
|
47
|
+
u,
|
|
54
48
|
{
|
|
55
49
|
position: "absolute",
|
|
56
50
|
top: 0,
|
|
57
51
|
left: 0,
|
|
58
52
|
transition: "none",
|
|
59
53
|
style: { transform: `translate(${t.left}px,${t.top}px)`, width: t.width },
|
|
60
|
-
children: /* @__PURE__ */ a(
|
|
54
|
+
children: /* @__PURE__ */ a(u, { position: "absolute", width: "fit", ...f })
|
|
61
55
|
}
|
|
62
56
|
),
|
|
63
57
|
m
|
|
@@ -65,5 +59,5 @@ function M(i) {
|
|
|
65
59
|
] });
|
|
66
60
|
}
|
|
67
61
|
export {
|
|
68
|
-
|
|
62
|
+
y as default
|
|
69
63
|
};
|