@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.
Files changed (43) hide show
  1. package/components/baseSvg.cjs +1 -1
  2. package/components/baseSvg.mjs +1 -4
  3. package/components/button.cjs +1 -1
  4. package/components/button.d.ts +1 -0
  5. package/components/button.mjs +7 -10
  6. package/components/checkbox.cjs +1 -1
  7. package/components/checkbox.mjs +4 -7
  8. package/components/dataGrid/dataGridContract.d.ts +1 -0
  9. package/components/dataGrid.cjs +1 -1
  10. package/components/dataGrid.d.ts +1 -1
  11. package/components/dataGrid.mjs +2 -32
  12. package/components/dox/doxStyles.d.ts +9 -0
  13. package/components/dox.cjs +2 -2
  14. package/components/dox.d.ts +6 -4
  15. package/components/dox.mjs +125 -126
  16. package/components/doxSvg.cjs +1 -1
  17. package/components/doxSvg.d.ts +1 -0
  18. package/components/doxSvg.mjs +4 -7
  19. package/components/flex.d.ts +4 -2
  20. package/components/form.cjs +1 -1
  21. package/components/form.d.ts +2 -1
  22. package/components/form.mjs +4 -15
  23. package/components/grid.cjs +1 -1
  24. package/components/grid.d.ts +4 -2
  25. package/components/grid.mjs +5 -8
  26. package/components/radioButton.cjs +1 -1
  27. package/components/radioButton.mjs +2 -5
  28. package/components/textarea.cjs +1 -1
  29. package/components/textarea.mjs +7 -10
  30. package/components/textbox.cjs +1 -1
  31. package/components/textbox.mjs +6 -9
  32. package/components/tooltip.cjs +1 -1
  33. package/components/tooltip.d.ts +1 -1
  34. package/components/tooltip.mjs +5 -63
  35. package/package.json +14 -14
  36. package/plugins.cjs +1 -209
  37. package/plugins.mjs +0 -219
  38. package/style.css +1 -1
  39. package/theme.cjs +1 -1
  40. package/theme.mjs +23 -25
  41. package/types.d.ts +9 -0
  42. package/utils/utils.cjs +1 -1
  43. package/utils/utils.mjs +53 -63
