@cronocode/react-box 1.7.1 → 1.7.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.
- package/box.d.ts +21 -2
- package/box.js +14 -1
- package/components/baseSvg.d.ts +2 -2
- package/components/baseSvg.js +1 -1
- package/components/button.js +1 -1
- package/components/checkbox.js +1 -1
- package/components/dataGrid.js +1 -1
- package/components/dox.js +86 -92
- package/components/flex.js +1 -1
- package/components/form.js +1 -1
- package/components/grid.js +1 -1
- package/components/radioButton.js +1 -1
- package/components/textarea.js +1 -1
- package/components/textbox.js +1 -1
- package/components/tooltip.js +7 -7
- package/package.json +1 -1
- package/components/dox.d.ts +0 -21
package/box.d.ts
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React, { RefAttributes } from 'react';
|
|
2
|
+
import ClassNameUtils from './utils/className/classNameUtils';
|
|
3
|
+
import { DoxStyleProps } from './components/dox/doxStyles';
|
|
4
|
+
import { StylesContext } from './components/dox/stylesContext';
|
|
5
|
+
type ExtractElementType<T> = T extends React.DetailedHTMLProps<React.HTMLAttributes<infer E>, infer E> ? E : T extends React.SVGProps<infer E> ? E : never;
|
|
6
|
+
type ExtractElementFromTag<T extends keyof React.JSX.IntrinsicElements> = ExtractElementType<React.JSX.IntrinsicElements[T]>;
|
|
7
|
+
type AllProps<TTag extends keyof React.JSX.IntrinsicElements> = React.ComponentProps<TTag>;
|
|
8
|
+
type TagPropsType<TTag extends keyof React.JSX.IntrinsicElements> = Omit<AllProps<TTag>, 'className' | 'style' | 'ref'>;
|
|
9
|
+
interface Props<TTag extends keyof React.JSX.IntrinsicElements> extends DoxStyleProps {
|
|
10
|
+
children?: React.ReactNode | ((props: {
|
|
11
|
+
isHover: boolean;
|
|
12
|
+
}) => React.ReactNode);
|
|
13
|
+
tag?: TTag;
|
|
14
|
+
props?: TagPropsType<TTag>;
|
|
15
|
+
className?: ClassNameUtils.ClassNameType;
|
|
16
|
+
style?: React.ComponentProps<TTag>['style'];
|
|
17
|
+
}
|
|
18
|
+
declare const _default: <TTag extends keyof React.JSX.IntrinsicElements = "div">(props: Props<TTag> & React.RefAttributes<ExtractElementType<React.JSX.IntrinsicElements[TTag]>>) => React.ReactNode;
|
|
19
|
+
export default _default;
|
|
20
|
+
declare const flushStyles: typeof StylesContext.flush;
|
|
21
|
+
export { flushStyles };
|
package/box.js
CHANGED
|
@@ -1 +1,14 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import y, { forwardRef as N, useMemo as v, useState as S } from "react";
|
|
2
|
+
import { C as p } from "./utils.js";
|
|
3
|
+
import { u as C, S as d } from "./components/dox.js";
|
|
4
|
+
function g(e, o) {
|
|
5
|
+
const { tag: a = "div", children: t, props: c, className: f, style: n } = e, m = C(e, a === "svg"), u = v(() => p.classNames(f, m).join(" "), [e]), s = { ...c, className: u };
|
|
6
|
+
n && (s.style = n), o && (s.ref = o);
|
|
7
|
+
const [i, l] = S(!1), r = typeof t == "function";
|
|
8
|
+
return r && (s.onMouseEnter = () => l(!0), s.onMouseLeave = () => l(!1)), y.createElement(a, s, r ? t({ isHover: i }) : t);
|
|
9
|
+
}
|
|
10
|
+
const M = N(g), { flush: E } = d;
|
|
11
|
+
export {
|
|
12
|
+
M as B,
|
|
13
|
+
E as f
|
|
14
|
+
};
|
package/components/baseSvg.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
2
|
+
import Box from '../box';
|
|
3
3
|
import ClassNameUtils from '../utils/className/classNameUtils';
|
|
4
4
|
import { DoxSvgStyles } from './dox/doxStyles';
|
|
5
|
-
type SvgTagProps = Required<React.ComponentProps<typeof
|
|
5
|
+
type SvgTagProps = Required<React.ComponentProps<typeof Box<'svg'>>>['props'];
|
|
6
6
|
type DoxSvgTagProps = Omit<SvgTagProps, 'viewBox' | 'width' | 'height'>;
|
|
7
7
|
interface Props extends DoxSvgStyles {
|
|
8
8
|
children?: React.ReactNode | ((props: {
|
package/components/baseSvg.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as m } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { B as n } from "../box.js";
|
|
4
4
|
function a(o, r) {
|
|
5
5
|
const { viewBox: s = "0 0 24 24", width: t = "1.5rem", height: p, props: e, ...g } = o;
|
|
6
6
|
return /* @__PURE__ */ i(
|
package/components/button.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as s } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { B as p } from "../box.js";
|
|
4
4
|
import { O as i } from "../utils.js";
|
|
5
5
|
const m = ["type", "onClick", "disabled"];
|
|
6
6
|
function e(o, t) {
|
package/components/checkbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as c } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { B as t } from "../box.js";
|
|
4
4
|
import { O as a } from "../utils.js";
|
|
5
5
|
import { F as l } from "./flex.js";
|
|
6
6
|
import { c as d } from "../box.module.css.js";
|
package/components/dataGrid.js
CHANGED
package/components/dox.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { I as
|
|
3
|
-
import { u as
|
|
1
|
+
import { useMemo as L, useLayoutEffect as O, useEffect as I } from "react";
|
|
2
|
+
import { I as _ } from "../utils.js";
|
|
3
|
+
import { u as D } from "../theme.js";
|
|
4
4
|
var e;
|
|
5
5
|
((a) => {
|
|
6
6
|
((r) => {
|
|
7
|
-
function
|
|
7
|
+
function c(l, d) {
|
|
8
8
|
return `${l}${d.replace("/", "-")}`;
|
|
9
9
|
}
|
|
10
|
-
r.fraction =
|
|
11
|
-
function
|
|
10
|
+
r.fraction = c;
|
|
11
|
+
function m(l) {
|
|
12
12
|
return [`${l} path`, `${l} circle`, `${l} rect`, `${l} line`];
|
|
13
13
|
}
|
|
14
|
-
r.svg =
|
|
14
|
+
r.svg = m;
|
|
15
15
|
})(a.ClassName || (a.ClassName = {})), ((r) => {
|
|
16
|
-
function
|
|
16
|
+
function c(u, i) {
|
|
17
17
|
return `${i / 4}rem`;
|
|
18
18
|
}
|
|
19
|
-
r.rem =
|
|
20
|
-
function
|
|
19
|
+
r.rem = c;
|
|
20
|
+
function m(u, i) {
|
|
21
21
|
return `${i}px`;
|
|
22
22
|
}
|
|
23
|
-
r.px =
|
|
23
|
+
r.px = m;
|
|
24
24
|
function l(u, i) {
|
|
25
25
|
const [o, v] = i.split("/");
|
|
26
26
|
return `${+o / +v * 100}%`;
|
|
@@ -41,33 +41,33 @@ var e;
|
|
|
41
41
|
return (i, o) => `var(--${u}${o});`;
|
|
42
42
|
}
|
|
43
43
|
r.variables = g;
|
|
44
|
-
function
|
|
44
|
+
function S(u) {
|
|
45
45
|
return (i, o) => `var(--${u}${o});`;
|
|
46
46
|
}
|
|
47
|
-
r.svgVariables =
|
|
48
|
-
function
|
|
47
|
+
r.svgVariables = S;
|
|
48
|
+
function k(u, i) {
|
|
49
49
|
return `repeat(${i},minmax(0,1fr))`;
|
|
50
50
|
}
|
|
51
|
-
r.gridColumns =
|
|
52
|
-
function
|
|
51
|
+
r.gridColumns = k;
|
|
52
|
+
function N(u, i) {
|
|
53
53
|
return i === "full-row" ? "1/-1" : `span ${i}/span ${i}`;
|
|
54
54
|
}
|
|
55
|
-
r.gridColumn =
|
|
56
|
-
function
|
|
55
|
+
r.gridColumn = N;
|
|
56
|
+
function p(u, i) {
|
|
57
57
|
return `${i}ms`;
|
|
58
58
|
}
|
|
59
|
-
r.ms =
|
|
60
|
-
function
|
|
59
|
+
r.ms = p;
|
|
60
|
+
function y(u, i) {
|
|
61
61
|
return `${i}deg`;
|
|
62
62
|
}
|
|
63
|
-
r.rotate =
|
|
64
|
-
function
|
|
63
|
+
r.rotate = y;
|
|
64
|
+
function $(u, i) {
|
|
65
65
|
return i === "xAxis" ? "-1 1" : "1 -1";
|
|
66
66
|
}
|
|
67
|
-
r.flip =
|
|
67
|
+
r.flip = $;
|
|
68
68
|
})(a.Value || (a.Value = {}));
|
|
69
69
|
})(e || (e = {}));
|
|
70
|
-
const
|
|
70
|
+
const W = ["H", "F", "A"];
|
|
71
71
|
var s;
|
|
72
72
|
((a) => {
|
|
73
73
|
a.positiveSizes = [
|
|
@@ -208,14 +208,14 @@ var s;
|
|
|
208
208
|
"11/12"
|
|
209
209
|
], a.widthHeightValues = ["fit", "fit-screen", "auto", "fit-content", "max-content", "min-content"], a.alignSelf = ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"];
|
|
210
210
|
})(s || (s = {}));
|
|
211
|
-
const
|
|
211
|
+
const A = {
|
|
212
212
|
shadow: { cssNames: ["box-shadow"], formatValue: e.Value.variables("shadow") },
|
|
213
213
|
background: { cssNames: ["background"], formatValue: e.Value.variables("background") },
|
|
214
214
|
color: { cssNames: ["color"], formatValue: e.Value.variables("color") },
|
|
215
215
|
bgColor: { cssNames: ["background-color"], formatValue: e.Value.variables("color") },
|
|
216
216
|
borderColor: { cssNames: ["border-color"], formatValue: e.Value.variables("color") },
|
|
217
217
|
outlineColor: { cssNames: ["outline-color"], formatValue: e.Value.variables("color") }
|
|
218
|
-
},
|
|
218
|
+
}, R = {
|
|
219
219
|
fill: {
|
|
220
220
|
cssNames: ["fill"],
|
|
221
221
|
formatValue: e.Value.svgVariables("color"),
|
|
@@ -226,7 +226,7 @@ const R = {
|
|
|
226
226
|
formatValue: e.Value.svgVariables("color"),
|
|
227
227
|
formatSelector: e.ClassName.svg
|
|
228
228
|
}
|
|
229
|
-
},
|
|
229
|
+
}, x = {
|
|
230
230
|
hover: { className: "_h" },
|
|
231
231
|
focus: { className: "_f" }
|
|
232
232
|
}, t = {
|
|
@@ -872,13 +872,13 @@ const R = {
|
|
|
872
872
|
Object.keys(C).forEach((a) => {
|
|
873
873
|
t[a] = C[a];
|
|
874
874
|
});
|
|
875
|
-
Object.keys(R).forEach((a) => {
|
|
876
|
-
t[a] = R[a], t[a].isThemeStyle = !0;
|
|
877
|
-
});
|
|
878
875
|
Object.keys(A).forEach((a) => {
|
|
879
876
|
t[a] = A[a], t[a].isThemeStyle = !0;
|
|
880
877
|
});
|
|
881
|
-
|
|
878
|
+
Object.keys(R).forEach((a) => {
|
|
879
|
+
t[a] = R[a], t[a].isThemeStyle = !0;
|
|
880
|
+
});
|
|
881
|
+
const V = {
|
|
882
882
|
w: { ...t.width, key: "width" },
|
|
883
883
|
h: { ...t.height, key: "height" },
|
|
884
884
|
m: { ...t.margin, key: "margin" },
|
|
@@ -906,15 +906,15 @@ const y = {
|
|
|
906
906
|
ai: { ...t.alignItems, key: "alignItems" },
|
|
907
907
|
ac: { ...t.alignContent, key: "alignContent" },
|
|
908
908
|
d: { ...t.flexDirection, key: "flexDirection" }
|
|
909
|
-
},
|
|
910
|
-
|
|
911
|
-
|
|
909
|
+
}, G = Object.keys(t), P = Object.keys(V);
|
|
910
|
+
W.forEach((a) => {
|
|
911
|
+
G.forEach((r) => {
|
|
912
912
|
t[`${r}${a}`] = { ...t[r] }, t[`${r}${a}`].pseudoSuffix = a;
|
|
913
|
-
}),
|
|
914
|
-
|
|
913
|
+
}), P.forEach((r) => {
|
|
914
|
+
V[`${r}${a}`] = { ...V[r], key: `${V[r].key}${a}` }, V[`${r}${a}`].pseudoSuffix = a;
|
|
915
915
|
});
|
|
916
916
|
});
|
|
917
|
-
var
|
|
917
|
+
var b;
|
|
918
918
|
((a) => {
|
|
919
919
|
a.doxClassName = "_dox", a.svgClassName = "_svg";
|
|
920
920
|
const r = `:root{--borderColor: black;--outlineColor: black;--lineHeight: 1.2;--fontSize: 14px;--transitionTime: 0.25s;--svgTransitionTime: 0.3s;#crono-box {position: absolute;top: 0;left: 0;height: 0;}}
|
|
@@ -923,88 +923,82 @@ body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
|
|
|
923
923
|
a,ul{all: unset;}
|
|
924
924
|
.${a.doxClassName}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;background-color: initial;transition: all var(--transitionTime);box-sizing: border-box;font-family: inherit;font-size: inherit;}
|
|
925
925
|
.${a.svgClassName}{transition: all var(--svgTransitionTime);}.${a.svgClassName} path,.${a.svgClassName} circle,.${a.svgClassName} rect,.${a.svgClassName} line {transition: all var(--svgTransitionTime);}
|
|
926
|
-
`,
|
|
926
|
+
`, c = new _(), m = Object.keys(t), l = $();
|
|
927
927
|
let d = !1;
|
|
928
|
-
const g =
|
|
929
|
-
function
|
|
928
|
+
const g = m.reduce((u, i) => (u[i] = /* @__PURE__ */ new Set(), u), {});
|
|
929
|
+
function S(u, i) {
|
|
930
930
|
if (u in t)
|
|
931
|
-
return
|
|
932
|
-
if (u in
|
|
933
|
-
return
|
|
931
|
+
return N(u, i);
|
|
932
|
+
if (u in x)
|
|
933
|
+
return x[u].className;
|
|
934
934
|
if (u in C)
|
|
935
|
-
return
|
|
935
|
+
return N(u, i);
|
|
936
936
|
}
|
|
937
|
-
a.get =
|
|
938
|
-
function
|
|
937
|
+
a.get = S;
|
|
938
|
+
function k() {
|
|
939
939
|
if (d) {
|
|
940
940
|
console.info("%c💬Flush Dox Styles", "color: #00ffff");
|
|
941
|
-
let u =
|
|
942
|
-
u =
|
|
941
|
+
let u = p([r]);
|
|
942
|
+
u = p(u, "H"), u = p(u, "F"), u = p(u, "A"), l.innerHTML = u.join(""), d = !1;
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
|
-
a.flush =
|
|
946
|
-
function
|
|
947
|
-
var
|
|
945
|
+
a.flush = k;
|
|
946
|
+
function N(u, i) {
|
|
947
|
+
var n;
|
|
948
948
|
g[u].has(i) || (d = !0, g[u].add(i));
|
|
949
|
-
const o =
|
|
950
|
-
return `-${
|
|
949
|
+
const o = y(u, i), v = ((n = o.formatClassName) == null ? void 0 : n.call(o, u, i)) ?? `${u}${i}`;
|
|
950
|
+
return `-${c.getIdentity(v)}`;
|
|
951
951
|
}
|
|
952
|
-
function
|
|
952
|
+
function p(u, i) {
|
|
953
953
|
return Object.entries(g).filter(([v]) => {
|
|
954
|
-
var
|
|
955
|
-
return ((
|
|
956
|
-
}).reduce((v, [
|
|
954
|
+
var n;
|
|
955
|
+
return ((n = t[v]) == null ? void 0 : n.pseudoSuffix) === i;
|
|
956
|
+
}).reduce((v, [n, j]) => (j.forEach((z) => {
|
|
957
957
|
var T;
|
|
958
|
-
const
|
|
959
|
-
let
|
|
960
|
-
i ? i === "H" ?
|
|
961
|
-
...o(`${
|
|
962
|
-
...o(`.${
|
|
963
|
-
] : i === "F" ?
|
|
964
|
-
...o(`${
|
|
965
|
-
...o(`.${
|
|
966
|
-
] : i === "A" && (
|
|
967
|
-
const F = ((T =
|
|
968
|
-
v.push(`${
|
|
958
|
+
const f = y(n, z), h = `.${N(n, z)}`;
|
|
959
|
+
let w = [];
|
|
960
|
+
i ? i === "H" ? w = [
|
|
961
|
+
...o(`${h}:hover`, f),
|
|
962
|
+
...o(`.${x.hover.className}:hover>${h}`, f)
|
|
963
|
+
] : i === "F" ? w = [
|
|
964
|
+
...o(`${h}:focus-within`, f),
|
|
965
|
+
...o(`.${x.focus.className}:focus-within>${h}`, f)
|
|
966
|
+
] : i === "A" && (w = o(`${h}:active`, f)) : w = o(h, f);
|
|
967
|
+
const F = ((T = f.formatValue) == null ? void 0 : T.call(f, n, z)) ?? z, B = t[n].cssNames.map((E) => `${E}:${F};`).join("");
|
|
968
|
+
v.push(`${w.join(",")}{${B}}`);
|
|
969
969
|
}), v), u);
|
|
970
|
-
function o(v,
|
|
971
|
-
return
|
|
970
|
+
function o(v, n) {
|
|
971
|
+
return n.formatSelector ? n.formatSelector(v) : [v];
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
|
-
function
|
|
974
|
+
function y(u, i) {
|
|
975
975
|
const o = t[u];
|
|
976
976
|
return o.isThemeStyle ? o : o.values1.values.includes(i) ? o.values1 : o.values2.values.includes(i) ? o.values2 : o.values3;
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function $() {
|
|
979
979
|
const u = "crono-styles", o = typeof window < "u" && typeof window.document < "u" ? window.document : global.document;
|
|
980
980
|
let v = o.getElementById(u);
|
|
981
981
|
return v || (v = o.createElement("style"), v.setAttribute("id", u), v.setAttribute("type", "text/css"), o.head.insertBefore(v, o.head.firstChild)), v;
|
|
982
982
|
}
|
|
983
|
-
})(
|
|
984
|
-
const
|
|
983
|
+
})(b || (b = {}));
|
|
984
|
+
const q = typeof window < "u" && typeof window.document < "u", M = q ? O : I;
|
|
985
985
|
function Q(a, r) {
|
|
986
|
-
const
|
|
987
|
-
return
|
|
988
|
-
const
|
|
986
|
+
const c = D(a);
|
|
987
|
+
return M(b.flush, [a]), L(() => {
|
|
988
|
+
const m = [r ? b.svgClassName : b.doxClassName], l = c ? { ...H(c), ...H(a) } : H(a);
|
|
989
989
|
return "inline" in l && (l.display === "block" ? l.display = "inline-block" : l.display === "flex" ? l.display = "inline-flex" : l.display === "grid" && (l.display = "inline-grid"), delete l.inline), "inlineH" in l && (l.displayH === "block" ? l.displayH = "inline-block" : l.displayH === "flex" ? l.displayH = "inline-flex" : l.displayH === "grid" && (l.displayH = "inline-grid"), delete l.inlineH), "inlineF" in l && (l.displayF === "block" ? l.displayF = "inline-block" : l.displayF === "flex" ? l.displayF = "inline-flex" : l.displayF === "grid" && (l.displayF = "inline-grid"), delete l.inlineF), "inlineA" in l && (l.displayA === "block" ? l.displayA = "inline-block" : l.displayA === "flex" ? l.displayA = "inline-flex" : l.displayA === "grid" && (l.displayA = "inline-grid"), delete l.inlineA), Object.entries(l).forEach(([d, g]) => {
|
|
990
|
-
|
|
991
|
-
}),
|
|
992
|
-
}, [a,
|
|
990
|
+
m.push(b.get(d, g));
|
|
991
|
+
}), m;
|
|
992
|
+
}, [a, c]);
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function H(a) {
|
|
995
995
|
const r = { ...a };
|
|
996
|
-
return Object.keys(r).forEach((
|
|
997
|
-
const l =
|
|
998
|
-
l && (l.key in r || (r[l.key] = r[
|
|
996
|
+
return Object.keys(r).forEach((m) => {
|
|
997
|
+
const l = V[m];
|
|
998
|
+
l && (l.key in r || (r[l.key] = r[m]), delete r[m]);
|
|
999
999
|
}), r;
|
|
1000
1000
|
}
|
|
1001
|
-
function Z(a, r) {
|
|
1002
|
-
const { tag: m = "div", children: n, props: l, className: d, style: g } = a, z = Q(a, m === "svg"), x = j(() => W.classNames(d, z).join(" "), [a]), f = { ...l, className: x };
|
|
1003
|
-
g && (f.style = g), r && (f.ref = r);
|
|
1004
|
-
const [h, V] = P(!1), b = typeof n == "function";
|
|
1005
|
-
return b && (f.onMouseEnter = () => V(!0), f.onMouseLeave = () => V(!1)), O.createElement(m, f, b ? n({ isHover: h }) : n);
|
|
1006
|
-
}
|
|
1007
|
-
const le = _(Z);
|
|
1008
1001
|
export {
|
|
1009
|
-
|
|
1002
|
+
b as S,
|
|
1003
|
+
Q as u
|
|
1010
1004
|
};
|
package/components/flex.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as t } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { B as f } from "../box.js";
|
|
4
4
|
function s(o, r) {
|
|
5
5
|
const { inline: e, ...i } = o;
|
|
6
6
|
return /* @__PURE__ */ n(f, { ref: r, display: e ? "inline-flex" : "flex", ...i });
|
package/components/form.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as i, useCallback as p } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { B as u } from "../box.js";
|
|
4
4
|
import { F as c } from "../utils.js";
|
|
5
5
|
function x(o) {
|
|
6
6
|
const { onSubmit: m, props: n } = o, r = i(null), s = p((t) => {
|
package/components/grid.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as s } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { B as d } from "../box.js";
|
|
4
4
|
function e(r, i) {
|
|
5
5
|
const { inline: o, ...n } = r;
|
|
6
6
|
return /* @__PURE__ */ t(d, { ref: i, display: o ? "inline-grid" : "grid", ...n });
|
package/components/textarea.js
CHANGED
package/components/textbox.js
CHANGED
package/components/tooltip.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as v, Fragment as x, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { createPortal as b } from "react-dom";
|
|
3
|
-
import {
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { u as
|
|
3
|
+
import { B as u } from "../box.js";
|
|
4
|
+
import { useRef as E, useState as L, useCallback as d, useLayoutEffect as g } from "react";
|
|
5
|
+
import { u as z } from "../utils.js";
|
|
6
6
|
const i = 2;
|
|
7
|
-
function
|
|
8
|
-
const { onPositionChange: c } = f, s =
|
|
7
|
+
function j(f) {
|
|
8
|
+
const { onPositionChange: c } = f, s = E(null), [t, p] = L(), m = z(), w = d(
|
|
9
9
|
(o, e) => {
|
|
10
10
|
const r = (n) => {
|
|
11
11
|
n.target.contains(o) && e(o);
|
|
@@ -32,7 +32,7 @@ function y(f) {
|
|
|
32
32
|
},
|
|
33
33
|
[t]
|
|
34
34
|
);
|
|
35
|
-
return
|
|
35
|
+
return g(() => {
|
|
36
36
|
if (s.current) {
|
|
37
37
|
l(s.current);
|
|
38
38
|
const o = w(s.current, l), e = h(s.current, l);
|
|
@@ -59,5 +59,5 @@ function y(f) {
|
|
|
59
59
|
] });
|
|
60
60
|
}
|
|
61
61
|
export {
|
|
62
|
-
|
|
62
|
+
j as T
|
|
63
63
|
};
|
package/package.json
CHANGED
package/components/dox.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React, { RefAttributes } from 'react';
|
|
2
|
-
import ClassNameUtils from '../utils/className/classNameUtils';
|
|
3
|
-
import { DoxStyleProps } from './dox/doxStyles';
|
|
4
|
-
import { StylesContext } from './dox/stylesContext';
|
|
5
|
-
type ExtractElementType<T> = T extends React.DetailedHTMLProps<React.HTMLAttributes<infer E>, infer E> ? E : T extends React.SVGProps<infer E> ? E : never;
|
|
6
|
-
type ExtractElementFromTag<T extends keyof React.JSX.IntrinsicElements> = ExtractElementType<React.JSX.IntrinsicElements[T]>;
|
|
7
|
-
type AllProps<TTag extends keyof React.JSX.IntrinsicElements> = React.ComponentProps<TTag>;
|
|
8
|
-
type TagPropsType<TTag extends keyof React.JSX.IntrinsicElements> = Omit<AllProps<TTag>, 'className' | 'style' | 'ref'>;
|
|
9
|
-
interface Props<TTag extends keyof React.JSX.IntrinsicElements> extends DoxStyleProps {
|
|
10
|
-
children?: React.ReactNode | ((props: {
|
|
11
|
-
isHover: boolean;
|
|
12
|
-
}) => React.ReactNode);
|
|
13
|
-
tag?: TTag;
|
|
14
|
-
props?: TagPropsType<TTag>;
|
|
15
|
-
className?: ClassNameUtils.ClassNameType;
|
|
16
|
-
style?: React.ComponentProps<TTag>['style'];
|
|
17
|
-
}
|
|
18
|
-
declare const _default: <TTag extends keyof React.JSX.IntrinsicElements = "div">(props: Props<TTag> & React.RefAttributes<ExtractElementType<React.JSX.IntrinsicElements[TTag]>>) => React.ReactNode;
|
|
19
|
-
export default _default;
|
|
20
|
-
declare const flushStyles: typeof StylesContext.flush;
|
|
21
|
-
export { flushStyles };
|