@cronocode/react-box 1.6.4 → 1.6.6
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 +2 -18
- package/box.mjs +5 -51
- package/components/baseSvg.cjs +1 -1
- package/components/baseSvg.d.ts +2 -19
- package/components/baseSvg.mjs +7 -20
- package/components/button.cjs +1 -1
- package/components/button.mjs +7 -8
- package/components/checkbox.cjs +1 -1
- package/components/checkbox.mjs +1 -1
- package/components/dataGrid.cjs +1 -1
- package/components/dataGrid.mjs +3 -4
- package/components/dox/doxStyles.d.ts +13 -0
- package/components/dox.cjs +3 -3
- package/components/dox.d.ts +5 -2
- package/components/dox.mjs +113 -105
- package/components/doxSvg.cjs +1 -1
- package/components/doxSvg.d.ts +7 -8
- package/components/doxSvg.mjs +10 -10
- package/components/flex.cjs +1 -1
- package/components/flex.d.ts +3 -2
- package/components/flex.mjs +7 -8
- package/components/form.cjs +1 -1
- package/components/form.mjs +3 -4
- package/components/grid.cjs +1 -1
- package/components/grid.d.ts +3 -2
- package/components/grid.mjs +4 -5
- package/components/radioButton.cjs +1 -1
- package/components/radioButton.mjs +4 -5
- package/components/textarea.cjs +1 -1
- package/components/textarea.mjs +8 -9
- package/components/textbox.cjs +1 -1
- package/components/textbox.mjs +6 -7
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.mjs +1 -2
- package/package.json +1 -1
- package/style.css +1 -1
- package/utils/utils.cjs +1 -1
- package/utils/utils.mjs +74 -121
- package/baseSvg.module.css.cjs +0 -1
- package/baseSvg.module.css.mjs +0 -4
package/components/dox.mjs
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import F, { useLayoutEffect as I,
|
|
2
|
-
import { I as
|
|
3
|
-
import { useTheme as
|
|
1
|
+
import F, { useMemo as E, useLayoutEffect as I, useEffect as _, forwardRef as D, useState as P } from "react";
|
|
2
|
+
import { I as M, C as W } from "../utils/utils.mjs";
|
|
3
|
+
import { useTheme as G } from "../theme.mjs";
|
|
4
4
|
var e;
|
|
5
5
|
((a) => {
|
|
6
6
|
((r) => {
|
|
7
|
-
function
|
|
8
|
-
return `${
|
|
7
|
+
function m(v, d) {
|
|
8
|
+
return `${v}${d.replace("/", "-")}`;
|
|
9
9
|
}
|
|
10
|
-
r.fraction =
|
|
11
|
-
function v
|
|
12
|
-
return [`${
|
|
10
|
+
r.fraction = m;
|
|
11
|
+
function n(v) {
|
|
12
|
+
return [`${v} path`, `${v} circle`, `${v} rect`, `${v} line`];
|
|
13
13
|
}
|
|
14
|
-
r.svg =
|
|
14
|
+
r.svg = n;
|
|
15
15
|
})(a.ClassName || (a.ClassName = {})), ((r) => {
|
|
16
|
-
function
|
|
17
|
-
return `${
|
|
16
|
+
function m(l, u) {
|
|
17
|
+
return `${u / 4}rem`;
|
|
18
18
|
}
|
|
19
|
-
r.rem =
|
|
20
|
-
function
|
|
21
|
-
return `${
|
|
19
|
+
r.rem = m;
|
|
20
|
+
function n(l, u) {
|
|
21
|
+
return `${u}px`;
|
|
22
22
|
}
|
|
23
|
-
r.px =
|
|
24
|
-
function
|
|
25
|
-
const [i,
|
|
26
|
-
return `${+i / +
|
|
23
|
+
r.px = n;
|
|
24
|
+
function v(l, u) {
|
|
25
|
+
const [i, o] = u.split("/");
|
|
26
|
+
return `${+i / +o * 100}%`;
|
|
27
27
|
}
|
|
28
|
-
r.fraction =
|
|
29
|
-
function d(
|
|
30
|
-
switch (
|
|
28
|
+
r.fraction = v;
|
|
29
|
+
function d(l, u) {
|
|
30
|
+
switch (u) {
|
|
31
31
|
case "fit":
|
|
32
32
|
return "100%";
|
|
33
33
|
case "fit-screen":
|
|
34
|
-
return
|
|
34
|
+
return l.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
|
|
35
35
|
default:
|
|
36
|
-
return
|
|
36
|
+
return u;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
r.widthHeight = d;
|
|
40
|
-
function g(
|
|
41
|
-
return (
|
|
40
|
+
function g(l) {
|
|
41
|
+
return (u, i) => `var(--${l}${i});`;
|
|
42
42
|
}
|
|
43
43
|
r.variables = g;
|
|
44
|
-
function y(
|
|
45
|
-
return (
|
|
44
|
+
function y(l) {
|
|
45
|
+
return (u, i) => `var(--${l}${i});`;
|
|
46
46
|
}
|
|
47
47
|
r.svgVariables = y;
|
|
48
|
-
function x(
|
|
49
|
-
return `repeat(${
|
|
48
|
+
function x(l, u) {
|
|
49
|
+
return `repeat(${u},minmax(0,1fr))`;
|
|
50
50
|
}
|
|
51
51
|
r.gridColumns = x;
|
|
52
|
-
function f(
|
|
53
|
-
return
|
|
52
|
+
function f(l, u) {
|
|
53
|
+
return u === "full-row" ? "1/-1" : `span ${u}/span ${u}`;
|
|
54
54
|
}
|
|
55
55
|
r.gridColumn = f;
|
|
56
|
-
function h(
|
|
57
|
-
return `${
|
|
56
|
+
function h(l, u) {
|
|
57
|
+
return `${u}ms`;
|
|
58
58
|
}
|
|
59
59
|
r.ms = h;
|
|
60
|
-
function V(
|
|
61
|
-
return `${
|
|
60
|
+
function V(l, u) {
|
|
61
|
+
return `${u}deg`;
|
|
62
62
|
}
|
|
63
63
|
r.rotate = V;
|
|
64
|
-
function
|
|
65
|
-
return
|
|
64
|
+
function N(l, u) {
|
|
65
|
+
return u === "xAxis" ? "-1 1" : "1 -1";
|
|
66
66
|
}
|
|
67
|
-
r.flip =
|
|
67
|
+
r.flip = N;
|
|
68
68
|
})(a.Value || (a.Value = {}));
|
|
69
69
|
})(e || (e = {}));
|
|
70
|
-
const
|
|
70
|
+
const q = ["H", "F", "A"];
|
|
71
71
|
var s;
|
|
72
72
|
((a) => {
|
|
73
73
|
a.positiveSizes = [
|
|
@@ -226,7 +226,7 @@ const R = {
|
|
|
226
226
|
formatValue: e.Value.svgVariables("color"),
|
|
227
227
|
formatSelector: e.ClassName.svg
|
|
228
228
|
}
|
|
229
|
-
},
|
|
229
|
+
}, $ = {
|
|
230
230
|
hover: { className: "_h" },
|
|
231
231
|
focus: { className: "_f" }
|
|
232
232
|
}, t = {
|
|
@@ -236,6 +236,12 @@ const R = {
|
|
|
236
236
|
values2: { values: [] },
|
|
237
237
|
values3: { values: [] }
|
|
238
238
|
},
|
|
239
|
+
inline: {
|
|
240
|
+
cssNames: ["display"],
|
|
241
|
+
values1: { values: [!0], formatValue: () => "inline-block" },
|
|
242
|
+
values2: { values: [] },
|
|
243
|
+
values3: { values: [] }
|
|
244
|
+
},
|
|
239
245
|
boxSizing: {
|
|
240
246
|
cssNames: ["box-sizing"],
|
|
241
247
|
values1: { values: ["border-box", "content-box"] },
|
|
@@ -900,15 +906,15 @@ const z = {
|
|
|
900
906
|
ai: { ...t.alignItems, key: "alignItems" },
|
|
901
907
|
ac: { ...t.alignContent, key: "alignContent" },
|
|
902
908
|
d: { ...t.flexDirection, key: "flexDirection" }
|
|
903
|
-
},
|
|
904
|
-
|
|
905
|
-
|
|
909
|
+
}, U = Object.keys(t), X = Object.keys(z);
|
|
910
|
+
q.forEach((a) => {
|
|
911
|
+
U.forEach((r) => {
|
|
906
912
|
t[`${r}${a}`] = { ...t[r] }, t[`${r}${a}`].pseudoSuffix = a;
|
|
907
|
-
}),
|
|
913
|
+
}), X.forEach((r) => {
|
|
908
914
|
z[`${r}${a}`] = { ...z[r], key: `${z[r].key}${a}` }, z[`${r}${a}`].pseudoSuffix = a;
|
|
909
915
|
});
|
|
910
916
|
});
|
|
911
|
-
var
|
|
917
|
+
var b;
|
|
912
918
|
((a) => {
|
|
913
919
|
a.doxClassName = "_dox", a.svgClassName = "_svg";
|
|
914
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;}}
|
|
@@ -916,88 +922,90 @@ html{font-size: 16px;font-family: Arial, sans-serif;}
|
|
|
916
922
|
body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
|
|
917
923
|
a,ul{all: unset;}
|
|
918
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;}
|
|
919
|
-
.${a.svgClassName}{
|
|
920
|
-
`,
|
|
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(t), v = N();
|
|
921
927
|
let d = !1;
|
|
922
|
-
const g =
|
|
923
|
-
function y(
|
|
924
|
-
if (
|
|
925
|
-
return f(
|
|
926
|
-
if (
|
|
927
|
-
return
|
|
928
|
-
if (
|
|
929
|
-
return f(
|
|
928
|
+
const g = n.reduce((l, u) => (l[u] = /* @__PURE__ */ new Set(), l), {});
|
|
929
|
+
function y(l, u) {
|
|
930
|
+
if (l in t)
|
|
931
|
+
return f(l, u);
|
|
932
|
+
if (l in $)
|
|
933
|
+
return $[l].className;
|
|
934
|
+
if (l in C)
|
|
935
|
+
return f(l, u);
|
|
930
936
|
}
|
|
931
937
|
a.get = y;
|
|
932
938
|
function x() {
|
|
933
939
|
if (d) {
|
|
934
940
|
console.info("%c💬Flush Dox Styles", "color: #00ffff");
|
|
935
|
-
let
|
|
936
|
-
|
|
941
|
+
let l = h([r]);
|
|
942
|
+
l = h(l, "H"), l = h(l, "F"), l = h(l, "A"), v.innerHTML = l.join(""), d = !1;
|
|
937
943
|
}
|
|
938
944
|
}
|
|
939
945
|
a.flush = x;
|
|
940
|
-
function f(
|
|
941
|
-
var
|
|
942
|
-
g[
|
|
943
|
-
const i = V(
|
|
944
|
-
return `-${
|
|
946
|
+
function f(l, u) {
|
|
947
|
+
var c;
|
|
948
|
+
g[l].has(u) || (d = !0, g[l].add(u));
|
|
949
|
+
const i = V(l, u), o = ((c = i.formatClassName) == null ? void 0 : c.call(i, l, u)) ?? `${l}${u}`;
|
|
950
|
+
return `-${m.getIdentity(o)}`;
|
|
945
951
|
}
|
|
946
|
-
function h(
|
|
947
|
-
return Object.entries(g).filter(([
|
|
948
|
-
var
|
|
949
|
-
return ((
|
|
950
|
-
}).reduce((
|
|
952
|
+
function h(l, u) {
|
|
953
|
+
return Object.entries(g).filter(([o]) => {
|
|
954
|
+
var c;
|
|
955
|
+
return ((c = t[o]) == null ? void 0 : c.pseudoSuffix) === u;
|
|
956
|
+
}).reduce((o, [c, B]) => (B.forEach((k) => {
|
|
951
957
|
var T;
|
|
952
|
-
const p = V(
|
|
958
|
+
const p = V(c, k), w = `.${f(c, k)}`;
|
|
953
959
|
let S = [];
|
|
954
|
-
|
|
955
|
-
...i(`${
|
|
956
|
-
...i(`.${
|
|
957
|
-
] :
|
|
958
|
-
...i(`${
|
|
959
|
-
...i(`.${
|
|
960
|
-
] :
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
}),
|
|
964
|
-
function i(
|
|
965
|
-
return
|
|
960
|
+
u ? u === "H" ? S = [
|
|
961
|
+
...i(`${w}:hover`, p),
|
|
962
|
+
...i(`.${$.hover.className}:hover>${w}`, p)
|
|
963
|
+
] : u === "F" ? S = [
|
|
964
|
+
...i(`${w}:focus-within`, p),
|
|
965
|
+
...i(`.${$.focus.className}:focus-within>${w}`, p)
|
|
966
|
+
] : u === "A" && (S = i(`${w}:active`, p)) : S = i(w, p);
|
|
967
|
+
const L = ((T = p.formatValue) == null ? void 0 : T.call(p, c, k)) ?? k, A = t[c].cssNames.map((O) => `${O}:${L};`).join("");
|
|
968
|
+
o.push(`${S.join(",")}{${A}}`);
|
|
969
|
+
}), o), l);
|
|
970
|
+
function i(o, c) {
|
|
971
|
+
return c.formatSelector ? c.formatSelector(o) : [o];
|
|
966
972
|
}
|
|
967
973
|
}
|
|
968
|
-
function V(
|
|
969
|
-
const i = t[
|
|
970
|
-
return i.isThemeStyle ? i : i.values1.values.includes(
|
|
974
|
+
function V(l, u) {
|
|
975
|
+
const i = t[l];
|
|
976
|
+
return i.isThemeStyle ? i : i.values1.values.includes(u) ? i.values1 : i.values2.values.includes(u) ? i.values2 : i.values3;
|
|
971
977
|
}
|
|
972
|
-
function
|
|
973
|
-
const
|
|
974
|
-
let
|
|
975
|
-
return
|
|
978
|
+
function N() {
|
|
979
|
+
const l = "crono-styles", i = typeof window < "u" && typeof window.document < "u" ? window.document : global.document;
|
|
980
|
+
let o = i.getElementById(l);
|
|
981
|
+
return o || (o = i.createElement("style"), o.setAttribute("id", l), o.setAttribute("type", "text/css"), i.head.insertBefore(o, i.head.firstChild)), o;
|
|
976
982
|
}
|
|
977
|
-
})(
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
983
|
+
})(b || (b = {}));
|
|
984
|
+
const Y = typeof window < "u" && typeof window.document < "u", J = Y ? I : _;
|
|
985
|
+
function Q(a, r) {
|
|
986
|
+
const m = G(a);
|
|
987
|
+
return J(b.flush, [a]), E(() => {
|
|
988
|
+
const n = [r ? b.svgClassName : b.doxClassName], v = m ? { ...H(m), ...H(a) } : H(a);
|
|
989
|
+
return Object.entries(v).forEach(([d, g]) => {
|
|
990
|
+
n.push(b.get(d, g));
|
|
991
|
+
}), n;
|
|
992
|
+
}, [a, m]);
|
|
986
993
|
}
|
|
987
994
|
function H(a) {
|
|
988
995
|
const r = { ...a };
|
|
989
|
-
return Object.keys(r).forEach((
|
|
990
|
-
const
|
|
991
|
-
|
|
996
|
+
return Object.keys(r).forEach((n) => {
|
|
997
|
+
const v = z[n];
|
|
998
|
+
v && (v.key in r || (r[v.key] = r[n]), delete r[n]);
|
|
992
999
|
}), r;
|
|
993
1000
|
}
|
|
994
|
-
function
|
|
995
|
-
const { tag:
|
|
1001
|
+
function Z(a, r) {
|
|
1002
|
+
const { tag: m = "div", children: n, props: v, className: d, style: g } = a, y = Q(a, m === "svg"), x = E(() => W.classNames(d, y).join(" "), [a]), f = { ...v, className: x };
|
|
996
1003
|
g && (f.style = g), r && (f.ref = r);
|
|
997
|
-
const [h, V] =
|
|
998
|
-
return
|
|
1004
|
+
const [h, V] = P(!1), N = typeof n == "function";
|
|
1005
|
+
return N && (f.onMouseEnter = () => V(!0), f.onMouseLeave = () => V(!1)), F.createElement(m, f, N ? n({ isHover: h }) : n);
|
|
999
1006
|
}
|
|
1000
|
-
const
|
|
1007
|
+
const le = D(Z), { flush: ue } = b;
|
|
1001
1008
|
export {
|
|
1002
|
-
|
|
1009
|
+
le as default,
|
|
1010
|
+
ue as flushStyles
|
|
1003
1011
|
};
|
package/components/doxSvg.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),g=require("react"),c=require("./dox.cjs");require("../utils/utils.cjs");require("../theme.cjs");function a(e,r){const{viewBox:t="0 0 24 24",width:o="1.5rem",height:s,props:i,...n}=e;return u.jsx(c.default,{tag:"svg",ref:r,props:{...i,viewBox:t,width:o,height:s,xmlns:"http://www.w3.org/2000/svg",fill:"none"},...n})}const l=g.forwardRef(a);exports.default=l;
|
package/components/doxSvg.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Dox from './dox';
|
|
2
2
|
import ClassNameUtils from '../utils/className/classNameUtils';
|
|
3
3
|
import { DoxSvgStyles } from './dox/doxStyles';
|
|
4
|
-
type
|
|
5
|
-
type
|
|
6
|
-
type SvgStyleType = Omit<React.CSSProperties, 'width' | 'height'>;
|
|
4
|
+
type SvgTagProps = Required<React.ComponentProps<typeof Dox<'svg'>>>['props'];
|
|
5
|
+
type DoxSvgTagProps = Omit<SvgTagProps, 'viewBox' | 'width' | 'height'>;
|
|
7
6
|
interface Props extends DoxSvgStyles {
|
|
8
7
|
children?: React.ReactNode | ((props: {
|
|
9
8
|
isHover: boolean;
|
|
10
9
|
}) => React.ReactNode);
|
|
11
|
-
props?:
|
|
12
|
-
style?:
|
|
10
|
+
props?: DoxSvgTagProps;
|
|
11
|
+
style?: React.ComponentProps<'svg'>['style'];
|
|
13
12
|
className?: ClassNameUtils.ClassNameType;
|
|
14
13
|
viewBox?: string;
|
|
15
14
|
width?: string;
|
|
16
15
|
height?: string;
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
export
|
|
17
|
+
declare const _default: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<SVGSVGElement>>;
|
|
18
|
+
export default _default;
|
package/components/doxSvg.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as f } from "react";
|
|
2
3
|
import g from "./dox.mjs";
|
|
3
|
-
import "react";
|
|
4
4
|
import "../utils/utils.mjs";
|
|
5
5
|
import "../theme.mjs";
|
|
6
|
-
function
|
|
7
|
-
const {
|
|
8
|
-
return /* @__PURE__ */
|
|
6
|
+
function n(o, r) {
|
|
7
|
+
const { viewBox: t = "0 0 24 24", width: p = "1.5rem", height: s, props: i, ...m } = o;
|
|
8
|
+
return /* @__PURE__ */ e(
|
|
9
9
|
g,
|
|
10
10
|
{
|
|
11
11
|
tag: "svg",
|
|
12
|
-
|
|
13
|
-
...t,
|
|
14
|
-
|
|
15
|
-
style: { ...r, width: s, height: i }
|
|
12
|
+
ref: r,
|
|
13
|
+
props: { ...i, viewBox: t, width: p, height: s, xmlns: "http://www.w3.org/2000/svg", fill: "none" },
|
|
14
|
+
...m
|
|
16
15
|
}
|
|
17
16
|
);
|
|
18
17
|
}
|
|
18
|
+
const l = f(n);
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
l as default
|
|
21
21
|
};
|
package/components/flex.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("react"),u=require("./dox.cjs");require("../utils/utils.cjs");require("../theme.cjs");function l(e,r){const{inline:t,...i}=e;return n.jsx(u.default,{ref:r,display:t?"inline-flex":"flex",...i})}const s=o.forwardRef(l);exports.default=s;
|
package/components/flex.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { RefAttributes } from 'react';
|
|
1
2
|
import Box from '../box';
|
|
2
|
-
type BoxProps<TTag extends keyof
|
|
3
|
-
declare const _default: <TTag extends keyof
|
|
3
|
+
type BoxProps<TTag extends keyof JSX.IntrinsicElements = 'div'> = Omit<React.ComponentProps<typeof Box<TTag>>, 'ref'>;
|
|
4
|
+
declare const _default: <TTag extends keyof JSX.IntrinsicElements = "div">(props: BoxProps<TTag> & RefAttributes<ExtractElementType<JSX.IntrinsicElements[TTag]>>) => JSX.Element;
|
|
4
5
|
export default _default;
|
package/components/flex.mjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import "../box.module.css.mjs";
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as f } from "react";
|
|
3
|
+
import n from "./dox.mjs";
|
|
5
4
|
import "../utils/utils.mjs";
|
|
6
5
|
import "../theme.mjs";
|
|
7
|
-
function
|
|
8
|
-
const { inline:
|
|
9
|
-
return /* @__PURE__ */
|
|
6
|
+
function l(o, r) {
|
|
7
|
+
const { inline: t, ...e } = o;
|
|
8
|
+
return /* @__PURE__ */ i(n, { ref: r, display: t ? "inline-flex" : "flex", ...e });
|
|
10
9
|
}
|
|
11
|
-
const c =
|
|
10
|
+
const c = f(l);
|
|
12
11
|
export {
|
|
13
12
|
c as default
|
|
14
13
|
};
|
package/components/form.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("react"),a=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("react"),a=require("./dox.cjs"),f=require("../utils/utils.cjs");require("../theme.cjs");function m(e){const{onSubmit:n,props:u}=e,t=o.useRef(null),s=o.useCallback(r=>{r.preventDefault();const c=f.FormUtils.getFormEntries(t.current);n(c,r)},[]),i={...u,onSubmit:s,ref:t};return l.jsx(a.default,{tag:"form",...e,props:i})}exports.default=m;
|
package/components/form.mjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as p, useCallback as u } from "react";
|
|
3
|
-
import a from "
|
|
3
|
+
import a from "./dox.mjs";
|
|
4
4
|
import { F as c } from "../utils/utils.mjs";
|
|
5
|
-
import "../box.module.css.mjs";
|
|
6
5
|
import "../theme.mjs";
|
|
7
|
-
function
|
|
6
|
+
function S(o) {
|
|
8
7
|
const { onSubmit: m, props: n } = o, r = p(null), e = u((t) => {
|
|
9
8
|
t.preventDefault();
|
|
10
9
|
const f = c.getFormEntries(r.current);
|
|
@@ -13,5 +12,5 @@ function d(o) {
|
|
|
13
12
|
return /* @__PURE__ */ i(a, { tag: "form", ...o, props: s });
|
|
14
13
|
}
|
|
15
14
|
export {
|
|
16
|
-
|
|
15
|
+
S as default
|
|
17
16
|
};
|
package/components/grid.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("react"),u=require("./dox.cjs");require("../utils/utils.cjs");require("../theme.cjs");function s(e,r){const{inline:i,...t}=e;return n.jsx(u.default,{ref:r,display:i?"inline-grid":"grid",...t})}const d=o.forwardRef(s);exports.default=d;
|
package/components/grid.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { RefAttributes } from 'react';
|
|
1
2
|
import Box from '../box';
|
|
2
|
-
type BoxProps<TTag extends keyof
|
|
3
|
-
declare const _default: <TTag extends keyof
|
|
3
|
+
type BoxProps<TTag extends keyof JSX.IntrinsicElements = 'div'> = Omit<React.ComponentProps<typeof Box<TTag>>, 'ref'>;
|
|
4
|
+
declare const _default: <TTag extends keyof JSX.IntrinsicElements = "div">(props: BoxProps<TTag> & RefAttributes<ExtractElementType<JSX.IntrinsicElements[TTag]>>) => JSX.Element;
|
|
4
5
|
export default _default;
|
package/components/grid.mjs
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as m } from "react";
|
|
3
|
-
import
|
|
4
|
-
import "../box.module.css.mjs";
|
|
3
|
+
import p from "./dox.mjs";
|
|
5
4
|
import "../utils/utils.mjs";
|
|
6
5
|
import "../theme.mjs";
|
|
7
6
|
function d(r, i) {
|
|
8
|
-
const { inline: o } = r;
|
|
9
|
-
return /* @__PURE__ */
|
|
7
|
+
const { inline: o, ...t } = r;
|
|
8
|
+
return /* @__PURE__ */ n(p, { ref: i, display: o ? "inline-grid" : "grid", ...t });
|
|
10
9
|
}
|
|
11
10
|
const c = m(d);
|
|
12
11
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),u=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),u=require("./dox.cjs"),i=require("../utils/utils.cjs");require("../theme.cjs");const a=["name","onInput","onChange","disabled","value","autoFocus","readOnly","required","checked","defaultChecked"];function d(e,t){const o=i.ObjectUtils.buildProps(e,a,{type:"radio"});return r.jsx(u.default,{ref:t,tag:"input",component:"radioButton",...o})}const s=n.forwardRef(d);exports.default=s;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as n } from "react";
|
|
3
|
-
import a from "
|
|
3
|
+
import a from "./dox.mjs";
|
|
4
4
|
import { O as i } from "../utils/utils.mjs";
|
|
5
|
-
import "../box.module.css.mjs";
|
|
6
5
|
import "../theme.mjs";
|
|
7
6
|
const d = [
|
|
8
7
|
"name",
|
|
@@ -16,11 +15,11 @@ const d = [
|
|
|
16
15
|
"checked",
|
|
17
16
|
"defaultChecked"
|
|
18
17
|
];
|
|
19
|
-
function
|
|
18
|
+
function u(o, t) {
|
|
20
19
|
const r = i.buildProps(o, d, { type: "radio" });
|
|
21
20
|
return /* @__PURE__ */ e(a, { ref: t, tag: "input", component: "radioButton", ...r });
|
|
22
21
|
}
|
|
23
|
-
const
|
|
22
|
+
const l = n(u);
|
|
24
23
|
export {
|
|
25
|
-
|
|
24
|
+
l as default
|
|
26
25
|
};
|
package/components/textarea.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react"),n=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react"),n=require("./dox.cjs"),u=require("../utils/utils.cjs");require("../theme.cjs");const s=["name","onInput","onChange","placeholder","disabled","value","defaultValue","rows","cols","autoFocus","maxLength","minLength","readOnly","required"];function c(e,t){const r=u.ObjectUtils.buildProps(e,s);return a.jsx(n.default,{ref:t,tag:"textarea",component:"textarea",...r})}const i=o.forwardRef(c);exports.default=i;
|
package/components/textarea.mjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as a } from "react";
|
|
3
|
-
import n from "
|
|
4
|
-
import { O as
|
|
5
|
-
import "../box.module.css.mjs";
|
|
3
|
+
import n from "./dox.mjs";
|
|
4
|
+
import { O as s } from "../utils/utils.mjs";
|
|
6
5
|
import "../theme.mjs";
|
|
7
|
-
const
|
|
6
|
+
const m = [
|
|
8
7
|
"name",
|
|
9
8
|
"onInput",
|
|
10
9
|
"onChange",
|
|
@@ -20,11 +19,11 @@ const s = [
|
|
|
20
19
|
"readOnly",
|
|
21
20
|
"required"
|
|
22
21
|
];
|
|
23
|
-
function p(t,
|
|
24
|
-
const
|
|
25
|
-
return /* @__PURE__ */ r(n, { ref:
|
|
22
|
+
function p(t, e) {
|
|
23
|
+
const o = s.buildProps(t, m);
|
|
24
|
+
return /* @__PURE__ */ r(n, { ref: e, tag: "textarea", component: "textarea", ...o });
|
|
26
25
|
}
|
|
27
|
-
const
|
|
26
|
+
const f = a(p);
|
|
28
27
|
export {
|
|
29
|
-
|
|
28
|
+
f as default
|
|
30
29
|
};
|
package/components/textbox.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),u=require("./dox.cjs"),a=require("../utils/utils.cjs");require("../theme.cjs");const s=["name","onInput","onChange","type","placeholder","disabled","defaultValue","autoFocus","readOnly","required","value","pattern"];function i(e,t){const o=a.ObjectUtils.buildProps(e,s);return r.jsx(u.default,{ref:t,tag:"input",component:"textbox",...o})}const c=n.forwardRef(i);exports.default=c;
|
package/components/textbox.mjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as n } from "react";
|
|
3
|
-
import a from "
|
|
3
|
+
import a from "./dox.mjs";
|
|
4
4
|
import { O as p } from "../utils/utils.mjs";
|
|
5
|
-
import "../box.module.css.mjs";
|
|
6
5
|
import "../theme.mjs";
|
|
7
|
-
const
|
|
6
|
+
const s = [
|
|
8
7
|
"name",
|
|
9
8
|
"onInput",
|
|
10
9
|
"onChange",
|
|
@@ -18,11 +17,11 @@ const i = [
|
|
|
18
17
|
"value",
|
|
19
18
|
"pattern"
|
|
20
19
|
];
|
|
21
|
-
function
|
|
22
|
-
const e = p.buildProps(o,
|
|
20
|
+
function u(o, t) {
|
|
21
|
+
const e = p.buildProps(o, s);
|
|
23
22
|
return /* @__PURE__ */ r(a, { ref: t, tag: "input", component: "textbox", ...e });
|
|
24
23
|
}
|
|
25
|
-
const
|
|
24
|
+
const x = n(u);
|
|
26
25
|
export {
|
|
27
|
-
|
|
26
|
+
x as default
|
|
28
27
|
};
|
package/components/tooltip.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),b=require("react-dom"),d=require("./dox.cjs"),s=require("react"),h=require("../utils/utils.cjs");require("../theme.cjs");const l=2;function x(f){const{onPositionChange:u}=f,i=s.useRef(null),[e,p]=s.useState(),w=h.usePortalContainer(),m=s.useCallback((n,t)=>{const r=o=>{o.target.contains(n)&&t(n)};return document.addEventListener("scroll",r,{capture:!0}),()=>{document.removeEventListener("scroll",r,{capture:!0})}},[e]),v=s.useCallback((n,t)=>{const r=o=>{t(n)};return window.addEventListener("resize",r,{capture:!0}),()=>{window.removeEventListener("resize",r,{capture:!0})}},[e]),a=s.useCallback(n=>{const t=n.getBoundingClientRect(),r=Math.round((t.top+window.scrollY)*l)/l,o=Math.round((t.left+window.scrollX)*l)/l;((e==null?void 0:e.top)!==r||(e==null?void 0:e.left)!==o)&&(u==null||u({top:r,left:o}),p({top:r,left:o,width:t.width>0?t.width:void 0}))},[e]);return s.useLayoutEffect(()=>{if(i.current){a(i.current);const n=m(i.current,a),t=v(i.current,a);return()=>{n(),t()}}},[e]),c.jsxs(c.Fragment,{children:[c.jsx(d.default,{ref:i}),e&&b.createPortal(c.jsx(d.default,{position:"absolute",top:0,left:0,transition:"none",style:{transform:`translate(${e.left}px,${e.top}px)`,width:e.width},children:c.jsx(d.default,{position:"absolute",width:"fit",...f})}),w)]})}exports.default=x;
|
package/components/tooltip.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
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 u from "
|
|
3
|
+
import u from "./dox.mjs";
|
|
4
4
|
import { useRef as E, useState as L, useCallback as d, useLayoutEffect as g } from "react";
|
|
5
5
|
import { u as z } from "../utils/utils.mjs";
|
|
6
|
-
import "../box.module.css.mjs";
|
|
7
6
|
import "../theme.mjs";
|
|
8
7
|
const i = 2;
|
|
9
8
|
function M(f) {
|