@cronocode/react-box 3.0.19 → 3.0.20

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/core.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import we, { useMemo as ee, useLayoutEffect as ce, useEffect as de, useState as fe, useContext as xe, useRef as Fe } from "react";
2
- import { jsx as p, jsxs as Ne } from "react/jsx-runtime";
3
- import Ce from "./box.mjs";
1
+ import xe, { useMemo as te, useLayoutEffect as de, useEffect as fe, useState as me, useContext as Fe, useRef as Ne } from "react";
2
+ import { jsx as p, jsxs as Ce } from "react/jsx-runtime";
3
+ import Ve from "./box.mjs";
4
4
  import R from "./components/baseSvg.mjs";
5
- function me(...e) {
6
- return e.reduce((t, r) => r ? typeof r == "string" ? (t.push(r), t) : Array.isArray(r) ? (t.push(...me(...r)), t) : (Object.entries(r).forEach(([o, i]) => {
5
+ function ve(...e) {
6
+ return e.reduce((t, r) => r ? typeof r == "string" ? (t.push(r), t) : Array.isArray(r) ? (t.push(...ve(...r)), t) : (Object.entries(r).forEach(([o, i]) => {
7
7
  i && t.push(o);
8
8
  }), t) : t, []);
9
9
  }
@@ -56,18 +56,18 @@ var a;
56
56
  return `repeat(${c},minmax(0,1fr))`;
57
57
  }
58
58
  t.gridColumns = f;
59
- function g(v, c) {
59
+ function b(v, c) {
60
60
  return c === "full-row" ? "1/-1" : `span ${c}/span ${c}`;
61
61
  }
62
- t.gridColumn = g;
62
+ t.gridColumn = b;
63
63
  function s(v, c) {
64
64
  return `${c}ms`;
65
65
  }
66
66
  t.ms = s;
67
- function b(v, c) {
67
+ function g(v, c) {
68
68
  return `${c}deg`;
69
69
  }
70
- t.rotate = b;
70
+ t.rotate = g;
71
71
  function h(v, c) {
72
72
  return c === "xAxis" ? "-1 1" : "1 -1";
73
73
  }
@@ -676,6 +676,12 @@ const y = K, S = {
676
676
  values: ["stretch", "flex-start", "flex-end", "center", "baseline", "start", "end", "self-start", "self-end"]
677
677
  }
678
678
  ],
679
+ placeContent: [
680
+ {
681
+ styleName: "place-content",
682
+ values: ["start", "end", "flex-start", "flex-end", "center", "space-between", "space-around", "space-evenly", "stretch"]
683
+ }
684
+ ],
679
685
  /** The CSS align-content property sets the distribution of space between and around content items along a flexbox's cross axis, or a grid or block-level element's block axis. */
680
686
  alignContent: [
681
687
  {
@@ -1460,7 +1466,7 @@ const y = K, S = {
1460
1466
  styleName: "transform"
1461
1467
  }
1462
1468
  ]
1463
- }, ve = {
1469
+ }, ye = {
1464
1470
  hover: ":hover",
1465
1471
  focus: ":focus-within",
1466
1472
  hasFocus: ":has(:focus)",
@@ -1479,20 +1485,20 @@ const y = K, S = {
1479
1485
  required: ":required",
1480
1486
  disabled: "[disabled]",
1481
1487
  selected: '[aria-selected="true"]'
1482
- }, Ve = {
1488
+ }, ze = {
1483
1489
  theme: ""
1484
- }, te = { ...ve, ...M, ...Ve }, ye = Object.entries(te).reduce(
1490
+ }, re = { ...ye, ...M, ...ze }, ge = Object.entries(re).reduce(
1485
1491
  (e, [t], r) => (e[t] = Math.pow(2, r), e),
1486
1492
  {}
1487
- ), G = Object.entries(te).reduce(
1493
+ ), G = Object.entries(re).reduce(
1488
1494
  (e, [t]) => {
1489
- const r = ye[t];
1495
+ const r = ge[t];
1490
1496
  return Object.entries(e).forEach(([o, i]) => {
1491
1497
  e[+o + r] = [...i, t];
1492
1498
  }), e;
1493
1499
  },
1494
1500
  { 0: [] }
1495
- ), se = {
1501
+ ), ie = {
1496
1502
  hoverGroup: "hover",
1497
1503
  focusGroup: "focus",
1498
1504
  activeGroup: "active",
@@ -1513,12 +1519,12 @@ const y = K, S = {
1513
1519
  var q;
1514
1520
  ((e) => {
1515
1521
  function t(n, u, l) {
1516
- const f = { ...n }, g = f.props || {};
1522
+ const f = { ...n }, b = f.props || {};
1517
1523
  return u.forEach((s) => {
1518
- s in f && (g[s] = f[s], delete f[s]);
1519
- }), l && Object.entries(l).forEach(([s, b]) => {
1520
- g[s] = b;
1521
- }), f.props = g, f;
1524
+ s in f && (b[s] = f[s], delete f[s]);
1525
+ }), l && Object.entries(l).forEach(([s, g]) => {
1526
+ b[s] = g;
1527
+ }), f.props = b, f;
1522
1528
  }
1523
1529
  e.buildProps = t;
1524
1530
  function r(n) {
@@ -1527,8 +1533,8 @@ var q;
1527
1533
  e.isObject = r;
1528
1534
  function o(...n) {
1529
1535
  return n.reduce((u, l) => (Object.keys(l ?? {}).forEach((f) => {
1530
- const g = u[f], s = l[f];
1531
- r(s) && "clean" in s && s.clean ? u[f] = s : f in M && typeof s == "boolean" || (f in M && Array.isArray(s) ? u[f] = o(g, s[1] ?? {}) : Array.isArray(g) && Array.isArray(s) ? u[f] = g.concat(...s) : r(g) && r(s) ? u[f] = o(g, s) : u[f] = s);
1536
+ const b = u[f], s = l[f];
1537
+ r(s) && "clean" in s && s.clean ? u[f] = s : f in M && typeof s == "boolean" || (f in M && Array.isArray(s) ? u[f] = o(b, s[1] ?? {}) : Array.isArray(b) && Array.isArray(s) ? u[f] = b.concat(...s) : r(b) && r(s) ? u[f] = o(b, s) : u[f] = s);
1532
1538
  }), u), {});
1533
1539
  }
1534
1540
  e.mergeDeep = o;
@@ -1538,7 +1544,7 @@ var q;
1538
1544
  e.isKeyOf = i;
1539
1545
  })(q || (q = {}));
1540
1546
  const C = q;
1541
- class ze {
1547
+ class $e {
1542
1548
  constructor() {
1543
1549
  this._index = 0, this._cache = {};
1544
1550
  }
@@ -1546,17 +1552,17 @@ class ze {
1546
1552
  return this._cache[t] || (this._cache[t] = this.getByIndex(this._index++)), this._cache[t];
1547
1553
  }
1548
1554
  getByIndex(t) {
1549
- const { first: r, next: o } = $e, i = t - r.length;
1555
+ const { first: r, next: o } = Ae, i = t - r.length;
1550
1556
  if (i < 0)
1551
1557
  return r[t];
1552
1558
  const n = Math.floor(i / o.length), u = i - n * o.length;
1553
1559
  return this.getByIndex(n) + o[u];
1554
1560
  }
1555
1561
  }
1556
- const $e = {
1562
+ const Ae = {
1557
1563
  first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
1558
1564
  next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
1559
- }, ie = {
1565
+ }, ne = {
1560
1566
  h1: {
1561
1567
  styles: { fontSize: 14 * 2.5 }
1562
1568
  },
@@ -1978,62 +1984,62 @@ var X;
1978
1984
  S[u] = f ? [...l, ...f] : l;
1979
1985
  }), { extendedProps: i, extendedPropTypes: n };
1980
1986
  }
1981
- e.extend = t, e.componentsStyles = ie;
1987
+ e.extend = t, e.componentsStyles = ne;
1982
1988
  function r(o) {
1983
- return e.componentsStyles = C.mergeDeep(ie, o), o;
1989
+ return e.componentsStyles = C.mergeDeep(ne, o), o;
1984
1990
  }
1985
1991
  e.components = r;
1986
1992
  })(X || (X = {}));
1987
- const Ae = X;
1988
- function Se(e) {
1993
+ const Se = X;
1994
+ function Ee(e) {
1989
1995
  const { clean: t, component: r, variant: o } = e;
1990
- return ee(() => {
1996
+ return te(() => {
1991
1997
  if (t) return;
1992
1998
  const i = r == null ? void 0 : r.split(".");
1993
1999
  if (!i) return;
1994
- const n = i.reduce((f, g, s) => {
1995
- var b;
1996
- return s === 0 ? Ae.componentsStyles[g] : (b = f == null ? void 0 : f.children) == null ? void 0 : b[g];
2000
+ const n = i.reduce((f, b, s) => {
2001
+ var g;
2002
+ return s === 0 ? Se.componentsStyles[b] : (g = f == null ? void 0 : f.children) == null ? void 0 : g[b];
1997
2003
  }, void 0);
1998
2004
  if (!n) return;
1999
2005
  if (!o) return n.styles;
2000
- const u = me(o);
2006
+ const u = ve(o);
2001
2007
  if (u.length === 0) return n.styles;
2002
2008
  const l = C.mergeDeep(...u.map((f) => {
2003
- var g;
2004
- return (g = n.variants) == null ? void 0 : g[f];
2009
+ var b;
2010
+ return (b = n.variants) == null ? void 0 : b[f];
2005
2011
  }));
2006
2012
  return C.mergeDeep(n.styles, l);
2007
2013
  }, [t, r, o]);
2008
2014
  }
2009
- const Ee = new ze(), Oe = typeof window < "u" && typeof window.document < "u";
2010
- var ue;
2011
- const be = typeof process == "object" && ((ue = process.env) == null ? void 0 : ue.NODE_ENV) === "test", je = Oe && !be ? ce : de, ge = "_b", O = "_s";
2012
- function _e(e, t) {
2013
- je(j.flush, [e]);
2014
- const r = Se(e);
2015
- return ee(() => {
2016
- const o = [t ? O : ge], i = r ? C.mergeDeep(r, e) : e;
2015
+ const Oe = new $e(), je = typeof window < "u" && typeof window.document < "u";
2016
+ var ce;
2017
+ const be = typeof process == "object" && ((ce = process.env) == null ? void 0 : ce.NODE_ENV) === "test", Re = je && !be ? de : fe, he = "_b", O = "_s";
2018
+ function ke(e, t) {
2019
+ Re(j.flush, [e]);
2020
+ const r = Ee(e);
2021
+ return te(() => {
2022
+ const o = [t ? O : he], i = r ? C.mergeDeep(r, e) : e;
2017
2023
  return j.addClassNames(i, o, []), o;
2018
2024
  }, [e, t, r]);
2019
2025
  }
2020
2026
  var j;
2021
2027
  ((e) => {
2022
2028
  let t = !0, r = {};
2023
- function o(s, b, h, v, c) {
2029
+ function o(s, g, h, v, c) {
2024
2030
  Object.entries(s).forEach(([d, m]) => {
2025
2031
  if (C.isKeyOf(d, S))
2026
- u(d, m, b, h, v, c);
2027
- else if (C.isKeyOf(d, ve))
2028
- o(m, b, [...h, d], v, c);
2032
+ u(d, m, g, h, v, c);
2033
+ else if (C.isKeyOf(d, ye))
2034
+ o(m, g, [...h, d], v, c);
2029
2035
  else if (C.isKeyOf(d, M)) {
2030
2036
  if (Array.isArray(m)) {
2031
2037
  const [F, N] = m;
2032
- o(N, b, [...h, d], v, c);
2038
+ o(N, g, [...h, d], v, c);
2033
2039
  }
2034
- C.isObject(m) && o(m, b, [...h, d], v, c);
2035
- } else C.isKeyOf(d, H) ? o(m, b, h, d, c) : C.isKeyOf(d, se) && Object.entries(m).forEach(([F, N]) => {
2036
- o(N, b, [...h, se[d]], v, F);
2040
+ C.isObject(m) && o(m, g, [...h, d], v, c);
2041
+ } else C.isKeyOf(d, H) ? o(m, g, h, d, c) : C.isKeyOf(d, ie) && Object.entries(m).forEach(([F, N]) => {
2042
+ o(N, g, [...h, ie[d]], v, F);
2037
2043
  });
2038
2044
  });
2039
2045
  }
@@ -2041,44 +2047,44 @@ var j;
2041
2047
  function i() {
2042
2048
  if (!t) return;
2043
2049
  console.debug("\x1B[36m%s\x1B[0m", "[react-box]: flush");
2044
- const s = Object.entries(S).reduce((d, [m], F) => (d[m] = F, d), {}), b = `: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;z-index:99999;}
2050
+ const s = Object.entries(S).reduce((d, [m], F) => (d[m] = F, d), {}), g = `: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;z-index:99999;}
2045
2051
  html{font-size: 16px;font-family: Arial, sans-serif;}
2046
2052
  body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
2047
2053
  a,ul{all: unset;}
2048
- .${ge}{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;}
2054
+ .${he}{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;}
2049
2055
  .${O}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;transition: all var(--svgTransitionTime);}.${O} path,.${O} circle,.${O} rect,.${O} line {transition: all var(--svgTransitionTime);}
2050
2056
  `, h = Object.entries(r);
2051
2057
  h.sort(
2052
2058
  ([d], [m]) => (H[d] ?? 0) - (H[m] ?? 0)
2053
2059
  );
2054
2060
  const v = h.reduce(
2055
- (d, [m, F]) => (m !== "normal" && d.push(`@media(min-width: ${H[m]}px){`), Object.entries(F).forEach(([N, D]) => {
2056
- const { __parents: re, ...he } = D, ae = Object.entries(he);
2057
- ae.sort(([V], [B]) => s[V] - s[B]), ae.forEach(([V, B]) => {
2061
+ (d, [m, F]) => (m !== "normal" && d.push(`@media(min-width: ${H[m]}px){`), Object.entries(F).forEach(([N, U]) => {
2062
+ const { __parents: ae, ...pe } = U, oe = Object.entries(pe);
2063
+ oe.sort(([V], [B]) => s[V] - s[B]), oe.forEach(([V, B]) => {
2058
2064
  B.forEach(($) => {
2059
2065
  var T, k;
2060
2066
  const w = S[V].find((z) => Array.isArray(z.values) ? z.values.includes($) : typeof $ == typeof z.values);
2061
2067
  if (!w) return;
2062
- const A = l(V, $, +N, m), U = G[+N].map((z) => te[z]).join(""), x = ((T = w.selector) == null ? void 0 : T.call(w, `.${A}`, U)) ?? `.${A}${U}`, L = Array.isArray(w.styleName) ? w.styleName : [w.styleName ?? V], _ = ((k = w.valueFormat) == null ? void 0 : k.call(w, $, y.getVariableValue)) ?? $;
2068
+ const A = l(V, $, +N, m), D = G[+N].map((z) => re[z]).join(""), x = ((T = w.selector) == null ? void 0 : T.call(w, `.${A}`, D)) ?? `.${A}${D}`, L = Array.isArray(w.styleName) ? w.styleName : [w.styleName ?? V], _ = ((k = w.valueFormat) == null ? void 0 : k.call(w, $, y.getVariableValue)) ?? $;
2063
2069
  d.push(`${x}{${L.map((z) => `${z}:${_}`).join(";")}}`);
2064
2070
  });
2065
- }), re && Object.entries(re).forEach(([V, B]) => {
2071
+ }), ae && Object.entries(ae).forEach(([V, B]) => {
2066
2072
  const $ = Object.entries(B);
2067
2073
  $.sort(([E], [w]) => s[E] - s[w]), $.forEach(([E, w]) => {
2068
2074
  w.forEach((A) => {
2069
- var oe, le;
2075
+ var le, se;
2070
2076
  const x = S[E].find((I) => Array.isArray(I.values) ? I.values.includes(A) : typeof A == typeof I.values);
2071
2077
  if (!x) return;
2072
- const L = l(E, A, +N, m, V), [_] = G[+N], T = _ === "theme" ? `.${V} .${L}` : `.${V}:${_} .${L}`, k = ((oe = x.selector) == null ? void 0 : oe.call(x, T, "")) ?? T, z = Array.isArray(x.styleName) ? x.styleName : [x.styleName ?? E], pe = ((le = x.valueFormat) == null ? void 0 : le.call(x, A, y.getVariableValue)) ?? A;
2073
- d.push(`${k}{${z.map((I) => `${I}:${pe}`).join(";")}}`);
2078
+ const L = l(E, A, +N, m, V), [_] = G[+N], T = _ === "theme" ? `.${V} .${L}` : `.${V}:${_} .${L}`, k = ((le = x.selector) == null ? void 0 : le.call(x, T, "")) ?? T, z = Array.isArray(x.styleName) ? x.styleName : [x.styleName ?? E], we = ((se = x.valueFormat) == null ? void 0 : se.call(x, A, y.getVariableValue)) ?? A;
2079
+ d.push(`${k}{${z.map((I) => `${I}:${we}`).join(";")}}`);
2074
2080
  });
2075
2081
  });
2076
2082
  });
2077
2083
  }), m !== "normal" && d.push("}"), d),
2078
- [b]
2084
+ [g]
2079
2085
  );
2080
2086
  v.unshift(`:root{${y.generateVariables()}}`);
2081
- const c = g();
2087
+ const c = b();
2082
2088
  c.innerHTML = v.join(""), t = !1;
2083
2089
  }
2084
2090
  e.flush = i;
@@ -2086,57 +2092,57 @@ a,ul{all: unset;}
2086
2092
  r = {};
2087
2093
  }
2088
2094
  e.clear = n;
2089
- function u(s, b, h, v, c = "normal", d) {
2090
- if (b == null) return;
2091
- const m = v.reduce((N, D) => N + ye[D], 0);
2092
- r[c] ? r[c][m] ? r[c][m][s] || (r[c][m][s] = /* @__PURE__ */ new Set()) : r[c][m] = { [s]: /* @__PURE__ */ new Set() } : r[c] = { [m]: { [s]: /* @__PURE__ */ new Set() } }, d ? (r[c][m].__parents ? r[c][m].__parents[d] ? r[c][m].__parents[d][s] || (r[c][m].__parents[d][s] = /* @__PURE__ */ new Set()) : r[c][m].__parents[d] = { [s]: /* @__PURE__ */ new Set() } : r[c][m].__parents = { [d]: { [s]: /* @__PURE__ */ new Set() } }, r[c][m].__parents[d][s].has(b) || (r[c][m].__parents[d][s].add(b), t = !0)) : r[c][m][s].has(b) || (r[c][m][s].add(b), t = !0);
2093
- const F = l(s, b, m, c, d);
2095
+ function u(s, g, h, v, c = "normal", d) {
2096
+ if (g == null) return;
2097
+ const m = v.reduce((N, U) => N + ge[U], 0);
2098
+ r[c] ? r[c][m] ? r[c][m][s] || (r[c][m][s] = /* @__PURE__ */ new Set()) : r[c][m] = { [s]: /* @__PURE__ */ new Set() } : r[c] = { [m]: { [s]: /* @__PURE__ */ new Set() } }, d ? (r[c][m].__parents ? r[c][m].__parents[d] ? r[c][m].__parents[d][s] || (r[c][m].__parents[d][s] = /* @__PURE__ */ new Set()) : r[c][m].__parents[d] = { [s]: /* @__PURE__ */ new Set() } : r[c][m].__parents = { [d]: { [s]: /* @__PURE__ */ new Set() } }, r[c][m].__parents[d][s].has(g) || (r[c][m].__parents[d][s].add(g), t = !0)) : r[c][m][s].has(g) || (r[c][m][s].add(g), t = !0);
2099
+ const F = l(s, g, m, c, d);
2094
2100
  h.push(F);
2095
2101
  }
2096
- function l(s, b, h, v, c) {
2097
- const d = G[h], m = `${v === "normal" ? "" : `${v}-`}${d.map((F) => `${F}-`).join("")}${c ? `${c}-` : ""}${s}-${b}`;
2098
- return be ? m : Ee.getIdentity(m);
2102
+ function l(s, g, h, v, c) {
2103
+ const d = G[h], m = `${v === "normal" ? "" : `${v}-`}${d.map((F) => `${F}-`).join("")}${c ? `${c}-` : ""}${s}-${g}`;
2104
+ return be ? m : Oe.getIdentity(m);
2099
2105
  }
2100
2106
  const f = "crono-styles";
2101
- function g() {
2107
+ function b() {
2102
2108
  let s = document.getElementById(f);
2103
2109
  return s || (s = document.createElement("style"), s.setAttribute("id", f), s.setAttribute("type", "text/css"), document.head.insertBefore(s, document.head.firstChild)), s;
2104
2110
  }
2105
2111
  })(j || (j = {}));
2106
- var ne;
2112
+ var ue;
2107
2113
  ((e) => {
2108
2114
  e.flush = j.flush, e.clear = j.clear;
2109
- })(ne || (ne = {}));
2110
- const Y = we.createContext({ theme: "", setTheme: () => {
2115
+ })(ue || (ue = {}));
2116
+ const Y = xe.createContext({ theme: "", setTheme: () => {
2111
2117
  } });
2112
2118
  function Z(e) {
2113
- const { children: t, theme: r, use: o = "local" } = e, [i, n] = fe(r);
2114
- return ce(() => {
2119
+ const { children: t, theme: r, use: o = "local" } = e, [i, n] = me(r);
2120
+ return de(() => {
2115
2121
  if (o === "local") return;
2116
2122
  const u = document.documentElement;
2117
2123
  return u.classList.add(i), () => {
2118
2124
  u.classList.remove(i);
2119
2125
  };
2120
- }, [i]), o === "local" ? /* @__PURE__ */ p(Y.Provider, { value: { theme: i, setTheme: n }, children: /* @__PURE__ */ p(Ce, { className: i, children: t }) }) : /* @__PURE__ */ p(Y.Provider, { value: { theme: i, setTheme: n }, children: t });
2126
+ }, [i]), o === "local" ? /* @__PURE__ */ p(Y.Provider, { value: { theme: i, setTheme: n }, children: /* @__PURE__ */ p(Ve, { className: i, children: t }) }) : /* @__PURE__ */ p(Y.Provider, { value: { theme: i, setTheme: n }, children: t });
2121
2127
  }
2122
2128
  ((e) => {
2123
2129
  function t() {
2124
- const { theme: r, setTheme: o } = xe(Y);
2130
+ const { theme: r, setTheme: o } = Fe(Y);
2125
2131
  return [r, o];
2126
2132
  }
2127
2133
  e.useTheme = t;
2128
2134
  })(Z || (Z = {}));
2129
- const ke = Z, Re = {
2135
+ const He = Z, Be = {
2130
2136
  selected: "aria-selected"
2131
2137
  };
2132
2138
  var P;
2133
2139
  ((e) => {
2134
2140
  function t(r, o, i) {
2135
- r !== void 0 && r != null && (i[Re[o] ?? o] = Array.isArray(r) ? r[0] : r);
2141
+ r !== void 0 && r != null && (i[Be[o] ?? o] = Array.isArray(r) ? r[0] : r);
2136
2142
  }
2137
2143
  e.assignBooleanProp = t;
2138
2144
  })(P || (P = {}));
2139
- const He = P;
2145
+ const Me = P;
2140
2146
  Array.prototype.removeBy || (Array.prototype.removeBy = function(e) {
2141
2147
  return this.filter((t) => !e(t));
2142
2148
  });
@@ -2183,7 +2189,30 @@ Array.prototype.groupBy || (Array.prototype.groupBy = function(e, t = !1) {
2183
2189
  }, /* @__PURE__ */ new Map());
2184
2190
  return Array.from(r, ([o, i]) => ({ key: o, values: i }));
2185
2191
  });
2186
- function Me(e) {
2192
+ function Ue(e) {
2193
+ const { node: t = null, event: r = "click", hideOnScroll: o = !1, hideOnResize: i = !1, hideOnEscape: n = !0 } = e ?? {}, [u, l] = me(!1), f = Ne(null);
2194
+ return fe(() => {
2195
+ function b(c) {
2196
+ const d = t ?? f.current;
2197
+ (d == null ? void 0 : d.contains(c.target)) === !1 && l(!1);
2198
+ }
2199
+ function s() {
2200
+ l(!1);
2201
+ }
2202
+ function g(c) {
2203
+ const d = t ?? f.current;
2204
+ (d == null ? void 0 : d.contains(c.target)) === !1 && l(!1);
2205
+ }
2206
+ function h(c) {
2207
+ c.key === "Escape" && l(!1);
2208
+ }
2209
+ const v = new AbortController();
2210
+ return u && (window.addEventListener(r, b, v), n && window.addEventListener("keydown", h, v), i && window.addEventListener("resize", s, v), o && window.addEventListener("scroll", g, { signal: v.signal, capture: !0 })), () => {
2211
+ v.abort();
2212
+ };
2213
+ }, [t, u]), [u, l, f];
2214
+ }
2215
+ function De(e) {
2187
2216
  let t;
2188
2217
  return Object.defineProperty({
2189
2218
  clear() {
@@ -2209,34 +2238,11 @@ var J;
2209
2238
  }
2210
2239
  e.throttle = t;
2211
2240
  })(J || (J = {}));
2212
- const De = J;
2213
- function Ue(e) {
2214
- const { node: t = null, event: r = "click", hideOnScroll: o = !1, hideOnResize: i = !1, hideOnEscape: n = !0 } = e ?? {}, [u, l] = fe(!1), f = Fe(null);
2215
- return de(() => {
2216
- function g(c) {
2217
- const d = t ?? f.current;
2218
- (d == null ? void 0 : d.contains(c.target)) === !1 && l(!1);
2219
- }
2220
- function s() {
2221
- l(!1);
2222
- }
2223
- function b(c) {
2224
- const d = t ?? f.current;
2225
- (d == null ? void 0 : d.contains(c.target)) === !1 && l(!1);
2226
- }
2227
- function h(c) {
2228
- c.key === "Escape" && l(!1);
2229
- }
2230
- const v = new AbortController();
2231
- return u && (window.addEventListener(r, g, v), n && window.addEventListener("keydown", h, v), i && window.addEventListener("resize", s, v), o && window.addEventListener("scroll", b, { signal: v.signal, capture: !0 })), () => {
2232
- v.abort();
2233
- };
2234
- }, [t, u]), [u, l, f];
2235
- }
2236
- function Ge(e) {
2241
+ const Ge = J;
2242
+ function We(e) {
2237
2243
  return /* @__PURE__ */ p(R, { ...e, children: /* @__PURE__ */ p("path", { d: "M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z" }) });
2238
2244
  }
2239
- function We(e) {
2245
+ function Ke(e) {
2240
2246
  return /* @__PURE__ */ p(R, { viewBox: "0 0 16 16", width: "18", ...e, children: /* @__PURE__ */ p(
2241
2247
  "path",
2242
2248
  {
@@ -2245,8 +2251,8 @@ function We(e) {
2245
2251
  }
2246
2252
  ) });
2247
2253
  }
2248
- function Ke(e) {
2249
- return /* @__PURE__ */ Ne(R, { viewBox: "0 0 490.6 490.6", ...e, children: [
2254
+ function qe(e) {
2255
+ return /* @__PURE__ */ Ce(R, { viewBox: "0 0 490.6 490.6", ...e, children: [
2250
2256
  /* @__PURE__ */ p("path", { d: "M151.549 145.274c0 23.39 9.145 50.385 24.462 72.214 17.389 24.78 39.376 38.427 61.911 38.427 22.534 0 44.521-13.647 61.91-38.428 15.317-21.828 24.462-48.824 24.462-72.213 0-47.626-38.746-86.372-86.372-86.372s-86.373 38.746-86.373 86.372zm86.373-71.372c39.354 0 71.372 32.018 71.372 71.372 0 20.118-8.33 44.487-21.74 63.598-14.29 20.364-32.38 32.043-49.632 32.043-17.252 0-35.342-11.679-49.632-32.043-13.41-19.11-21.741-43.479-21.741-63.598 0-39.355 32.018-71.372 71.373-71.372z" }),
2251
2257
  /* @__PURE__ */ p("path", { d: "M302.372 239.167a7.502 7.502 0 0 0-8.52 1.461c-16.775 16.728-36.117 25.569-55.935 25.569-19.821 0-39.158-8.841-55.923-25.567a7.5 7.5 0 0 0-8.521-1.463c-25.254 12.022-46.628 30.829-61.811 54.388-15.596 24.2-23.84 52.277-23.84 81.195v.121c0 2.116.894 4.134 2.461 5.556 40.492 36.722 92.922 56.945 147.633 56.945s107.141-20.224 147.632-56.945a7.499 7.499 0 0 0 2.462-5.556v-.121c0-28.918-8.242-56.995-23.834-81.194-15.179-23.561-36.551-42.368-61.804-54.389zm-64.454 183.205c-49.861 0-97.685-18.023-135.057-50.827.583-24.896 7.956-48.986 21.411-69.865 12.741-19.77 30.322-35.823 51.058-46.676 18.746 17.157 40.285 26.193 62.588 26.193 22.3 0 43.842-9.035 62.598-26.193 20.734 10.853 38.313 26.906 51.053 46.676 13.452 20.877 20.823 44.968 21.406 69.865-37.373 32.804-85.197 50.827-135.057 50.827z" }),
2252
2258
  /* @__PURE__ */ p("path", { d: "M455.077 243.89c-13.23-20.532-31.856-36.923-53.864-47.399a7.501 7.501 0 0 0-8.52 1.461c-14.312 14.271-30.79 21.815-47.654 21.815-9.142 0-18.184-2.205-26.873-6.553a7.5 7.5 0 0 0-6.712 13.414c10.793 5.401 22.093 8.139 33.586 8.139 19.335 0 38.004-7.737 54.288-22.437a116.088 116.088 0 0 1 43.141 39.685c11.445 17.763 17.756 38.243 18.338 59.416-18.524 16.158-40.553 28.449-63.91 35.634a7.5 7.5 0 0 0 4.41 14.338c26.509-8.154 51.435-22.362 72.082-41.088a7.499 7.499 0 0 0 2.462-5.556v-.105c-.001-25.204-7.185-49.674-20.774-70.764zM130.493 210.473c7.93 0 15.841-1.934 23.516-5.748a7.5 7.5 0 0 0-6.675-13.433c-5.582 2.774-11.248 4.18-16.841 4.18-14.541 0-29.836-9.914-41.964-27.2-11.449-16.318-18.562-37.112-18.562-54.266 0-33.375 27.152-60.527 60.526-60.527 15.752 0 30.67 6.022 42.006 16.958a7.499 7.499 0 0 0 10.604-.19 7.499 7.499 0 0 0-.19-10.604c-14.146-13.647-32.763-21.163-52.42-21.163-41.646 0-75.526 33.881-75.526 75.527 0 20.38 7.957 43.887 21.283 62.881 15.195 21.657 34.459 33.585 54.243 33.585z" }),
@@ -2254,20 +2260,20 @@ function Ke(e) {
2254
2260
  /* @__PURE__ */ p("path", { d: "M83.698 351.005c.19.45-.18-.46 0 0zM303.345 70.438c11.336-10.936 26.254-16.958 42.006-16.958 33.374 0 60.526 27.152 60.526 60.527 0 17.154-7.112 37.947-18.563 54.266-12.128 17.286-27.424 27.2-41.964 27.2-5.593 0-11.259-1.406-16.841-4.18a7.5 7.5 0 0 0-6.676 13.433c7.675 3.814 15.587 5.748 23.517 5.748 19.783 0 39.048-11.927 54.243-33.585 13.327-18.994 21.283-42.501 21.283-62.881 0-41.646-33.881-75.527-75.526-75.527-19.657 0-38.273 7.516-52.42 21.163a7.5 7.5 0 0 0 10.415 10.794z" })
2255
2261
  ] });
2256
2262
  }
2257
- function qe(e) {
2263
+ function Xe(e) {
2258
2264
  return /* @__PURE__ */ p(R, { viewBox: "0 0 1024 1024", ...e, children: /* @__PURE__ */ p("path", { d: "M31.997 1023.957a31.699 31.699 0 0 1-22.611-9.386C3.328 1008.556 0 1000.493 0 991.96s3.328-16.596 9.386-22.611L328.25 650.484l-152.52-152.52a95.907 95.907 0 0 1-25.087-92.152 95.31 95.31 0 0 1 44.327-58.62l.896-.512a353.464 353.464 0 0 1 176.156-47.398c20.137 0 40.36 1.749 60.283 5.205L597.71 44.54A95.224 95.224 0 0 1 678.685.085c25.64 0 49.745 9.983 67.877 28.073l249.195 249.195a95.224 95.224 0 0 1 25.897 88.74 95.139 95.139 0 0 1-42.152 60.154L719.513 591.695a352.227 352.227 0 0 1-42.663 237.292A95.395 95.395 0 0 1 594 876.514a95.523 95.523 0 0 1-67.963-28.2L373.43 695.706 54.61 1014.614a31.912 31.912 0 0 1-22.612 9.343zm340.025-660.68c-50.64 0-100.685 13.566-144.798 39.207a31.57 31.57 0 0 0-14.676 19.497 31.699 31.699 0 0 0 8.362 30.675L571.344 803.09c6.059 6.059 14.122 9.386 22.697 9.386a31.699 31.699 0 0 0 27.56-15.785 287.421 287.421 0 0 0 31.06-212.676 31.997 31.997 0 0 1 13.907-34.471l278.59-177.266a31.57 31.57 0 0 0 14.037-20.051 31.699 31.699 0 0 0-8.618-29.566l-249.28-249.28a31.912 31.912 0 0 0-49.618 5.418l-177.308 278.59a31.827 31.827 0 0 1-34.472 13.908 293.778 293.778 0 0 0-67.877-8.02z" }) });
2259
2265
  }
2260
- function Xe() {
2261
- return ee(() => {
2266
+ function Ye() {
2267
+ return te(() => {
2262
2268
  const e = "crono-box";
2263
2269
  let t = document.getElementById(e);
2264
2270
  return t || (t = document.createElement("div"), t.id = e, document.body.appendChild(t)), t;
2265
2271
  }, []);
2266
2272
  }
2267
- function Ye(e) {
2273
+ function Ze(e) {
2268
2274
  return /* @__PURE__ */ p(R, { viewBox: "0 0 24 24", ...e, children: /* @__PURE__ */ p("path", { d: "M4.238 2.988a1.25 1.25 0 0 0-.87 2.147L10.231 12l-6.87 6.87a1.251 1.251 0 1 0 1.769 1.769L12 13.768l6.865 6.865a1.25 1.25 0 1 0 1.768-1.768L13.768 12l6.857-6.857a1.25 1.25 0 1 0-1.768-1.768L12 10.232 5.135 3.367a1.25 1.25 0 0 0-.897-.379z" }) });
2269
2275
  }
2270
- function Ze(e) {
2276
+ function Pe(e) {
2271
2277
  return /* @__PURE__ */ p(R, { viewBox: "0 0 488.4 488.4", ...e, children: /* @__PURE__ */ p("path", { d: "M0 203.25c0 112.1 91.2 203.2 203.2 203.2 51.6 0 98.8-19.4 134.7-51.2l129.5 129.5c2.4 2.4 5.5 3.6 8.7 3.6s6.3-1.2 8.7-3.6c4.8-4.8 4.8-12.5 0-17.3l-129.6-129.5c31.8-35.9 51.2-83 51.2-134.7C406.4 91.15 315.2.05 203.2.05S0 91.15 0 203.25zm381.9 0c0 98.5-80.2 178.7-178.7 178.7s-178.7-80.2-178.7-178.7 80.2-178.7 178.7-178.7 178.7 80.1 178.7 178.7z" }) });
2272
2278
  }
2273
2279
  var Q;
@@ -2285,7 +2291,7 @@ var Q;
2285
2291
  const f = l[0];
2286
2292
  r(n, u, f.type === "checkbox" || f.type === "radio" ? f.checked : f.value);
2287
2293
  } else {
2288
- const f = l.reduce((g, s) => (s.type === "checkbox" || s.type === "radio" ? s.checked && g.push(s.value) : g.push(s.value), g), []);
2294
+ const f = l.reduce((b, s) => (s.type === "checkbox" || s.type === "radio" ? s.checked && b.push(s.value) : b.push(s.value), b), []);
2289
2295
  r(n, u, f);
2290
2296
  }
2291
2297
  return n;
@@ -2296,12 +2302,12 @@ var Q;
2296
2302
  if (i.includes(".")) {
2297
2303
  const u = i.split(".");
2298
2304
  let l = o;
2299
- u.forEach((f, g) => {
2300
- if (u.length > g + 1) {
2305
+ u.forEach((f, b) => {
2306
+ if (u.length > b + 1) {
2301
2307
  const s = f.match(/^(.+)\[(\d)\]$/);
2302
2308
  if (s) {
2303
- const [, b, h] = s;
2304
- l[b] = l[b] || [], l[b][h] = l[b][h] || {}, l = l[b][h];
2309
+ const [, g, h] = s;
2310
+ l[g] = l[g] || [], l[g][h] = l[g][h] || {}, l = l[g][h];
2305
2311
  } else
2306
2312
  l[f] = l[f] || {}, l = l[f];
2307
2313
  } else
@@ -2311,26 +2317,35 @@ var Q;
2311
2317
  o[i] = n;
2312
2318
  }
2313
2319
  })(Q || (Q = {}));
2314
- const Pe = Q;
2320
+ const Je = Q;
2321
+ var ee;
2322
+ ((e) => {
2323
+ function t(r) {
2324
+ return r.charAt(0).toUpperCase() + r.slice(1);
2325
+ }
2326
+ e.capitalize = t;
2327
+ })(ee || (ee = {}));
2328
+ const Qe = ee;
2315
2329
  export {
2316
- Ge as A,
2317
- Ae as B,
2318
- Ye as C,
2319
- We as D,
2320
- De as F,
2321
- Ke as G,
2330
+ We as A,
2331
+ Se as B,
2332
+ Ze as C,
2333
+ Ke as D,
2334
+ Ge as F,
2335
+ qe as G,
2322
2336
  C as O,
2323
- qe as P,
2324
- Ze as S,
2325
- ke as T,
2337
+ Xe as P,
2338
+ Pe as S,
2339
+ He as T,
2326
2340
  y as V,
2327
- He as a,
2341
+ Me as a,
2328
2342
  Ue as b,
2329
- me as c,
2343
+ ve as c,
2330
2344
  W as d,
2331
- Pe as e,
2332
- Xe as f,
2333
- ne as g,
2334
- Me as m,
2335
- _e as u
2345
+ Je as e,
2346
+ Qe as f,
2347
+ Ye as g,
2348
+ ue as h,
2349
+ De as m,
2350
+ ke as u
2336
2351
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "3.0.19",
3
+ "version": "3.0.20",
4
4
  "type": "module",
5
5
  "main": "./box.cjs",
6
6
  "module": "./box.mjs",
@@ -57,6 +57,7 @@
57
57
  "devDependencies": {
58
58
  "@rollup/pluginutils": "^5.1.0",
59
59
  "@testing-library/dom": "^10.4.0",
60
+ "@testing-library/jest-dom": "^6.6.3",
60
61
  "@testing-library/react": "^16.0.1",
61
62
  "@types/node": "^22.5.5",
62
63
  "@types/postcss-mixins": "^9.0.5",
package/ssg.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { g as o } from "./core.mjs";
1
+ import { h as o } from "./core.mjs";
2
2
  import a from "react-dom/server";
3
3
  const t = {
4
4
  innerHTML: ""
@@ -0,0 +1,4 @@
1
+ declare namespace StringUtils {
2
+ function capitalize(str: string): string;
3
+ }
4
+ export default StringUtils;