@@ -1,70 +1,70 @@
1
- import F, { useMemo as E, useLayoutEffect as I, useEffect as _, forwardRef as D, useState as P } from "react";
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(v, d) {
8
- return `${v}${d.replace("/", "-")}`;
7
+ function m(l, d) {
8
+ return `${l}${d.replace("/", "-")}`;
9
9
  }
10
10
  r.fraction = m;
11
- function n(v) {
12
- return [`${v} path`, `${v} circle`, `${v} rect`, `${v} line`];
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(l, u) {
17
- return `${u / 4}rem`;
16
+ function m(u, t) {
17
+ return `${t / 4}rem`;
18
18
  }
19
19
  r.rem = m;
20
- function n(l, u) {
21
- return `${u}px`;
20
+ function n(u, t) {
21
+ return `${t}px`;
22
22
  }
23
23
  r.px = n;
24
- function v(l, u) {
25
- const [i, o] = u.split("/");
26
- return `${+i / +o * 100}%`;
24
+ function l(u, t) {
25
+ const [o, v] = t.split("/");
26
+ return `${+o / +v * 100}%`;
27
27
  }
28
- r.fraction = v;
29
- function d(l, u) {
30
- switch (u) {
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 l.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
34
+ return u.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
35
35
  default:
36
- return u;
36
+ return t;
37
37
  }
38
38
  }
39
39
  r.widthHeight = d;
40
- function g(l) {
41
- return (u, i) => `var(--${l}${i});`;
40
+ function g(u) {
41
+ return (t, o) => `var(--${u}${o});`;
42
42
  }
43
43
  r.variables = g;
44
- function y(l) {
45
- return (u, i) => `var(--${l}${i});`;
44
+ function z(u) {
45
+ return (t, o) => `var(--${u}${o});`;
46
46
  }
47
- r.svgVariables = y;
48
- function x(l, u) {
49
- return `repeat(${u},minmax(0,1fr))`;
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(l, u) {
53
- return u === "full-row" ? "1/-1" : `span ${u}/span ${u}`;
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(l, u) {
57
- return `${u}ms`;
56
+ function h(u, t) {
57
+ return `${t}ms`;
58
58
  }
59
59
  r.ms = h;
60
- function V(l, u) {
61
- return `${u}deg`;
60
+ function V(u, t) {
61
+ return `${t}deg`;
62
62
  }
63
63
  r.rotate = V;
64
- function N(l, u) {
65
- return u === "xAxis" ? "-1 1" : "1 -1";
64
+ function b(u, t) {
65
+ return t === "xAxis" ? "-1 1" : "1 -1";
66
66
  }
67
- r.flip = N;
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
- }, j = {
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
- }, t = {
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
- t[a] = C[a];
873
+ i[a] = C[a];
874
874
  });
875
875
  Object.keys(R).forEach((a) => {
876
- t[a] = R[a], t[a].isThemeStyle = !0;
876
+ i[a] = R[a], i[a].isThemeStyle = !0;
877
877
  });
878
- Object.keys(j).forEach((a) => {
879
- t[a] = j[a], t[a].isThemeStyle = !0;
878
+ Object.keys(A).forEach((a) => {
879
+ i[a] = A[a], i[a].isThemeStyle = !0;
880
880
  });
881
- const z = {
882
- w: { ...t.width, key: "width" },
883
- h: { ...t.height, key: "height" },
884
- m: { ...t.margin, key: "margin" },
885
- mx: { ...t.marginHorizontal, key: "marginHorizontal" },
886
- my: { ...t.marginVertical, key: "marginVertical" },
887
- mt: { ...t.marginTop, key: "marginTop" },
888
- mr: { ...t.marginRight, key: "marginRight" },
889
- mb: { ...t.marginBottom, key: "marginBottom" },
890
- ml: { ...t.marginLeft, key: "marginLeft" },
891
- p: { ...t.padding, key: "padding" },
892
- px: { ...t.paddingHorizontal, key: "paddingHorizontal" },
893
- py: { ...t.paddingVertical, key: "paddingVertical" },
894
- pt: { ...t.paddingTop, key: "paddingTop" },
895
- pr: { ...t.paddingRight, key: "paddingRight" },
896
- pb: { ...t.paddingBottom, key: "paddingBottom" },
897
- pl: { ...t.paddingLeft, key: "paddingLeft" },
898
- b: { ...t.border, key: "border" },
899
- bx: { ...t.borderHorizontal, key: "borderHorizontal" },
900
- by: { ...t.borderVertical, key: "borderVertical" },
901
- bt: { ...t.borderTop, key: "borderTop" },
902
- br: { ...t.borderRight, key: "borderRight" },
903
- bb: { ...t.borderBottom, key: "borderBottom" },
904
- bl: { ...t.borderLeft, key: "borderLeft" },
905
- jc: { ...t.justifyContent, key: "justifyContent" },
906
- ai: { ...t.alignItems, key: "alignItems" },
907
- ac: { ...t.alignContent, key: "alignContent" },
908
- d: { ...t.flexDirection, key: "flexDirection" }
909
- }, U = Object.keys(t), X = Object.keys(z);
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
- t[`${r}${a}`] = { ...t[r] }, t[`${r}${a}`].pseudoSuffix = a;
912
+ i[`${r}${a}`] = { ...i[r] }, i[`${r}${a}`].pseudoSuffix = a;
913
913
  }), X.forEach((r) => {
914
- z[`${r}${a}`] = { ...z[r], key: `${z[r].key}${a}` }, z[`${r}${a}`].pseudoSuffix = a;
914
+ y[`${r}${a}`] = { ...y[r], key: `${y[r].key}${a}` }, y[`${r}${a}`].pseudoSuffix = a;
915
915
  });
916
916
  });
917
- var b;
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(t), v = N();
926
+ `, m = new M(), n = Object.keys(i), l = b();
927
927
  let d = !1;
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);
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 = y;
937
+ a.get = z;
938
938
  function x() {
939
939
  if (d) {
940
940
  console.info("%c💬Flush Dox Styles", "color: #00ffff");
941
- let l = h([r]);
942
- l = h(l, "H"), l = h(l, "F"), l = h(l, "A"), v.innerHTML = l.join(""), d = !1;
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(l, u) {
946
+ function f(u, t) {
947
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)}`;
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(l, u) {
953
- return Object.entries(g).filter(([o]) => {
952
+ function h(u, t) {
953
+ return Object.entries(g).filter(([v]) => {
954
954
  var c;
955
- return ((c = t[o]) == null ? void 0 : c.pseudoSuffix) === u;
956
- }).reduce((o, [c, B]) => (B.forEach((k) => {
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), w = `.${f(c, k)}`;
958
+ const p = V(c, k), N = `.${f(c, k)}`;
959
959
  let S = [];
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];
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(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;
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 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;
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
- })(b || (b = {}));
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(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));
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 H(a) {
994
+ function $(a) {
995
995
  const r = { ...a };
996
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]);
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: v, className: d, style: g } = a, y = Q(a, m === "svg"), x = E(() => W.classNames(d, y).join(" "), [a]), f = { ...v, className: x };
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), N = typeof n == "function";
1005
- return N && (f.onMouseEnter = () => V(!0), f.onMouseLeave = () => V(!1)), F.createElement(m, f, N ? n({ isHover: h }) : n);
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), { flush: ue } = b;
1007
+ const le = D(Z);
1008
1008
  export {
1009
- le as default,
1010
- ue as flushStyles
1009
+ le as default
1011
1010
  };
@@ -1 +1 @@
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;
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);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import Dox from './dox';
2
3
  import ClassNameUtils from '../utils/className/classNameUtils';
3
4
  import { DoxSvgStyles } from './dox/doxStyles';
@@ -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: s, props: i, ...m } = o;
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: { ...i, viewBox: t, width: p, height: s, xmlns: "http://www.w3.org/2000/svg", fill: "none" },
14
- ...m
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
- const l = f(n);
19
- export {
20
- l as default
21
- };
18
+ f(n);
@@ -1,5 +1,7 @@
1
1
  import { RefAttributes } from 'react';
2
2
  import Box from '../box';
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;
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;
@@ -1 +1 @@
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;
1
+ "use strict";require("react/jsx-runtime");require("react");require("./dox.cjs");require("../utils/utils.cjs");require("../theme.cjs");
@@ -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 {};
@@ -1,16 +1,5 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { useRef as p, useCallback as u } from "react";
3
- import a from "./dox.mjs";
4
- import { F as c } from "../utils/utils.mjs";
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
- };
@@ -1 +1 @@
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;
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);
@@ -1,5 +1,7 @@
1
1
  import { RefAttributes } from 'react';
2
2
  import Box from '../box';
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;
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;
@@ -1,13 +1,10 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { forwardRef as m } from "react";
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 d(r, i) {
6
+ function f(r, i) {
7
7
  const { inline: o, ...t } = r;
8
- return /* @__PURE__ */ n(p, { ref: i, display: o ? "inline-grid" : "grid", ...t });
8
+ return /* @__PURE__ */ m(p, { ref: i, display: o ? "inline-grid" : "grid", ...t });
9
9
  }
10
- const c = m(d);
11
- export {
12
- c as default
13
- };
10
+ n(f);
@@ -1 +1 @@
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
+ "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 u(o, t) {
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
- const l = n(u);
23
- export {
24
- l as default
25
- };
22
+ n(p);
@@ -1 +1 @@
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;
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);
@@ -1,9 +1,9 @@
1
- import { jsx as r } from "react/jsx-runtime";
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 s } from "../utils/utils.mjs";
4
+ import { O as m } from "../utils/utils.mjs";
5
5
  import "../theme.mjs";
6
- const m = [
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 p(t, e) {
23
- const o = s.buildProps(t, m);
24
- return /* @__PURE__ */ r(n, { ref: e, tag: "textarea", component: "textarea", ...o });
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
- const f = a(p);
27
- export {
28
- f as default
29
- };
26
+ a(i);
@@ -1 +1 @@
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;
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);
@@ -1,9 +1,9 @@
1
- import { jsx as r } from "react/jsx-runtime";
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 s = [
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 u(o, t) {
21
- const e = p.buildProps(o, s);
22
- return /* @__PURE__ */ r(a, { ref: t, tag: "input", component: "textbox", ...e });
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
- const x = n(u);
25
- export {
26
- x as default
27
- };
24
+ n(m);
@@ -1 +1 @@
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;
1
+ "use strict";require("react/jsx-runtime");require("react-dom");require("./dox.cjs");require("react");require("../utils/utils.cjs");require("../theme.cjs");
@@ -6,5 +6,5 @@ interface Props extends React.ComponentProps<typeof Box> {
6
6
  left: number;
7
7
  }): void;
8
8
  }
9
- export default function Tooltip(props: Props): JSX.Element;
9
+ export default function Tooltip(props: Props): import("react/jsx-runtime").JSX.Element;
10
10
  export {};