@cronocode/react-box 1.6.5 → 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.
@@ -1,73 +1,73 @@
1
- import F, { useLayoutEffect as I, useMemo as E, forwardRef as _, useState as D } from "react";
2
- import { I as P, C as M } from "../utils/utils.mjs";
3
- import { useTheme as W } from "../theme.mjs";
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 n(o, d) {
8
- return `${o}${d.replace("/", "-")}`;
7
+ function m(v, d) {
8
+ return `${v}${d.replace("/", "-")}`;
9
9
  }
10
- r.fraction = n;
11
- function v(o) {
12
- return [`${o} path`, `${o} circle`, `${o} rect`, `${o} line`];
10
+ r.fraction = m;
11
+ function n(v) {
12
+ return [`${v} path`, `${v} circle`, `${v} rect`, `${v} line`];
13
13
  }
14
- r.svg = v;
14
+ r.svg = n;
15
15
  })(a.ClassName || (a.ClassName = {})), ((r) => {
16
- function n(u, l) {
17
- return `${l / 4}rem`;
16
+ function m(l, u) {
17
+ return `${u / 4}rem`;
18
18
  }
19
- r.rem = n;
20
- function v(u, l) {
21
- return `${l}px`;
19
+ r.rem = m;
20
+ function n(l, u) {
21
+ return `${u}px`;
22
22
  }
23
- r.px = v;
24
- function o(u, l) {
25
- const [i, c] = l.split("/");
26
- return `${+i / +c * 100}%`;
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 = o;
29
- function d(u, l) {
30
- switch (l) {
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 u.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
34
+ return l.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
35
35
  default:
36
- return l;
36
+ return u;
37
37
  }
38
38
  }
39
39
  r.widthHeight = d;
40
- function g(u) {
41
- return (l, i) => `var(--${u}${i});`;
40
+ function g(l) {
41
+ return (u, i) => `var(--${l}${i});`;
42
42
  }
43
43
  r.variables = g;
44
- function y(u) {
45
- return (l, i) => `var(--${u}${i});`;
44
+ function y(l) {
45
+ return (u, i) => `var(--${l}${i});`;
46
46
  }
47
47
  r.svgVariables = y;
48
- function x(u, l) {
49
- return `repeat(${l},minmax(0,1fr))`;
48
+ function x(l, u) {
49
+ return `repeat(${u},minmax(0,1fr))`;
50
50
  }
51
51
  r.gridColumns = x;
52
- function f(u, l) {
53
- return l === "full-row" ? "1/-1" : `span ${l}/span ${l}`;
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(u, l) {
57
- return `${l}ms`;
56
+ function h(l, u) {
57
+ return `${u}ms`;
58
58
  }
59
59
  r.ms = h;
60
- function V(u, l) {
61
- return `${l}deg`;
60
+ function V(l, u) {
61
+ return `${u}deg`;
62
62
  }
63
63
  r.rotate = V;
64
- function b(u, l) {
65
- return l === "xAxis" ? "-1 1" : "1 -1";
64
+ function N(l, u) {
65
+ return u === "xAxis" ? "-1 1" : "1 -1";
66
66
  }
67
- r.flip = b;
67
+ r.flip = N;
68
68
  })(a.Value || (a.Value = {}));
69
69
  })(e || (e = {}));
70
- const G = ["H", "F", "A"];
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
- }, k = {
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
- }, q = Object.keys(t), U = Object.keys(z);
904
- G.forEach((a) => {
905
- q.forEach((r) => {
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
- }), U.forEach((r) => {
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 w;
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;}}
@@ -917,87 +923,89 @@ 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
925
  .${a.svgClassName}{transition: all var(--svgTransitionTime);}.${a.svgClassName} path,.${a.svgClassName} circle,.${a.svgClassName} rect,.${a.svgClassName} line {transition: all var(--svgTransitionTime);}
920
- `, n = new P(), v = Object.keys(t), o = b();
926
+ `, m = new M(), n = Object.keys(t), v = N();
921
927
  let d = !1;
922
- const g = v.reduce((u, l) => (u[l] = /* @__PURE__ */ new Set(), u), {});
923
- function y(u, l) {
924
- if (u in t)
925
- return f(u, l);
926
- if (u in k)
927
- return k[u].className;
928
- if (u in C)
929
- return f(u, l);
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 u = h([r]);
936
- u = h(u, "H"), u = h(u, "F"), u = h(u, "A"), o.innerHTML = u.join(""), d = !1;
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(u, l) {
941
- var m;
942
- g[u].has(l) || (d = !0, g[u].add(l));
943
- const i = V(u, l), c = ((m = i.formatClassName) == null ? void 0 : m.call(i, u, l)) ?? `${u}${l}`;
944
- return `-${n.getIdentity(c)}`;
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(u, l) {
947
- return Object.entries(g).filter(([c]) => {
948
- var m;
949
- return ((m = t[c]) == null ? void 0 : m.pseudoSuffix) === l;
950
- }).reduce((c, [m, L]) => (L.forEach(($) => {
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(m, $), N = `.${f(m, $)}`;
958
+ const p = V(c, k), w = `.${f(c, k)}`;
953
959
  let S = [];
954
- l ? l === "H" ? S = [
955
- ...i(`${N}:hover`, p),
956
- ...i(`.${k.hover.className}:hover>${N}`, p)
957
- ] : l === "F" ? S = [
958
- ...i(`${N}:focus-within`, p),
959
- ...i(`.${k.focus.className}:focus-within>${N}`, p)
960
- ] : l === "A" && (S = i(`${N}:active`, p)) : S = i(N, p);
961
- const A = ((T = p.formatValue) == null ? void 0 : T.call(p, m, $)) ?? $, B = t[m].cssNames.map((O) => `${O}:${A};`).join("");
962
- c.push(`${S.join(",")}{${B}}`);
963
- }), c), u);
964
- function i(c, m) {
965
- return m.formatSelector ? m.formatSelector(c) : [c];
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(u, l) {
969
- const i = t[u];
970
- return i.isThemeStyle ? i : i.values1.values.includes(l) ? i.values1 : i.values2.values.includes(l) ? i.values2 : i.values3;
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 b() {
973
- const u = "crono-styles";
974
- let l = document.getElementById(u);
975
- return l || (l = document.createElement("style"), l.setAttribute("id", u), l.setAttribute("type", "text/css"), document.head.insertBefore(l, document.head.firstChild)), l;
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
- })(w || (w = {}));
978
- function X(a, r) {
979
- const n = W(a);
980
- return I(w.flush, [a]), E(() => {
981
- const v = [r ? w.svgClassName : w.doxClassName], o = n ? { ...H(n), ...H(a) } : H(a);
982
- return Object.entries(o).forEach(([d, g]) => {
983
- v.push(w.get(d, g));
984
- }), v;
985
- }, [a, n]);
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((v) => {
990
- const o = z[v];
991
- o && (o.key in r || (r[o.key] = r[v]), delete r[v]);
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 Y(a, r) {
995
- const { tag: n = "div", children: v, props: o, className: d, style: g } = a, y = X(a, n === "svg"), x = E(() => M.classNames(d, y).join(" "), [a]), f = { ...o, className: x };
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] = D(!1), b = typeof v == "function";
998
- return b && (f.onMouseEnter = () => V(!0), f.onMouseLeave = () => V(!1)), F.createElement(n, f, b ? v({ isHover: h }) : v);
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 ee = _(Y);
1007
+ const le = D(Z), { flush: ue } = b;
1001
1008
  export {
1002
- ee as default
1009
+ le as default,
1010
+ ue as flushStyles
1003
1011
  };
@@ -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 d=g.forwardRef(a);exports.default=d;
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;
@@ -15,7 +15,7 @@ function n(o, r) {
15
15
  }
16
16
  );
17
17
  }
18
- const h = f(n);
18
+ const l = f(n);
19
19
  export {
20
- h as default
20
+ l as default
21
21
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("react"),u=require("../box.cjs");require("../box.module.css.cjs");require("../utils/utils.cjs");require("../theme.cjs");function l(e,r){const{inline:t}=e;return i.jsx(u.default,{ref:r,display:t?"inline-flex":"flex",...e})}const o=n.forwardRef(l);exports.default=o;
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;
@@ -1,4 +1,5 @@
1
+ import { RefAttributes } from 'react';
1
2
  import Box from '../box';
2
- type BoxProps<TTag extends keyof React.ReactHTML> = Omit<React.ComponentProps<typeof Box<TTag>>, 'ref'>;
3
- declare const _default: <TTag extends keyof import("react").ReactHTML = "div">(props: BoxProps<TTag>) => JSX.Element;
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;
@@ -1,14 +1,13 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as e } from "react";
3
- import f from "../box.mjs";
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 m(o, r) {
8
- const { inline: i } = o;
9
- return /* @__PURE__ */ t(f, { ref: r, display: i ? "inline-flex" : "flex", ...o });
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 = e(m);
10
+ const c = f(l);
12
11
  export {
13
12
  c as default
14
13
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("react"),a=require("../box.cjs"),f=require("../utils/utils.cjs");require("../box.module.css.cjs");require("../theme.cjs");function m(e){const{onSubmit:n,props:u}=e,r=o.useRef(null),s=o.useCallback(t=>{t.preventDefault();const c=f.FormUtils.getFormEntries(r.current);n(c,t)},[]),i={...u,onSubmit:s,ref:r};return l.jsx(a.default,{tag:"form",...e,props:i})}exports.default=m;
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,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 "../box.mjs";
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 d(o) {
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
- d as default
15
+ S as default
17
16
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("react"),u=require("../box.cjs");require("../box.module.css.cjs");require("../utils/utils.cjs");require("../theme.cjs");function o(e,r){const{inline:i}=e;return t.jsx(u.default,{ref:r,display:i?"inline-grid":"grid",...e})}const d=n.forwardRef(o);exports.default=d;
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,4 +1,5 @@
1
+ import { RefAttributes } from 'react';
1
2
  import Box from '../box';
2
- type BoxProps<TTag extends keyof React.ReactHTML> = Omit<React.ComponentProps<typeof Box<TTag>>, 'ref'>;
3
- declare const _default: <TTag extends keyof import("react").ReactHTML = "div">(props: BoxProps<TTag>) => JSX.Element;
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;
@@ -1,12 +1,11 @@
1
- import { jsx as t } from "react/jsx-runtime";
1
+ import { jsx as n } from "react/jsx-runtime";
2
2
  import { forwardRef as m } from "react";
3
- import n from "../box.mjs";
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__ */ t(n, { ref: i, display: o ? "inline-grid" : "grid", ...r });
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("../box.cjs"),i=require("../utils/utils.cjs");require("../box.module.css.cjs");require("../theme.cjs");const a=["name","onInput","onChange","disabled","value","autoFocus","readOnly","required","checked","defaultChecked"];function s(e,t){const o=i.ObjectUtils.buildProps(e,a,{type:"radio"});return r.jsx(u.default,{ref:t,tag:"input",component:"radioButton",...o})}const c=n.forwardRef(s);exports.default=c;
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 "../box.mjs";
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 p(o, t) {
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 B = n(p);
22
+ const l = n(u);
24
23
  export {
25
- B as default
24
+ l as default
26
25
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react"),n=require("../box.cjs"),u=require("../utils/utils.cjs");require("../box.module.css.cjs");require("../theme.cjs");const s=["name","onInput","onChange","placeholder","disabled","value","defaultValue","rows","cols","autoFocus","maxLength","minLength","readOnly","required"];function i(e,t){const r=u.ObjectUtils.buildProps(e,s);return a.jsx(n.default,{ref:t,tag:"textarea",component:"textarea",...r})}const c=o.forwardRef(i);exports.default=c;
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,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 "../box.mjs";
4
- import { O as m } from "../utils/utils.mjs";
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 s = [
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, o) {
24
- const e = m.buildProps(t, s);
25
- return /* @__PURE__ */ r(n, { ref: o, tag: "textarea", component: "textarea", ...e });
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 x = a(p);
26
+ const f = a(p);
28
27
  export {
29
- x as default
28
+ f as default
30
29
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),n=require("react"),u=require("../box.cjs"),a=require("../utils/utils.cjs");require("../box.module.css.cjs");require("../theme.cjs");const s=["name","onInput","onChange","type","placeholder","disabled","defaultValue","autoFocus","readOnly","required","value","pattern"];function i(e,t){const r=a.ObjectUtils.buildProps(e,s);return o.jsx(u.default,{ref:t,tag:"input",component:"textbox",...r})}const c=n.forwardRef(i);exports.default=c;
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,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 "../box.mjs";
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 i = [
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 m(o, t) {
22
- const e = p.buildProps(o, i);
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 c = n(m);
24
+ const x = n(u);
26
25
  export {
27
- c as default
26
+ x as default
28
27
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),v=require("react-dom"),d=require("../box.cjs"),s=require("react"),h=require("../utils/utils.cjs");require("../box.module.css.cjs");require("../theme.cjs");const u=2;function x(f){const{onPositionChange:l}=f,i=s.useRef(null),[e,p]=s.useState(),w=h.usePortalContainer(),b=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]),m=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)*u)/u,o=Math.round((t.left+window.scrollX)*u)/u;((e==null?void 0:e.top)!==r||(e==null?void 0:e.left)!==o)&&(l==null||l({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=b(i.current,a),t=m(i.current,a);return()=>{n(),t()}}},[e]),c.jsxs(c.Fragment,{children:[c.jsx(d.default,{ref:i}),e&&v.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";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,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 "../box.mjs";
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
4
4
  "main": "./box.cjs",
5
5
  "module": "./box.mjs",
6
6
  "types": "./box.d.ts",