@cronocode/react-box 3.1.1 → 3.1.3

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,13 +1,13 @@
1
- import { jsx as h, jsxs as pe } from "react/jsx-runtime";
2
- import he, { useContext as we, useState as se, useLayoutEffect as ie, useMemo as J, useEffect as ne, useRef as xe } from "react";
3
- import Fe from "./box.mjs";
4
- import O from "./components/baseSvg.mjs";
5
- function ue(...e) {
6
- return e.reduce((t, r) => r ? typeof r == "string" ? (t.push(r), t) : Array.isArray(r) ? (t.push(...ue(...r)), t) : (Object.entries(r).forEach(([o, i]) => {
1
+ import { jsx as h, jsxs as he } from "react/jsx-runtime";
2
+ import we, { useContext as xe, useState as ie, useLayoutEffect as ne, useMemo as Q, useEffect as ue, useRef as Fe } from "react";
3
+ import Ne from "./box.mjs";
4
+ import B from "./components/baseSvg.mjs";
5
+ function ce(...e) {
6
+ return e.reduce((t, r) => r ? typeof r == "string" ? (t.push(r), t) : Array.isArray(r) ? (t.push(...ce(...r)), t) : (Object.entries(r).forEach(([o, i]) => {
7
7
  i && t.push(o);
8
8
  }), t) : t, []);
9
9
  }
10
- const U = 4;
10
+ const G = 4;
11
11
  var a;
12
12
  ((e) => {
13
13
  ((t) => {
@@ -20,7 +20,7 @@ var a;
20
20
  }
21
21
  t.svg = o;
22
22
  })(e.ClassName || (e.ClassName = {})), ((t) => {
23
- function r(v, c, f = U) {
23
+ function r(v, c, f = G) {
24
24
  return `${v / f}rem`;
25
25
  }
26
26
  t.rem = r;
@@ -74,7 +74,7 @@ var a;
74
74
  t.flip = p;
75
75
  })(e.Value || (e.Value = {}));
76
76
  })(a || (a = {}));
77
- var G;
77
+ var W;
78
78
  ((e) => {
79
79
  e.colors = {
80
80
  currentColor: "currentColor",
@@ -379,8 +379,8 @@ var G;
379
379
  o = s;
380
380
  }
381
381
  e.setUserVariables = u;
382
- })(G || (G = {}));
383
- const y = G, S = {
382
+ })(W || (W = {}));
383
+ const y = W, R = {
384
384
  /** The appearance CSS property is used to display UI elements with platform-specific styling, based on the operating system's theme. */
385
385
  appearance: [
386
386
  {
@@ -1471,7 +1471,7 @@ const y = G, S = {
1471
1471
  translateX: [
1472
1472
  {
1473
1473
  values: 0,
1474
- valueFormat: (e) => `translateX(${e / U}rem)`,
1474
+ valueFormat: (e) => `translateX(${e / G}rem)`,
1475
1475
  styleName: "transform"
1476
1476
  }
1477
1477
  ],
@@ -1479,7 +1479,7 @@ const y = G, S = {
1479
1479
  translateY: [
1480
1480
  {
1481
1481
  values: 0,
1482
- valueFormat: (e) => `translateY(${e / U}rem)`,
1482
+ valueFormat: (e) => `translateY(${e / G}rem)`,
1483
1483
  styleName: "transform"
1484
1484
  }
1485
1485
  ],
@@ -1490,7 +1490,7 @@ const y = G, S = {
1490
1490
  valueFormat: () => "''"
1491
1491
  }
1492
1492
  ]
1493
- }, ce = {
1493
+ }, de = {
1494
1494
  hover: ":hover",
1495
1495
  focus: ":focus-within",
1496
1496
  hasFocus: ":has(:focus)",
@@ -1511,24 +1511,25 @@ const y = G, S = {
1511
1511
  required: ":required",
1512
1512
  disabled: "[disabled]",
1513
1513
  selected: '[aria-selected="true"]'
1514
- }, Ne = {
1514
+ }, Ce = {
1515
1515
  theme: ""
1516
- }, Q = { ...ce, ...k, ...Ne }, de = Object.entries(Q).reduce(
1516
+ }, M = { ...de, ...k, ...Ce }, fe = Object.entries(M).reduce(
1517
1517
  (e, [t], r) => (e[t] = Math.pow(2, r), e),
1518
1518
  {}
1519
- ), D = Object.entries(Q).reduce(
1519
+ ), I = Object.entries(M).reduce(
1520
1520
  (e, [t]) => {
1521
- const r = de[t];
1521
+ const r = fe[t];
1522
1522
  return Object.entries(e).forEach(([o, i]) => {
1523
1523
  e[+o + r] = [...i, t];
1524
1524
  }), e;
1525
1525
  },
1526
1526
  { 0: [] }
1527
- ), re = {
1527
+ ), ae = {
1528
1528
  hoverGroup: "hover",
1529
1529
  focusGroup: "focus",
1530
1530
  activeGroup: "active",
1531
1531
  disabledGroup: "disabled",
1532
+ selectedGroup: "selected",
1532
1533
  theme: "theme"
1533
1534
  }, _ = {
1534
1535
  /** Styles applied for small screens and larger. >= 640 */
@@ -1542,7 +1543,7 @@ const y = G, S = {
1542
1543
  /** Styles applied for 2x extra-large screens and larger. >= 1536 */
1543
1544
  xxl: 1536
1544
1545
  };
1545
- var W;
1546
+ var K;
1546
1547
  ((e) => {
1547
1548
  function t(n, u, s) {
1548
1549
  const d = { ...n }, b = d.props || {};
@@ -1568,8 +1569,8 @@ var W;
1568
1569
  return n in u;
1569
1570
  }
1570
1571
  e.isKeyOf = i;
1571
- })(W || (W = {}));
1572
- const C = W, ae = {
1572
+ })(K || (K = {}));
1573
+ const N = K, oe = {
1573
1574
  h1: {
1574
1575
  styles: { fontSize: 14 * 2.5 }
1575
1576
  },
@@ -1901,6 +1902,7 @@ const C = W, ae = {
1901
1902
  datagrid: {
1902
1903
  styles: {
1903
1904
  b: 1,
1905
+ bgColor: "white",
1904
1906
  borderColor: "gray-400",
1905
1907
  overflow: "hidden",
1906
1908
  borderRadius: 1
@@ -2019,14 +2021,15 @@ const C = W, ae = {
2019
2021
  transition: "none"
2020
2022
  },
2021
2023
  variants: {
2022
- isRowNumber: {},
2023
- isRowSelection: {},
2024
2024
  isPinned: { position: "sticky", zIndex: 2, bgColor: "gray-200" },
2025
2025
  isFirstLeftPinned: {},
2026
2026
  isLastLeftPinned: { br: 1 },
2027
2027
  isFirstRightPinned: { bl: 1 },
2028
2028
  isLastRightPinned: {},
2029
- isSortable: { cursor: "pointer" }
2029
+ isSortable: { cursor: "pointer" },
2030
+ isRowSelected: {},
2031
+ isRowSelection: {},
2032
+ isRowNumber: { jc: "center" }
2030
2033
  },
2031
2034
  children: {
2032
2035
  contextMenu: {
@@ -2042,7 +2045,6 @@ const C = W, ae = {
2042
2045
  jc: "center",
2043
2046
  ai: "center",
2044
2047
  transition: "none",
2045
- bgColor: "gray-200",
2046
2048
  hover: { bgColor: "gray-300" }
2047
2049
  },
2048
2050
  children: {
@@ -2102,23 +2104,28 @@ const C = W, ae = {
2102
2104
  }
2103
2105
  }
2104
2106
  },
2105
- cell: {
2106
- styles: {
2107
- bb: 1,
2108
- borderColor: "gray-400",
2109
- transition: "none",
2110
- ai: "center",
2111
- overflow: "hidden",
2112
- hoverGroup: { "grid-row": { bgColor: "gray-200" } }
2113
- },
2114
- variants: {
2115
- isRowNumber: { bgColor: "gray-200" },
2116
- isRowSelection: {},
2117
- isPinned: { position: "sticky", bgColor: "gray-100", zIndex: 1 },
2118
- isFirstLeftPinned: {},
2119
- isLastLeftPinned: { br: 1 },
2120
- isFirstRightPinned: { bl: 1 },
2121
- isLastRightPinned: {}
2107
+ body: {
2108
+ styles: {},
2109
+ children: {
2110
+ cell: {
2111
+ styles: {
2112
+ bb: 1,
2113
+ borderColor: "gray-400",
2114
+ transition: "none",
2115
+ ai: "center",
2116
+ hoverGroup: { "grid-row": { bgColor: "gray-200" } }
2117
+ },
2118
+ variants: {
2119
+ isPinned: { position: "sticky", bgColor: "gray-100", zIndex: 1 },
2120
+ isFirstLeftPinned: {},
2121
+ isLastLeftPinned: { br: 1 },
2122
+ isFirstRightPinned: { bl: 1 },
2123
+ isLastRightPinned: {},
2124
+ isRowNumber: { bgColor: "gray-200", jc: "right" },
2125
+ isRowSelection: {},
2126
+ isRowSelected: {}
2127
+ }
2128
+ }
2122
2129
  }
2123
2130
  },
2124
2131
  bottomBar: {
@@ -2133,43 +2140,43 @@ const C = W, ae = {
2133
2140
  }
2134
2141
  }
2135
2142
  };
2136
- var K;
2143
+ var q;
2137
2144
  ((e) => {
2138
2145
  function t(o, i, n) {
2139
2146
  return y.setUserVariables(o), Object.entries(i).forEach(([u, s]) => {
2140
- S[u] = s;
2147
+ R[u] = s;
2141
2148
  }), Object.entries(n).forEach(([u, s]) => {
2142
- const d = S[u];
2143
- S[u] = d ? [...s, ...d] : s;
2149
+ const d = R[u];
2150
+ R[u] = d ? [...s, ...d] : s;
2144
2151
  }), { extendedProps: i, extendedPropTypes: n };
2145
2152
  }
2146
- e.extend = t, e.componentsStyles = ae;
2153
+ e.extend = t, e.componentsStyles = oe;
2147
2154
  function r(o) {
2148
- return e.componentsStyles = C.mergeDeep(ae, o), o;
2155
+ return e.componentsStyles = N.mergeDeep(oe, o), o;
2149
2156
  }
2150
2157
  e.components = r;
2151
- })(K || (K = {}));
2152
- const Ce = K, q = he.createContext({ theme: "", setTheme: () => {
2158
+ })(q || (q = {}));
2159
+ const Ve = q, X = we.createContext({ theme: "", setTheme: () => {
2153
2160
  } });
2154
- function X(e) {
2155
- const { children: t, theme: r, use: o = "local" } = e, [i, n] = se(r);
2156
- return ie(() => {
2161
+ function Z(e) {
2162
+ const { children: t, theme: r, use: o = "local" } = e, [i, n] = ie(r);
2163
+ return ne(() => {
2157
2164
  if (o === "local") return;
2158
2165
  const u = document.documentElement;
2159
2166
  return u.classList.add(i), () => {
2160
2167
  u.classList.remove(i);
2161
2168
  };
2162
- }, [i]), o === "local" ? /* @__PURE__ */ h(q.Provider, { value: { theme: i, setTheme: n }, children: /* @__PURE__ */ h(Fe, { className: i, children: t }) }) : /* @__PURE__ */ h(q.Provider, { value: { theme: i, setTheme: n }, children: t });
2169
+ }, [i]), o === "local" ? /* @__PURE__ */ h(X.Provider, { value: { theme: i, setTheme: n }, children: /* @__PURE__ */ h(Ne, { className: i, children: t }) }) : /* @__PURE__ */ h(X.Provider, { value: { theme: i, setTheme: n }, children: t });
2163
2170
  }
2164
2171
  ((e) => {
2165
2172
  function t() {
2166
- const { theme: r, setTheme: o } = we(q);
2173
+ const { theme: r, setTheme: o } = xe(X);
2167
2174
  return [r, o];
2168
2175
  }
2169
2176
  e.useTheme = t;
2170
- })(X || (X = {}));
2171
- const Le = X;
2172
- class Ve {
2177
+ })(Z || (Z = {}));
2178
+ const Ie = Z;
2179
+ class ze {
2173
2180
  constructor() {
2174
2181
  this._index = 0, this._cache = {};
2175
2182
  }
@@ -2177,58 +2184,58 @@ class Ve {
2177
2184
  return this._cache[t] || (this._cache[t] = this.getByIndex(this._index++)), this._cache[t];
2178
2185
  }
2179
2186
  getByIndex(t) {
2180
- const { first: r, next: o } = ze, i = t - r.length;
2187
+ const { first: r, next: o } = $e, i = t - r.length;
2181
2188
  if (i < 0)
2182
2189
  return r[t];
2183
2190
  const n = Math.floor(i / o.length), u = i - n * o.length;
2184
2191
  return this.getByIndex(n) + o[u];
2185
2192
  }
2186
2193
  }
2187
- const ze = {
2194
+ const $e = {
2188
2195
  first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
2189
2196
  next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
2190
2197
  };
2191
- function $e(e) {
2198
+ function Ae(e) {
2192
2199
  const { clean: t, component: r, variant: o } = e;
2193
- return J(() => {
2200
+ return Q(() => {
2194
2201
  if (t) return;
2195
2202
  const i = r?.split(".");
2196
2203
  if (!i) return;
2197
- const n = i.reduce((d, b, l) => l === 0 ? Ce.componentsStyles[b] : d?.children?.[b], void 0);
2204
+ const n = i.reduce((d, b, l) => l === 0 ? Ve.componentsStyles[b] : d?.children?.[b], void 0);
2198
2205
  if (!n) return;
2199
2206
  if (!o) return n.styles;
2200
- const u = ue(o);
2207
+ const u = ce(o);
2201
2208
  if (u.length === 0) return n.styles;
2202
- const s = C.mergeDeep(...u.map((d) => n.variants?.[d]));
2203
- return n.styles ? C.mergeDeep(n.styles, s) : s;
2209
+ const s = N.mergeDeep(...u.map((d) => n.variants?.[d]));
2210
+ return n.styles ? N.mergeDeep(n.styles, s) : s;
2204
2211
  }, [t, r, o]);
2205
2212
  }
2206
- const Ae = new Ve(), Se = typeof window < "u" && typeof window.document < "u", fe = typeof process == "object" && process.env?.NODE_ENV === "test", Re = Se && !fe ? ie : ne, me = "_b", E = "_s";
2207
- function Ie(e, t) {
2208
- Re(j.flush, [e]);
2209
- const r = $e(e);
2210
- return J(() => {
2211
- const o = [t ? E : me], i = r ? C.mergeDeep(r, e) : e;
2212
- return j.addClassNames(i, o, []), o;
2213
+ const Se = new ze(), Re = typeof window < "u" && typeof window.document < "u", me = typeof process == "object" && process.env?.NODE_ENV === "test", je = Re && !me ? ne : ue, ve = "_b", E = "_s";
2214
+ function _e(e, t) {
2215
+ je(O.flush, [e]);
2216
+ const r = Ae(e);
2217
+ return Q(() => {
2218
+ const o = [t ? E : ve], i = r ? N.mergeDeep(r, e) : e;
2219
+ return O.addClassNames(i, o, []), o;
2213
2220
  }, [e, t, r]);
2214
2221
  }
2215
- var j;
2222
+ var O;
2216
2223
  ((e) => {
2217
2224
  let t = !0, r = {};
2218
2225
  function o(l, g, p, v, c) {
2219
2226
  Object.entries(l).forEach(([f, m]) => {
2220
- if (C.isKeyOf(f, S))
2227
+ if (N.isKeyOf(f, R))
2221
2228
  u(f, m, g, p, v, c);
2222
- else if (C.isKeyOf(f, ce))
2229
+ else if (N.isKeyOf(f, de))
2223
2230
  o(m, g, [...p, f], v, c);
2224
- else if (C.isKeyOf(f, k)) {
2231
+ else if (N.isKeyOf(f, k)) {
2225
2232
  if (Array.isArray(m)) {
2226
- const [w, x] = m;
2227
- o(x, g, [...p, f], v, c);
2233
+ const [x, w] = m;
2234
+ o(w, g, [...p, f], v, c);
2228
2235
  }
2229
- C.isObject(m) && o(m, g, [...p, f], v, c);
2230
- } else C.isKeyOf(f, _) ? o(m, g, p, f, c) : C.isKeyOf(f, re) && Object.entries(m).forEach(([w, x]) => {
2231
- o(x, g, [...p, re[f]], v, w);
2236
+ N.isObject(m) && o(m, g, [...p, f], v, c);
2237
+ } else N.isKeyOf(f, _) ? o(m, g, p, f, c) : N.isKeyOf(f, ae) && Object.entries(m).forEach(([x, w]) => {
2238
+ o(w, g, [...p, ae[f]], v, x);
2232
2239
  });
2233
2240
  });
2234
2241
  }
@@ -2236,34 +2243,34 @@ var j;
2236
2243
  function i() {
2237
2244
  if (!t) return;
2238
2245
  console.debug("\x1B[36m%s\x1B[0m", "[react-box]: flush");
2239
- const l = Object.entries(S).reduce((f, [m], w) => (f[m] = w, f), {}), 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;}
2246
+ const l = Object.entries(R).reduce((f, [m], x) => (f[m] = x, f), {}), 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;}
2240
2247
  html{font-size: 16px;font-family: Arial, sans-serif;}
2241
2248
  body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
2242
2249
  a,ul{all: unset;}
2243
- .${me}{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;}
2250
+ .${ve}{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;}
2244
2251
  .${E}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;transition: all var(--svgTransitionTime);}.${E} path,.${E} circle,.${E} rect,.${E} line {transition: all var(--svgTransitionTime);}
2245
2252
  `, p = Object.entries(r);
2246
2253
  p.sort(
2247
2254
  ([f], [m]) => (_[f] ?? 0) - (_[m] ?? 0)
2248
2255
  );
2249
2256
  const v = p.reduce(
2250
- (f, [m, w]) => (m !== "normal" && f.push(`@media(min-width: ${_[m]}px){`), Object.entries(w).forEach(([x, M]) => {
2251
- const { __parents: ee, ...ve } = M, te = Object.entries(ve);
2252
- te.sort(([V], [B]) => l[V] - l[B]), te.forEach(([V, B]) => {
2253
- B.forEach((z) => {
2254
- const F = S[V].find((N) => Array.isArray(N.values) ? N.values.includes(z) : typeof z == typeof N.values);
2257
+ (f, [m, x]) => (m !== "normal" && f.push(`@media(min-width: ${_[m]}px){`), Object.entries(x).forEach(([w, H]) => {
2258
+ const { __parents: ee, ...ye } = H, te = Object.entries(ye);
2259
+ te.sort(([C], [T]) => l[C] - l[T]), te.forEach(([C, T]) => {
2260
+ T.forEach((z) => {
2261
+ const F = R[C].find((V) => Array.isArray(V.values) ? V.values.includes(z) : typeof z == typeof V.values);
2255
2262
  if (!F) return;
2256
- const $ = s(V, z, +x, m), H = D[+x].map((N) => Q[N]).join(""), A = F.selector?.(`.${$}`, H) ?? `.${$}${H}`, L = Array.isArray(F.styleName) ? F.styleName : [F.styleName ?? V], I = F.valueFormat?.(z, y.getVariableValue) ?? z;
2257
- f.push(`${A}{${L.map((N) => `${N}:${I}`).join(";")}}`);
2263
+ const $ = s(C, z, +w, m), U = I[+w].map((V) => M[V]).join(""), A = F.selector?.(`.${$}`, U) ?? `.${$}${U}`, L = Array.isArray(F.styleName) ? F.styleName : [F.styleName ?? C], D = F.valueFormat?.(z, y.getVariableValue) ?? z;
2264
+ f.push(`${A}{${L.map((V) => `${V}:${D}`).join(";")}}`);
2258
2265
  });
2259
- }), ee && Object.entries(ee).forEach(([V, B]) => {
2260
- const z = Object.entries(B);
2261
- z.sort(([R], [F]) => l[R] - l[F]), z.forEach(([R, F]) => {
2266
+ }), ee && Object.entries(ee).forEach(([C, T]) => {
2267
+ const z = Object.entries(T);
2268
+ z.sort(([j], [F]) => l[j] - l[F]), z.forEach(([j, F]) => {
2262
2269
  F.forEach(($) => {
2263
- const A = S[R].find((T) => Array.isArray(T.values) ? T.values.includes($) : typeof $ == typeof T.values);
2270
+ const A = R[j].find((S) => Array.isArray(S.values) ? S.values.includes($) : typeof $ == typeof S.values);
2264
2271
  if (!A) return;
2265
- const L = s(R, $, +x, m, V), [I] = D[+x], N = I === "theme" ? `.${V} .${L}` : `.${V}:${I} .${L}`, ye = A.selector?.(N, "") ?? N, ge = Array.isArray(A.styleName) ? A.styleName : [A.styleName ?? R], be = A.valueFormat?.($, y.getVariableValue) ?? $;
2266
- f.push(`${ye}{${ge.map((T) => `${T}:${be}`).join(";")}}`);
2272
+ const L = s(j, $, +w, m, C), [D] = I[+w], V = I[+w].map((S) => M[S]).join(""), re = D === "theme" ? `.${C} .${L}` : `.${C}${V} .${L}`, ge = A.selector?.(re, "") ?? re, be = Array.isArray(A.styleName) ? A.styleName : [A.styleName ?? j], pe = A.valueFormat?.($, y.getVariableValue) ?? $;
2273
+ f.push(`${ge}{${be.map((S) => `${S}:${pe}`).join(";")}}`);
2267
2274
  });
2268
2275
  });
2269
2276
  });
@@ -2281,25 +2288,25 @@ a,ul{all: unset;}
2281
2288
  e.clear = n;
2282
2289
  function u(l, g, p, v, c = "normal", f) {
2283
2290
  if (g == null) return;
2284
- const m = v.reduce((x, M) => x + de[M], 0);
2291
+ const m = v.reduce((w, H) => w + fe[H], 0);
2285
2292
  r[c] ? r[c][m] ? r[c][m][l] || (r[c][m][l] = /* @__PURE__ */ new Set()) : r[c][m] = { [l]: /* @__PURE__ */ new Set() } : r[c] = { [m]: { [l]: /* @__PURE__ */ new Set() } }, f ? (r[c][m].__parents ? r[c][m].__parents[f] ? r[c][m].__parents[f][l] || (r[c][m].__parents[f][l] = /* @__PURE__ */ new Set()) : r[c][m].__parents[f] = { [l]: /* @__PURE__ */ new Set() } : r[c][m].__parents = { [f]: { [l]: /* @__PURE__ */ new Set() } }, r[c][m].__parents[f][l].has(g) || (r[c][m].__parents[f][l].add(g), t = !0)) : r[c][m][l].has(g) || (r[c][m][l].add(g), t = !0);
2286
- const w = s(l, g, m, c, f);
2287
- p.push(w);
2293
+ const x = s(l, g, m, c, f);
2294
+ p.push(x);
2288
2295
  }
2289
2296
  function s(l, g, p, v, c) {
2290
- const f = D[p], m = `${v === "normal" ? "" : `${v}-`}${f.map((w) => `${w}-`).join("")}${c ? `${c}-` : ""}${l}-${g}`;
2291
- return fe ? m : Ae.getIdentity(m);
2297
+ const f = I[p], m = `${v === "normal" ? "" : `${v}-`}${f.map((x) => `${x}-`).join("")}${c ? `${c}-` : ""}${l}-${g}`;
2298
+ return me ? m : Se.getIdentity(m);
2292
2299
  }
2293
2300
  const d = "crono-styles";
2294
2301
  function b() {
2295
2302
  let l = document.getElementById(d);
2296
2303
  return l || (l = document.createElement("style"), l.setAttribute("id", d), l.setAttribute("type", "text/css"), document.head.insertBefore(l, document.head.firstChild)), l;
2297
2304
  }
2298
- })(j || (j = {}));
2299
- var oe;
2305
+ })(O || (O = {}));
2306
+ var le;
2300
2307
  ((e) => {
2301
- e.flush = j.flush, e.clear = j.clear;
2302
- })(oe || (oe = {}));
2308
+ e.flush = O.flush, e.clear = O.clear;
2309
+ })(le || (le = {}));
2303
2310
  Array.prototype.removeBy || (Array.prototype.removeBy = function(e) {
2304
2311
  return this.filter((t) => !e(t));
2305
2312
  });
@@ -2345,9 +2352,9 @@ Array.prototype.groupBy || (Array.prototype.groupBy = function(e, t = !1) {
2345
2352
  }, /* @__PURE__ */ new Map());
2346
2353
  return Array.from(r, ([o, i]) => ({ key: o, values: i }));
2347
2354
  });
2348
- function _e(e) {
2349
- const { node: t = null, event: r = "click", hideOnScroll: o = !1, hideOnResize: i = !1, hideOnEscape: n = !0 } = e ?? {}, [u, s] = se(!1), d = xe(null);
2350
- return ne(() => {
2355
+ function ke(e) {
2356
+ const { node: t = null, event: r = "click", hideOnScroll: o = !1, hideOnResize: i = !1, hideOnEscape: n = !0 } = e ?? {}, [u, s] = ie(!1), d = Fe(null);
2357
+ return ue(() => {
2351
2358
  function b(c) {
2352
2359
  (t ?? d.current)?.contains(c.target) === !1 && s(!1);
2353
2360
  }
@@ -2369,14 +2376,14 @@ function _e(e) {
2369
2376
  const Ee = {
2370
2377
  selected: "aria-selected"
2371
2378
  };
2372
- var le;
2379
+ var se;
2373
2380
  ((e) => {
2374
2381
  function t(r, o, i) {
2375
2382
  r !== void 0 && r != null && (i[Ee[o] ?? o] = Array.isArray(r) ? r[0] : r);
2376
2383
  }
2377
2384
  e.assignBooleanProp = t;
2378
- })(le || (le = {}));
2379
- var Z;
2385
+ })(se || (se = {}));
2386
+ var Y;
2380
2387
  ((e) => {
2381
2388
  function t(r, o = 300) {
2382
2389
  let i = !1, n;
@@ -2391,9 +2398,9 @@ var Z;
2391
2398
  };
2392
2399
  }
2393
2400
  e.throttle = t;
2394
- })(Z || (Z = {}));
2395
- const ke = Z;
2396
- function Me(e) {
2401
+ })(Y || (Y = {}));
2402
+ const Me = Y;
2403
+ function He(e) {
2397
2404
  let t;
2398
2405
  return Object.defineProperty({
2399
2406
  clear() {
@@ -2403,8 +2410,8 @@ function Me(e) {
2403
2410
  get: () => (t === void 0 && (t = e()), t)
2404
2411
  });
2405
2412
  }
2406
- function He(e) {
2407
- return /* @__PURE__ */ h(O, { viewBox: "4 2 16 18", width: "1rem", fill: "currentColor", ...e, children: /* @__PURE__ */ h(
2413
+ function Ue(e) {
2414
+ return /* @__PURE__ */ h(B, { viewBox: "4 2 16 18", width: "1rem", fill: "currentColor", ...e, children: /* @__PURE__ */ h(
2408
2415
  "path",
2409
2416
  {
2410
2417
  fillRule: "evenodd",
@@ -2414,7 +2421,10 @@ function He(e) {
2414
2421
  ) });
2415
2422
  }
2416
2423
  function De(e) {
2417
- return /* @__PURE__ */ h(O, { viewBox: "0 0 16 16", width: "18", ...e, children: /* @__PURE__ */ h(
2424
+ return /* @__PURE__ */ h(B, { ...e, children: /* @__PURE__ */ h("path", { d: "M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z" }) });
2425
+ }
2426
+ function Ge(e) {
2427
+ return /* @__PURE__ */ h(B, { viewBox: "0 0 16 16", width: "18", ...e, children: /* @__PURE__ */ h(
2418
2428
  "path",
2419
2429
  {
2420
2430
  strokeWidth: 4,
@@ -2422,8 +2432,8 @@ function De(e) {
2422
2432
  }
2423
2433
  ) });
2424
2434
  }
2425
- function Ue(e) {
2426
- return /* @__PURE__ */ pe(O, { viewBox: "0 0 490.6 490.6", ...e, children: [
2435
+ function We(e) {
2436
+ return /* @__PURE__ */ he(B, { viewBox: "0 0 490.6 490.6", ...e, children: [
2427
2437
  /* @__PURE__ */ h("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" }),
2428
2438
  /* @__PURE__ */ h("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" }),
2429
2439
  /* @__PURE__ */ h("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" }),
@@ -2431,31 +2441,28 @@ function Ue(e) {
2431
2441
  /* @__PURE__ */ h("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" })
2432
2442
  ] });
2433
2443
  }
2434
- function Ge(e) {
2435
- return /* @__PURE__ */ h(O, { viewBox: "0 0 1024 1024", ...e, children: /* @__PURE__ */ h("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" }) });
2436
- }
2437
- function We(e) {
2438
- return /* @__PURE__ */ h(O, { ...e, children: /* @__PURE__ */ h("path", { d: "M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z" }) });
2444
+ function Ke(e) {
2445
+ return /* @__PURE__ */ h(B, { viewBox: "0 0 1024 1024", ...e, children: /* @__PURE__ */ h("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" }) });
2439
2446
  }
2440
- var Y;
2447
+ var P;
2441
2448
  ((e) => {
2442
2449
  function t(r) {
2443
2450
  return r.charAt(0).toUpperCase() + r.slice(1);
2444
2451
  }
2445
2452
  e.capitalize = t;
2446
- })(Y || (Y = {}));
2447
- const Ke = Y;
2448
- function qe() {
2449
- return J(() => {
2453
+ })(P || (P = {}));
2454
+ const qe = P;
2455
+ function Xe() {
2456
+ return Q(() => {
2450
2457
  const e = "crono-box";
2451
2458
  let t = document.getElementById(e);
2452
2459
  return t || (t = document.createElement("div"), t.id = e, document.body.appendChild(t)), t;
2453
2460
  }, []);
2454
2461
  }
2455
- function Xe(e) {
2456
- return /* @__PURE__ */ h(O, { viewBox: "0 0 24 24", ...e, children: /* @__PURE__ */ h("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" }) });
2462
+ function Ze(e) {
2463
+ return /* @__PURE__ */ h(B, { viewBox: "0 0 24 24", ...e, children: /* @__PURE__ */ h("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" }) });
2457
2464
  }
2458
- var P;
2465
+ var J;
2459
2466
  ((e) => {
2460
2467
  function t(o) {
2461
2468
  const i = Array.from(o.elements).reduce(
@@ -2495,27 +2502,27 @@ var P;
2495
2502
  } else
2496
2503
  o[i] = n;
2497
2504
  }
2498
- })(P || (P = {}));
2499
- const Ze = P;
2505
+ })(J || (J = {}));
2506
+ const Ye = J;
2500
2507
  export {
2501
- le as B,
2502
- Xe as C,
2503
- De as D,
2504
- He as E,
2505
- ke as F,
2506
- Ue as G,
2507
- C as O,
2508
- Ge as P,
2509
- We as S,
2510
- Le as T,
2508
+ se as B,
2509
+ Ze as C,
2510
+ Ge as D,
2511
+ Ue as E,
2512
+ Me as F,
2513
+ We as G,
2514
+ N as O,
2515
+ Ke as P,
2516
+ De as S,
2517
+ Ie as T,
2511
2518
  y as V,
2512
- Ce as a,
2513
- _e as b,
2514
- ue as c,
2515
- Ze as d,
2516
- Ke as e,
2517
- qe as f,
2518
- oe as g,
2519
- Me as m,
2520
- Ie as u
2519
+ Ve as a,
2520
+ ke as b,
2521
+ ce as c,
2522
+ Ye as d,
2523
+ qe as e,
2524
+ Xe as f,
2525
+ le as g,
2526
+ He as m,
2527
+ _e as u
2521
2528
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "type": "module",
5
5
  "main": "./box.cjs",
6
6
  "module": "./box.mjs",
@@ -69,7 +69,9 @@
69
69
  "@vitejs/plugin-react": "^4.3.1",
70
70
  "autoprefixer": "^10.4.20",
71
71
  "eslint": "^9.30.1",
72
+ "eslint-config-prettier": "^10.1.5",
72
73
  "eslint-plugin-import": "^2.32.0",
74
+ "eslint-plugin-prettier": "^5.5.1",
73
75
  "eslint-plugin-react-hooks": "^5.2.0",
74
76
  "eslint-plugin-react-refresh": "^0.4.20",
75
77
  "globals": "^16.3.0",
package/types.d.ts CHANGED
@@ -25,7 +25,7 @@ type BoxPseudoClassesStyles2Nested = ExtractKeys<typeof pseudo2, BoxStylesWithPs
25
25
  type BoxPseudoClassesStyles2TopLevel = ExtractKeys<typeof pseudo2, boolean | [boolean, BoxStylesWithPseudoClasses]>;
26
26
  export interface BoxStylesWithPseudoClasses extends BoxStyles, BoxPseudoClassesStyles1, BoxPseudoClassesStyles2Nested {
27
27
  }
28
- type BoxPseudoGroupClassesStyles = ExtractKeys<typeof pseudoGroupClasses, Record<string, BoxStyles>>;
28
+ type BoxPseudoGroupClassesStyles = ExtractKeys<typeof pseudoGroupClasses, Record<string, BoxStylesWithPseudoClasses>>;
29
29
  type BoxBreakpointsStyles = ExtractKeys<typeof breakpoints, BoxStylesWithPseudoClasses & BoxPseudoGroupClassesStyles>;
30
30
  type ExtractVariants<T> = T extends {
31
31
  variants?: infer Variants;