@cronocode/react-box 1.6.6 → 1.6.8
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/components/baseSvg.cjs +1 -1
- package/components/baseSvg.mjs +1 -4
- package/components/button.cjs +1 -1
- package/components/button.d.ts +1 -0
- package/components/button.mjs +7 -10
- package/components/checkbox.cjs +1 -1
- package/components/checkbox.mjs +4 -7
- package/components/dataGrid/dataGridContract.d.ts +1 -0
- package/components/dataGrid.cjs +1 -1
- package/components/dataGrid.d.ts +1 -1
- package/components/dataGrid.mjs +2 -32
- package/components/dox/doxStyles.d.ts +9 -0
- package/components/dox.cjs +2 -2
- package/components/dox.d.ts +6 -4
- package/components/dox.mjs +125 -126
- package/components/doxSvg.cjs +1 -1
- package/components/doxSvg.d.ts +1 -0
- package/components/doxSvg.mjs +4 -7
- package/components/flex.d.ts +4 -2
- package/components/form.cjs +1 -1
- package/components/form.d.ts +2 -1
- package/components/form.mjs +4 -15
- package/components/grid.cjs +1 -1
- package/components/grid.d.ts +4 -2
- package/components/grid.mjs +5 -8
- package/components/radioButton.cjs +1 -1
- package/components/radioButton.mjs +2 -5
- package/components/textarea.cjs +1 -1
- package/components/textarea.mjs +7 -10
- package/components/textbox.cjs +1 -1
- package/components/textbox.mjs +6 -9
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.d.ts +1 -1
- package/components/tooltip.mjs +5 -63
- package/package.json +14 -14
- package/plugins.cjs +1 -209
- package/plugins.mjs +0 -219
- package/style.css +1 -1
- package/theme.cjs +1 -1
- package/theme.mjs +23 -25
- package/types.d.ts +9 -0
- package/utils/utils.cjs +1 -1
- package/utils/utils.mjs +53 -63
package/components/dox.mjs
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import
|
|
1
|
+
import O, { useMemo as j, useLayoutEffect as I, useEffect as _, forwardRef as D, useState as P } from "react";
|
|
2
2
|
import { I as M, C as W } from "../utils/utils.mjs";
|
|
3
3
|
import { useTheme as G } from "../theme.mjs";
|
|
4
4
|
var e;
|
|
5
5
|
((a) => {
|
|
6
6
|
((r) => {
|
|
7
|
-
function m(
|
|
8
|
-
return `${
|
|
7
|
+
function m(l, d) {
|
|
8
|
+
return `${l}${d.replace("/", "-")}`;
|
|
9
9
|
}
|
|
10
10
|
r.fraction = m;
|
|
11
|
-
function n(
|
|
12
|
-
return [`${
|
|
11
|
+
function n(l) {
|
|
12
|
+
return [`${l} path`, `${l} circle`, `${l} rect`, `${l} line`];
|
|
13
13
|
}
|
|
14
14
|
r.svg = n;
|
|
15
15
|
})(a.ClassName || (a.ClassName = {})), ((r) => {
|
|
16
|
-
function m(
|
|
17
|
-
return `${
|
|
16
|
+
function m(u, t) {
|
|
17
|
+
return `${t / 4}rem`;
|
|
18
18
|
}
|
|
19
19
|
r.rem = m;
|
|
20
|
-
function n(
|
|
21
|
-
return `${
|
|
20
|
+
function n(u, t) {
|
|
21
|
+
return `${t}px`;
|
|
22
22
|
}
|
|
23
23
|
r.px = n;
|
|
24
|
-
function
|
|
25
|
-
const [
|
|
26
|
-
return `${+
|
|
24
|
+
function l(u, t) {
|
|
25
|
+
const [o, v] = t.split("/");
|
|
26
|
+
return `${+o / +v * 100}%`;
|
|
27
27
|
}
|
|
28
|
-
r.fraction =
|
|
29
|
-
function d(
|
|
30
|
-
switch (
|
|
28
|
+
r.fraction = l;
|
|
29
|
+
function d(u, t) {
|
|
30
|
+
switch (t) {
|
|
31
31
|
case "fit":
|
|
32
32
|
return "100%";
|
|
33
33
|
case "fit-screen":
|
|
34
|
-
return
|
|
34
|
+
return u.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
|
|
35
35
|
default:
|
|
36
|
-
return
|
|
36
|
+
return t;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
r.widthHeight = d;
|
|
40
|
-
function g(
|
|
41
|
-
return (
|
|
40
|
+
function g(u) {
|
|
41
|
+
return (t, o) => `var(--${u}${o});`;
|
|
42
42
|
}
|
|
43
43
|
r.variables = g;
|
|
44
|
-
function
|
|
45
|
-
return (
|
|
44
|
+
function z(u) {
|
|
45
|
+
return (t, o) => `var(--${u}${o});`;
|
|
46
46
|
}
|
|
47
|
-
r.svgVariables =
|
|
48
|
-
function x(
|
|
49
|
-
return `repeat(${
|
|
47
|
+
r.svgVariables = z;
|
|
48
|
+
function x(u, t) {
|
|
49
|
+
return `repeat(${t},minmax(0,1fr))`;
|
|
50
50
|
}
|
|
51
51
|
r.gridColumns = x;
|
|
52
|
-
function f(
|
|
53
|
-
return
|
|
52
|
+
function f(u, t) {
|
|
53
|
+
return t === "full-row" ? "1/-1" : `span ${t}/span ${t}`;
|
|
54
54
|
}
|
|
55
55
|
r.gridColumn = f;
|
|
56
|
-
function h(
|
|
57
|
-
return `${
|
|
56
|
+
function h(u, t) {
|
|
57
|
+
return `${t}ms`;
|
|
58
58
|
}
|
|
59
59
|
r.ms = h;
|
|
60
|
-
function V(
|
|
61
|
-
return `${
|
|
60
|
+
function V(u, t) {
|
|
61
|
+
return `${t}deg`;
|
|
62
62
|
}
|
|
63
63
|
r.rotate = V;
|
|
64
|
-
function
|
|
65
|
-
return
|
|
64
|
+
function b(u, t) {
|
|
65
|
+
return t === "xAxis" ? "-1 1" : "1 -1";
|
|
66
66
|
}
|
|
67
|
-
r.flip =
|
|
67
|
+
r.flip = b;
|
|
68
68
|
})(a.Value || (a.Value = {}));
|
|
69
69
|
})(e || (e = {}));
|
|
70
70
|
const q = ["H", "F", "A"];
|
|
@@ -215,7 +215,7 @@ const R = {
|
|
|
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
|
+
}, A = {
|
|
219
219
|
fill: {
|
|
220
220
|
cssNames: ["fill"],
|
|
221
221
|
formatValue: e.Value.svgVariables("color"),
|
|
@@ -226,10 +226,10 @@ const R = {
|
|
|
226
226
|
formatValue: e.Value.svgVariables("color"),
|
|
227
227
|
formatSelector: e.ClassName.svg
|
|
228
228
|
}
|
|
229
|
-
},
|
|
229
|
+
}, H = {
|
|
230
230
|
hover: { className: "_h" },
|
|
231
231
|
focus: { className: "_f" }
|
|
232
|
-
},
|
|
232
|
+
}, i = {
|
|
233
233
|
display: {
|
|
234
234
|
cssNames: ["display"],
|
|
235
235
|
values1: { values: ["none", "block", "inline-block", "flex", "inline-flex", "grid", "inline-grid", "contents"] },
|
|
@@ -870,51 +870,51 @@ const R = {
|
|
|
870
870
|
}
|
|
871
871
|
};
|
|
872
872
|
Object.keys(C).forEach((a) => {
|
|
873
|
-
|
|
873
|
+
i[a] = C[a];
|
|
874
874
|
});
|
|
875
875
|
Object.keys(R).forEach((a) => {
|
|
876
|
-
|
|
876
|
+
i[a] = R[a], i[a].isThemeStyle = !0;
|
|
877
877
|
});
|
|
878
|
-
Object.keys(
|
|
879
|
-
|
|
878
|
+
Object.keys(A).forEach((a) => {
|
|
879
|
+
i[a] = A[a], i[a].isThemeStyle = !0;
|
|
880
880
|
});
|
|
881
|
-
const
|
|
882
|
-
w: { ...
|
|
883
|
-
h: { ...
|
|
884
|
-
m: { ...
|
|
885
|
-
mx: { ...
|
|
886
|
-
my: { ...
|
|
887
|
-
mt: { ...
|
|
888
|
-
mr: { ...
|
|
889
|
-
mb: { ...
|
|
890
|
-
ml: { ...
|
|
891
|
-
p: { ...
|
|
892
|
-
px: { ...
|
|
893
|
-
py: { ...
|
|
894
|
-
pt: { ...
|
|
895
|
-
pr: { ...
|
|
896
|
-
pb: { ...
|
|
897
|
-
pl: { ...
|
|
898
|
-
b: { ...
|
|
899
|
-
bx: { ...
|
|
900
|
-
by: { ...
|
|
901
|
-
bt: { ...
|
|
902
|
-
br: { ...
|
|
903
|
-
bb: { ...
|
|
904
|
-
bl: { ...
|
|
905
|
-
jc: { ...
|
|
906
|
-
ai: { ...
|
|
907
|
-
ac: { ...
|
|
908
|
-
d: { ...
|
|
909
|
-
}, U = Object.keys(
|
|
881
|
+
const y = {
|
|
882
|
+
w: { ...i.width, key: "width" },
|
|
883
|
+
h: { ...i.height, key: "height" },
|
|
884
|
+
m: { ...i.margin, key: "margin" },
|
|
885
|
+
mx: { ...i.marginHorizontal, key: "marginHorizontal" },
|
|
886
|
+
my: { ...i.marginVertical, key: "marginVertical" },
|
|
887
|
+
mt: { ...i.marginTop, key: "marginTop" },
|
|
888
|
+
mr: { ...i.marginRight, key: "marginRight" },
|
|
889
|
+
mb: { ...i.marginBottom, key: "marginBottom" },
|
|
890
|
+
ml: { ...i.marginLeft, key: "marginLeft" },
|
|
891
|
+
p: { ...i.padding, key: "padding" },
|
|
892
|
+
px: { ...i.paddingHorizontal, key: "paddingHorizontal" },
|
|
893
|
+
py: { ...i.paddingVertical, key: "paddingVertical" },
|
|
894
|
+
pt: { ...i.paddingTop, key: "paddingTop" },
|
|
895
|
+
pr: { ...i.paddingRight, key: "paddingRight" },
|
|
896
|
+
pb: { ...i.paddingBottom, key: "paddingBottom" },
|
|
897
|
+
pl: { ...i.paddingLeft, key: "paddingLeft" },
|
|
898
|
+
b: { ...i.border, key: "border" },
|
|
899
|
+
bx: { ...i.borderHorizontal, key: "borderHorizontal" },
|
|
900
|
+
by: { ...i.borderVertical, key: "borderVertical" },
|
|
901
|
+
bt: { ...i.borderTop, key: "borderTop" },
|
|
902
|
+
br: { ...i.borderRight, key: "borderRight" },
|
|
903
|
+
bb: { ...i.borderBottom, key: "borderBottom" },
|
|
904
|
+
bl: { ...i.borderLeft, key: "borderLeft" },
|
|
905
|
+
jc: { ...i.justifyContent, key: "justifyContent" },
|
|
906
|
+
ai: { ...i.alignItems, key: "alignItems" },
|
|
907
|
+
ac: { ...i.alignContent, key: "alignContent" },
|
|
908
|
+
d: { ...i.flexDirection, key: "flexDirection" }
|
|
909
|
+
}, U = Object.keys(i), X = Object.keys(y);
|
|
910
910
|
q.forEach((a) => {
|
|
911
911
|
U.forEach((r) => {
|
|
912
|
-
|
|
912
|
+
i[`${r}${a}`] = { ...i[r] }, i[`${r}${a}`].pseudoSuffix = a;
|
|
913
913
|
}), X.forEach((r) => {
|
|
914
|
-
|
|
914
|
+
y[`${r}${a}`] = { ...y[r], key: `${y[r].key}${a}` }, y[`${r}${a}`].pseudoSuffix = a;
|
|
915
915
|
});
|
|
916
916
|
});
|
|
917
|
-
var
|
|
917
|
+
var w;
|
|
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,89 +923,88 @@ 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
|
-
`, m = new M(), n = Object.keys(
|
|
926
|
+
`, m = new M(), n = Object.keys(i), l = b();
|
|
927
927
|
let d = !1;
|
|
928
|
-
const g = n.reduce((
|
|
929
|
-
function
|
|
930
|
-
if (
|
|
931
|
-
return f(
|
|
932
|
-
if (
|
|
933
|
-
return
|
|
934
|
-
if (
|
|
935
|
-
return f(
|
|
928
|
+
const g = n.reduce((u, t) => (u[t] = /* @__PURE__ */ new Set(), u), {});
|
|
929
|
+
function z(u, t) {
|
|
930
|
+
if (u in i)
|
|
931
|
+
return f(u, t);
|
|
932
|
+
if (u in H)
|
|
933
|
+
return H[u].className;
|
|
934
|
+
if (u in C)
|
|
935
|
+
return f(u, t);
|
|
936
936
|
}
|
|
937
|
-
a.get =
|
|
937
|
+
a.get = z;
|
|
938
938
|
function x() {
|
|
939
939
|
if (d) {
|
|
940
940
|
console.info("%c💬Flush Dox Styles", "color: #00ffff");
|
|
941
|
-
let
|
|
942
|
-
|
|
941
|
+
let u = h([r]);
|
|
942
|
+
u = h(u, "H"), u = h(u, "F"), u = h(u, "A"), l.innerHTML = u.join(""), d = !1;
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
945
|
a.flush = x;
|
|
946
|
-
function f(
|
|
946
|
+
function f(u, t) {
|
|
947
947
|
var c;
|
|
948
|
-
g[
|
|
949
|
-
const
|
|
950
|
-
return `-${m.getIdentity(
|
|
948
|
+
g[u].has(t) || (d = !0, g[u].add(t));
|
|
949
|
+
const o = V(u, t), v = ((c = o.formatClassName) == null ? void 0 : c.call(o, u, t)) ?? `${u}${t}`;
|
|
950
|
+
return `-${m.getIdentity(v)}`;
|
|
951
951
|
}
|
|
952
|
-
function h(
|
|
953
|
-
return Object.entries(g).filter(([
|
|
952
|
+
function h(u, t) {
|
|
953
|
+
return Object.entries(g).filter(([v]) => {
|
|
954
954
|
var c;
|
|
955
|
-
return ((c =
|
|
956
|
-
}).reduce((
|
|
955
|
+
return ((c = i[v]) == null ? void 0 : c.pseudoSuffix) === t;
|
|
956
|
+
}).reduce((v, [c, E]) => (E.forEach((k) => {
|
|
957
957
|
var T;
|
|
958
|
-
const p = V(c, k),
|
|
958
|
+
const p = V(c, k), N = `.${f(c, k)}`;
|
|
959
959
|
let S = [];
|
|
960
|
-
|
|
961
|
-
...
|
|
962
|
-
...
|
|
963
|
-
] :
|
|
964
|
-
...
|
|
965
|
-
...
|
|
966
|
-
] :
|
|
967
|
-
const
|
|
968
|
-
|
|
969
|
-
}),
|
|
970
|
-
function
|
|
971
|
-
return c.formatSelector ? c.formatSelector(
|
|
960
|
+
t ? t === "H" ? S = [
|
|
961
|
+
...o(`${N}:hover`, p),
|
|
962
|
+
...o(`.${H.hover.className}:hover>${N}`, p)
|
|
963
|
+
] : t === "F" ? S = [
|
|
964
|
+
...o(`${N}:focus-within`, p),
|
|
965
|
+
...o(`.${H.focus.className}:focus-within>${N}`, p)
|
|
966
|
+
] : t === "A" && (S = o(`${N}:active`, p)) : S = o(N, p);
|
|
967
|
+
const F = ((T = p.formatValue) == null ? void 0 : T.call(p, c, k)) ?? k, B = i[c].cssNames.map((L) => `${L}:${F};`).join("");
|
|
968
|
+
v.push(`${S.join(",")}{${B}}`);
|
|
969
|
+
}), v), u);
|
|
970
|
+
function o(v, c) {
|
|
971
|
+
return c.formatSelector ? c.formatSelector(v) : [v];
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
|
-
function V(
|
|
975
|
-
const
|
|
976
|
-
return
|
|
974
|
+
function V(u, t) {
|
|
975
|
+
const o = i[u];
|
|
976
|
+
return o.isThemeStyle ? o : o.values1.values.includes(t) ? o.values1 : o.values2.values.includes(t) ? o.values2 : o.values3;
|
|
977
977
|
}
|
|
978
|
-
function
|
|
979
|
-
const
|
|
980
|
-
let
|
|
981
|
-
return
|
|
978
|
+
function b() {
|
|
979
|
+
const u = "crono-styles", o = typeof window < "u" && typeof window.document < "u" ? window.document : global.document;
|
|
980
|
+
let v = o.getElementById(u);
|
|
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
|
-
})(
|
|
983
|
+
})(w || (w = {}));
|
|
984
984
|
const Y = typeof window < "u" && typeof window.document < "u", J = Y ? I : _;
|
|
985
985
|
function Q(a, r) {
|
|
986
986
|
const m = G(a);
|
|
987
|
-
return J(
|
|
988
|
-
const n = [r ?
|
|
989
|
-
return Object.entries(
|
|
990
|
-
n.push(
|
|
987
|
+
return J(w.flush, [a]), j(() => {
|
|
988
|
+
const n = [r ? w.svgClassName : w.doxClassName], l = m ? { ...$(m), ...$(a) } : $(a);
|
|
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
|
+
n.push(w.get(d, g));
|
|
991
991
|
}), n;
|
|
992
992
|
}, [a, m]);
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function $(a) {
|
|
995
995
|
const r = { ...a };
|
|
996
996
|
return Object.keys(r).forEach((n) => {
|
|
997
|
-
const
|
|
998
|
-
|
|
997
|
+
const l = y[n];
|
|
998
|
+
l && (l.key in r || (r[l.key] = r[n]), delete r[n]);
|
|
999
999
|
}), r;
|
|
1000
1000
|
}
|
|
1001
1001
|
function Z(a, r) {
|
|
1002
|
-
const { tag: m = "div", children: n, props:
|
|
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
1003
|
g && (f.style = g), r && (f.ref = r);
|
|
1004
|
-
const [h, V] = P(!1),
|
|
1005
|
-
return
|
|
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
1006
|
}
|
|
1007
|
-
const le = D(Z)
|
|
1007
|
+
const le = D(Z);
|
|
1008
1008
|
export {
|
|
1009
|
-
le as default
|
|
1010
|
-
ue as flushStyles
|
|
1009
|
+
le as default
|
|
1011
1010
|
};
|
package/components/doxSvg.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const u=require("react/jsx-runtime"),c=require("react"),g=require("./dox.cjs");require("../utils/utils.cjs");require("../theme.cjs");function p(r,e){const{viewBox:t="0 0 24 24",width:s="1.5rem",height:o,props:i,...n}=r;return u.jsx(g.default,{tag:"svg",ref:e,props:{...i,viewBox:t,width:s,height:o,xmlns:"http://www.w3.org/2000/svg",fill:"none"},...n})}c.forwardRef(p);
|
package/components/doxSvg.d.ts
CHANGED
package/components/doxSvg.mjs
CHANGED
|
@@ -4,18 +4,15 @@ import g from "./dox.mjs";
|
|
|
4
4
|
import "../utils/utils.mjs";
|
|
5
5
|
import "../theme.mjs";
|
|
6
6
|
function n(o, r) {
|
|
7
|
-
const { viewBox: t = "0 0 24 24", width: p = "1.5rem", height:
|
|
7
|
+
const { viewBox: t = "0 0 24 24", width: p = "1.5rem", height: i, props: m, ...s } = o;
|
|
8
8
|
return /* @__PURE__ */ e(
|
|
9
9
|
g,
|
|
10
10
|
{
|
|
11
11
|
tag: "svg",
|
|
12
12
|
ref: r,
|
|
13
|
-
props: { ...
|
|
14
|
-
...
|
|
13
|
+
props: { ...m, viewBox: t, width: p, height: i, xmlns: "http://www.w3.org/2000/svg", fill: "none" },
|
|
14
|
+
...s
|
|
15
15
|
}
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
l as default
|
|
21
|
-
};
|
|
18
|
+
f(n);
|
package/components/flex.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { RefAttributes } from 'react';
|
|
2
2
|
import Box from '../box';
|
|
3
|
-
type
|
|
4
|
-
|
|
3
|
+
type ExtractElementType<T> = T extends React.DetailedHTMLProps<React.HTMLAttributes<infer E>, infer E> ? E : T extends React.SVGProps<infer E> ? E : never;
|
|
4
|
+
type ExtractElementFromTag<T extends keyof React.JSX.IntrinsicElements> = ExtractElementType<React.JSX.IntrinsicElements[T]>;
|
|
5
|
+
type BoxProps<TTag extends keyof React.JSX.IntrinsicElements = 'div'> = Omit<React.ComponentProps<typeof Box<TTag>>, 'ref'>;
|
|
6
|
+
declare const _default: <TTag extends keyof import("react").JSX.IntrinsicElements = "div">(props: BoxProps<TTag> & RefAttributes<ExtractElementType<import("react").JSX.IntrinsicElements[TTag]>>) => React.ReactNode;
|
|
5
7
|
export default _default;
|
package/components/form.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";require("react/jsx-runtime");require("react");require("./dox.cjs");require("../utils/utils.cjs");require("../theme.cjs");
|
package/components/form.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import Box from '../box';
|
|
2
3
|
type BoxProps = React.ComponentProps<typeof Box<'form'>>;
|
|
3
4
|
type BoxTagProps = Required<BoxProps>['props'];
|
|
@@ -6,5 +7,5 @@ interface Props<T> extends Omit<BoxProps, 'props' | 'tag'> {
|
|
|
6
7
|
props?: FormTagProps;
|
|
7
8
|
onSubmit: (obj: T, e: React.ChangeEvent<HTMLFormElement>) => void;
|
|
8
9
|
}
|
|
9
|
-
export default function Form<T>(props: Props<T>): JSX.Element;
|
|
10
|
+
export default function Form<T>(props: Props<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
package/components/form.mjs
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "./dox.mjs";
|
|
4
|
+
import "../utils/utils.mjs";
|
|
5
5
|
import "../theme.mjs";
|
|
6
|
-
function S(o) {
|
|
7
|
-
const { onSubmit: m, props: n } = o, r = p(null), e = u((t) => {
|
|
8
|
-
t.preventDefault();
|
|
9
|
-
const f = c.getFormEntries(r.current);
|
|
10
|
-
m(f, t);
|
|
11
|
-
}, []), s = { ...n, onSubmit: e, ref: r };
|
|
12
|
-
return /* @__PURE__ */ i(a, { tag: "form", ...o, props: s });
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
S as default
|
|
16
|
-
};
|
package/components/grid.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),s=require("react"),u=require("./dox.cjs");require("../utils/utils.cjs");require("../theme.cjs");function o(r,e){const{inline:i,...n}=r;return t.jsx(u.default,{ref:e,display:i?"inline-grid":"grid",...n})}s.forwardRef(o);
|
package/components/grid.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { RefAttributes } from 'react';
|
|
2
2
|
import Box from '../box';
|
|
3
|
-
type
|
|
4
|
-
|
|
3
|
+
type ExtractElementType<T> = T extends React.DetailedHTMLProps<React.HTMLAttributes<infer E>, infer E> ? E : T extends React.SVGProps<infer E> ? E : never;
|
|
4
|
+
type ExtractElementFromTag<T extends keyof React.JSX.IntrinsicElements> = ExtractElementType<React.JSX.IntrinsicElements[T]>;
|
|
5
|
+
type BoxProps<TTag extends keyof React.JSX.IntrinsicElements = 'div'> = Omit<React.ComponentProps<typeof Box<TTag>>, 'ref'>;
|
|
6
|
+
declare const _default: <TTag extends keyof import("react").JSX.IntrinsicElements = "div">(props: BoxProps<TTag> & RefAttributes<ExtractElementType<import("react").JSX.IntrinsicElements[TTag]>>) => React.ReactNode;
|
|
5
7
|
export default _default;
|
package/components/grid.mjs
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
3
|
import p from "./dox.mjs";
|
|
4
4
|
import "../utils/utils.mjs";
|
|
5
5
|
import "../theme.mjs";
|
|
6
|
-
function
|
|
6
|
+
function f(r, i) {
|
|
7
7
|
const { inline: o, ...t } = r;
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ m(p, { ref: i, display: o ? "inline-grid" : "grid", ...t });
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
c as default
|
|
13
|
-
};
|
|
10
|
+
n(f);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),n=require("react"),u=require("./dox.cjs"),i=require("../utils/utils.cjs");require("../theme.cjs");const s=["name","onInput","onChange","disabled","value","autoFocus","readOnly","required","checked","defaultChecked"];function a(e,t){const o=i.ObjectUtils.buildProps(e,s,{type:"radio"});return r.jsx(u.default,{ref:t,tag:"input",component:"radioButton",...o})}n.forwardRef(a);
|
|
@@ -15,11 +15,8 @@ const d = [
|
|
|
15
15
|
"checked",
|
|
16
16
|
"defaultChecked"
|
|
17
17
|
];
|
|
18
|
-
function
|
|
18
|
+
function p(o, t) {
|
|
19
19
|
const r = i.buildProps(o, d, { type: "radio" });
|
|
20
20
|
return /* @__PURE__ */ e(a, { ref: t, tag: "input", component: "radioButton", ...r });
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
l as default
|
|
25
|
-
};
|
|
22
|
+
n(p);
|
package/components/textarea.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),a=require("react"),o=require("./dox.cjs"),s=require("../utils/utils.cjs");require("../theme.cjs");const u=["name","onInput","onChange","placeholder","disabled","value","defaultValue","rows","cols","autoFocus","maxLength","minLength","readOnly","required"];function c(e,t){const r=s.ObjectUtils.buildProps(e,u);return n.jsx(o.default,{ref:t,tag:"textarea",component:"textarea",...r})}a.forwardRef(c);
|
package/components/textarea.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as a } from "react";
|
|
3
3
|
import n from "./dox.mjs";
|
|
4
|
-
import { O as
|
|
4
|
+
import { O as m } from "../utils/utils.mjs";
|
|
5
5
|
import "../theme.mjs";
|
|
6
|
-
const
|
|
6
|
+
const s = [
|
|
7
7
|
"name",
|
|
8
8
|
"onInput",
|
|
9
9
|
"onChange",
|
|
@@ -19,11 +19,8 @@ const m = [
|
|
|
19
19
|
"readOnly",
|
|
20
20
|
"required"
|
|
21
21
|
];
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */
|
|
22
|
+
function i(o, e) {
|
|
23
|
+
const r = m.buildProps(o, s);
|
|
24
|
+
return /* @__PURE__ */ t(n, { ref: e, tag: "textarea", component: "textarea", ...r });
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
f as default
|
|
29
|
-
};
|
|
26
|
+
a(i);
|
package/components/textbox.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),o=require("react"),u=require("./dox.cjs"),s=require("../utils/utils.cjs");require("../theme.cjs");const a=["name","onInput","onChange","type","placeholder","disabled","defaultValue","autoFocus","readOnly","required","value","pattern"];function i(e,t){const r=s.ObjectUtils.buildProps(e,a);return n.jsx(u.default,{ref:t,tag:"input",component:"textbox",...r})}o.forwardRef(i);
|
package/components/textbox.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as n } from "react";
|
|
3
3
|
import a from "./dox.mjs";
|
|
4
4
|
import { O as p } from "../utils/utils.mjs";
|
|
5
5
|
import "../theme.mjs";
|
|
6
|
-
const
|
|
6
|
+
const i = [
|
|
7
7
|
"name",
|
|
8
8
|
"onInput",
|
|
9
9
|
"onChange",
|
|
@@ -17,11 +17,8 @@ const s = [
|
|
|
17
17
|
"value",
|
|
18
18
|
"pattern"
|
|
19
19
|
];
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */
|
|
20
|
+
function m(o, t) {
|
|
21
|
+
const r = p.buildProps(o, i);
|
|
22
|
+
return /* @__PURE__ */ e(a, { ref: t, tag: "input", component: "textbox", ...r });
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
x as default
|
|
27
|
-
};
|
|
24
|
+
n(m);
|
package/components/tooltip.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";require("react/jsx-runtime");require("react-dom");require("./dox.cjs");require("react");require("../utils/utils.cjs");require("../theme.cjs");
|
package/components/tooltip.d.ts
CHANGED