@cronocode/react-box 3.0.11 → 3.0.13

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,77 +1,78 @@
1
- import ve, { useContext as se, useMemo as L, useLayoutEffect as be, useEffect as ie, useState as ne, useRef as ye } from "react";
2
- import { jsx as ge } from "react/jsx-runtime";
3
- function he(...e) {
4
- return e.reduce((t, r) => r ? typeof r == "string" ? (t.push(r), t) : Array.isArray(r) ? (t.push(...he(...r)), t) : (Object.entries(r).forEach(([l, i]) => {
5
- i && t.push(l);
1
+ import ye, { useMemo as Q, useLayoutEffect as ie, useEffect as ne, useState as ue, useContext as ge, useRef as he } from "react";
2
+ import { jsx as G } from "react/jsx-runtime";
3
+ import pe from "./box.mjs";
4
+ function we(...e) {
5
+ return e.reduce((t, r) => r ? typeof r == "string" ? (t.push(r), t) : Array.isArray(r) ? (t.push(...we(...r)), t) : (Object.entries(r).forEach(([l, s]) => {
6
+ s && t.push(l);
6
7
  }), t) : t, []);
7
8
  }
8
9
  var u;
9
10
  ((e) => {
10
11
  ((t) => {
11
- function r(i, n) {
12
- return `${i}${n.replace("/", "-")}`;
12
+ function r(s, n) {
13
+ return `${s}${n.replace("/", "-")}`;
13
14
  }
14
15
  t.fraction = r;
15
- function l(i) {
16
- return [`${i} path`, `${i} circle`, `${i} rect`, `${i} line`];
16
+ function l(s) {
17
+ return [`${s} path`, `${s} circle`, `${s} rect`, `${s} line`];
17
18
  }
18
19
  t.svg = l;
19
20
  })(e.ClassName || (e.ClassName = {})), ((t) => {
20
- function r(b, s, c = 4) {
21
- return `${b / c}rem`;
21
+ function r(b, i, f = 4) {
22
+ return `${b / f}rem`;
22
23
  }
23
24
  t.rem = r;
24
25
  function l(b) {
25
26
  return `${b}px`;
26
27
  }
27
28
  t.px = l;
28
- function i(b, s) {
29
- const [c, m] = s.split("/");
30
- return `${+c / +m * 100}%`;
29
+ function s(b, i) {
30
+ const [f, m] = i.split("/");
31
+ return `${+f / +m * 100}%`;
31
32
  }
32
- t.fraction = i;
33
- function n(b, s) {
34
- switch (s) {
33
+ t.fraction = s;
34
+ function n(b, i) {
35
+ switch (i) {
35
36
  case "fit":
36
37
  return "100%";
37
38
  case "fit-screen":
38
39
  return b.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
39
40
  default:
40
- return s;
41
+ return i;
41
42
  }
42
43
  }
43
44
  t.widthHeight = n;
44
45
  function d(b) {
45
- return (s, c) => `var(--${b}${c});`;
46
+ return (i, f) => `var(--${b}${f});`;
46
47
  }
47
48
  t.variables = d;
48
- function o(b) {
49
- return (s, c) => `var(--${b}${c});`;
49
+ function a(b) {
50
+ return (i, f) => `var(--${b}${f});`;
50
51
  }
51
- t.svgVariables = o;
52
- function f(b, s) {
53
- return `repeat(${s},minmax(0,1fr))`;
52
+ t.svgVariables = a;
53
+ function c(b, i) {
54
+ return `repeat(${i},minmax(0,1fr))`;
54
55
  }
55
- t.gridColumns = f;
56
- function y(b, s) {
57
- return s === "full-row" ? "1/-1" : `span ${s}/span ${s}`;
56
+ t.gridColumns = c;
57
+ function y(b, i) {
58
+ return i === "full-row" ? "1/-1" : `span ${i}/span ${i}`;
58
59
  }
59
60
  t.gridColumn = y;
60
- function a(b, s) {
61
- return `${s}ms`;
61
+ function o(b, i) {
62
+ return `${i}ms`;
62
63
  }
63
- t.ms = a;
64
- function v(b, s) {
65
- return `${s}deg`;
64
+ t.ms = o;
65
+ function v(b, i) {
66
+ return `${i}deg`;
66
67
  }
67
68
  t.rotate = v;
68
- function g(b, s) {
69
- return s === "xAxis" ? "-1 1" : "1 -1";
69
+ function g(b, i) {
70
+ return i === "xAxis" ? "-1 1" : "1 -1";
70
71
  }
71
72
  t.flip = g;
72
73
  })(e.Value || (e.Value = {}));
73
74
  })(u || (u = {}));
74
- var M;
75
+ var K;
75
76
  ((e) => {
76
77
  e.colors = {
77
78
  currentColor: "currentColor",
@@ -337,20 +338,20 @@ var M;
337
338
  "large-shadow": "rgba(17, 17, 26, 0.1) 0px 4px 16px, rgba(17, 17, 26, 0.05) 0px 8px 32px"
338
339
  }, r = {};
339
340
  let l = {};
340
- function i(o) {
341
- return o in l ? r[o] = l[o] : o in t ? r[o] = t[o] : o in e.colors ? r[o] = e.colors[o] : r[o] = o, `var(--${o})`;
341
+ function s(a) {
342
+ return a in l ? r[a] = l[a] : a in t ? r[a] = t[a] : a in e.colors ? r[a] = e.colors[a] : r[a] = a, `var(--${a})`;
342
343
  }
343
- e.getVariableValue = i;
344
+ e.getVariableValue = s;
344
345
  function n() {
345
- return Object.entries(r).map(([o, f]) => `--${o}: ${f};`).join("");
346
+ return Object.entries(r).map(([a, c]) => `--${a}: ${c};`).join("");
346
347
  }
347
348
  e.generateVariables = n;
348
- function d(o) {
349
- l = o;
349
+ function d(a) {
350
+ l = a;
350
351
  }
351
352
  e.setUserVariables = d;
352
- })(M || (M = {}));
353
- const N = M, E = {
353
+ })(K || (K = {}));
354
+ const N = K, j = {
354
355
  /** The appearance CSS property is used to display UI elements with platform-specific styling, based on the operating system's theme. */
355
356
  appearance: [
356
357
  {
@@ -1531,7 +1532,7 @@ const N = M, E = {
1531
1532
  styleName: "transform"
1532
1533
  }
1533
1534
  ]
1534
- }, ue = {
1535
+ }, ce = {
1535
1536
  hover: ":hover",
1536
1537
  focus: ":focus-within",
1537
1538
  hasFocus: ":has(:focus)",
@@ -1544,29 +1545,32 @@ const N = M, E = {
1544
1545
  hasChecked: ":has(:checked)",
1545
1546
  hasRequired: ":has(:required)",
1546
1547
  hasDisabled: ":has([disabled])"
1547
- }, U = {
1548
+ }, H = {
1548
1549
  indeterminate: ":indeterminate",
1549
1550
  checked: ":checked",
1550
1551
  required: ":required",
1551
1552
  disabled: "[disabled]",
1552
1553
  selected: '[aria-selected="true"]'
1553
- }, Z = { ...ue, ...U }, de = Object.entries(Z).reduce(
1554
+ }, xe = {
1555
+ theme: ""
1556
+ }, Z = { ...ce, ...H, ...xe }, de = Object.entries(Z).reduce(
1554
1557
  (e, [t], r) => (e[t] = Math.pow(2, r), e),
1555
1558
  {}
1556
- ), W = Object.entries(Z).reduce(
1559
+ ), D = Object.entries(Z).reduce(
1557
1560
  (e, [t]) => {
1558
1561
  const r = de[t];
1559
- return Object.entries(e).forEach(([l, i]) => {
1560
- e[+l + r] = [...i, t];
1562
+ return Object.entries(e).forEach(([l, s]) => {
1563
+ e[+l + r] = [...s, t];
1561
1564
  }), e;
1562
1565
  },
1563
1566
  { 0: [] }
1564
- ), q = {
1567
+ ), oe = {
1565
1568
  hoverGroup: "hover",
1566
1569
  focusGroup: "focus",
1567
1570
  activeGroup: "active",
1568
- disabledGroup: "disabled"
1569
- }, H = {
1571
+ disabledGroup: "disabled",
1572
+ theme: "theme"
1573
+ }, B = {
1570
1574
  /** Styles applied for small screens and larger. >= 640 */
1571
1575
  sm: 640,
1572
1576
  /** Styles applied for medium screens and larger. >= 768 */
@@ -1578,15 +1582,15 @@ const N = M, E = {
1578
1582
  /** Styles applied for 2x extra-large screens and larger. >= 1536 */
1579
1583
  xxl: 1536
1580
1584
  };
1581
- var X;
1585
+ var W;
1582
1586
  ((e) => {
1583
- function t(n, d, o) {
1584
- const f = { ...n }, y = f.props || {};
1585
- return d.forEach((a) => {
1586
- a in f && (y[a] = f[a], delete f[a]);
1587
- }), o && Object.entries(o).forEach(([a, v]) => {
1588
- y[a] = v;
1589
- }), f.props = y, f;
1587
+ function t(n, d, a) {
1588
+ const c = { ...n }, y = c.props || {};
1589
+ return d.forEach((o) => {
1590
+ o in c && (y[o] = c[o], delete c[o]);
1591
+ }), a && Object.entries(a).forEach(([o, v]) => {
1592
+ y[o] = v;
1593
+ }), c.props = y, c;
1590
1594
  }
1591
1595
  e.buildProps = t;
1592
1596
  function r(n) {
@@ -1594,19 +1598,19 @@ var X;
1594
1598
  }
1595
1599
  e.isObject = r;
1596
1600
  function l(...n) {
1597
- return n.reduce((d, o) => (Object.keys(o ?? {}).forEach((f) => {
1598
- const y = d[f], a = o[f];
1599
- f in U && typeof a == "boolean" || (f in U && Array.isArray(a) ? d[f] = l(y, a[1] ?? {}) : Array.isArray(y) && Array.isArray(a) ? d[f] = y.concat(...a) : r(y) && r(a) ? d[f] = l(y, a) : d[f] = a);
1601
+ return n.reduce((d, a) => (Object.keys(a ?? {}).forEach((c) => {
1602
+ const y = d[c], o = a[c];
1603
+ r(o) && "clean" in o && o.clean ? d[c] = o : c in H && typeof o == "boolean" || (c in H && Array.isArray(o) ? d[c] = l(y, o[1] ?? {}) : Array.isArray(y) && Array.isArray(o) ? d[c] = y.concat(...o) : r(y) && r(o) ? d[c] = l(y, o) : d[c] = o);
1600
1604
  }), d), {});
1601
1605
  }
1602
1606
  e.mergeDeep = l;
1603
- function i(n, d) {
1607
+ function s(n, d) {
1604
1608
  return n in d;
1605
1609
  }
1606
- e.isKeyOf = i;
1607
- })(X || (X = {}));
1608
- const C = X;
1609
- class pe {
1610
+ e.isKeyOf = s;
1611
+ })(W || (W = {}));
1612
+ const $ = W;
1613
+ class Ne {
1610
1614
  constructor() {
1611
1615
  this._index = 0, this._cache = {};
1612
1616
  }
@@ -1614,17 +1618,17 @@ class pe {
1614
1618
  return this._cache[t] || (this._cache[t] = this.getByIndex(this._index++)), this._cache[t];
1615
1619
  }
1616
1620
  getByIndex(t) {
1617
- const { first: r, next: l } = we, i = t - r.length;
1618
- if (i < 0)
1621
+ const { first: r, next: l } = Fe, s = t - r.length;
1622
+ if (s < 0)
1619
1623
  return r[t];
1620
- const n = Math.floor(i / l.length), d = i - n * l.length;
1624
+ const n = Math.floor(s / l.length), d = s - n * l.length;
1621
1625
  return this.getByIndex(n) + l[d];
1622
1626
  }
1623
1627
  }
1624
- const we = {
1628
+ const Fe = {
1625
1629
  first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
1626
1630
  next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
1627
- }, R = {
1631
+ }, ae = {
1628
1632
  button: {
1629
1633
  styles: {
1630
1634
  display: "inline-flex",
@@ -1647,6 +1651,10 @@ const we = {
1647
1651
  color: "gray-400",
1648
1652
  borderColor: "gray-300"
1649
1653
  }
1654
+ },
1655
+ variants: {
1656
+ test: {},
1657
+ test2: {}
1650
1658
  }
1651
1659
  },
1652
1660
  textbox: {
@@ -1847,7 +1855,7 @@ const we = {
1847
1855
  }
1848
1856
  }
1849
1857
  },
1850
- themes: {
1858
+ variants: {
1851
1859
  multiple: {
1852
1860
  selected: {
1853
1861
  cursor: "pointer"
@@ -1909,252 +1917,251 @@ const we = {
1909
1917
  }
1910
1918
  }
1911
1919
  }
1920
+ },
1921
+ label: { styles: {} },
1922
+ datagrid: { styles: {} }
1923
+ };
1924
+ var q;
1925
+ ((e) => {
1926
+ function t(l, s, n) {
1927
+ return N.setUserVariables(l), Object.entries(s).forEach(([d, a]) => {
1928
+ j[d] = a;
1929
+ }), Object.entries(n).forEach(([d, a]) => {
1930
+ const c = j[d];
1931
+ j[d] = c ? [...a, ...c] : a;
1932
+ }), { extendedProps: s, extendedPropTypes: n };
1912
1933
  }
1913
- }, P = ve.createContext({ themeStyles: R, theme: "", setTheme: () => {
1914
- } });
1915
- function xe(e) {
1916
- const { clean: t, theme: r, component: l } = e, { themeStyles: i } = se(P);
1917
- return L(() => {
1918
- var o;
1934
+ e.extend = t, e.componentsStyles = ae;
1935
+ function r(l) {
1936
+ return e.componentsStyles = $.mergeDeep(ae, l), l;
1937
+ }
1938
+ e.components = r;
1939
+ })(q || (q = {}));
1940
+ const Ce = q;
1941
+ function $e(e) {
1942
+ const { clean: t, component: r, variant: l } = e;
1943
+ return Q(() => {
1944
+ var a;
1919
1945
  if (t) return;
1920
- const n = l == null ? void 0 : l.split(".");
1921
- if (!n) return;
1922
- const d = n.reduce((f, y, a) => {
1946
+ const s = r == null ? void 0 : r.split(".");
1947
+ if (!s) return;
1948
+ const n = s.reduce((c, y, o) => {
1923
1949
  var v;
1924
- return a === 0 ? i == null ? void 0 : i[y] : (v = f == null ? void 0 : f.children) == null ? void 0 : v[y];
1950
+ return o === 0 ? Ce.componentsStyles[y] : (v = c == null ? void 0 : c.children) == null ? void 0 : v[y];
1925
1951
  }, void 0);
1926
- if (d)
1927
- return r ? C.mergeDeep(d.styles, ((o = d.themes) == null ? void 0 : o[r]) ?? {}) : d.styles;
1928
- }, [l, t, r, i]);
1952
+ if (!n) return;
1953
+ const d = (a = n.variants) == null ? void 0 : a[l];
1954
+ return d ? $.mergeDeep(n.styles, d) : n.styles;
1955
+ }, [t, r, l]);
1929
1956
  }
1930
- const Ne = new pe(), Fe = typeof window < "u" && typeof window.document < "u";
1931
- var le;
1932
- const ce = typeof process == "object" && ((le = process.env) == null ? void 0 : le.NODE_ENV) === "test", $e = Fe && !ce ? be : ie, fe = "_b", A = "_s";
1933
- function Ee(e, t) {
1934
- $e(S.flush, [e]);
1935
- const r = xe(e);
1936
- return L(() => {
1937
- const l = [t ? A : fe], i = r ? C.mergeDeep(r, e) : e;
1938
- return S.addClassNames(i, l, []), l;
1957
+ const Ve = new Ne(), ze = typeof window < "u" && typeof window.document < "u";
1958
+ var se;
1959
+ const fe = typeof process == "object" && ((se = process.env) == null ? void 0 : se.NODE_ENV) === "test", je = ze && !fe ? ie : ne, me = "_b", O = "_s";
1960
+ function Te(e, t) {
1961
+ je(S.flush, [e]);
1962
+ const r = $e(e);
1963
+ return Q(() => {
1964
+ const l = [t ? O : me], s = r ? $.mergeDeep(r, e) : e;
1965
+ return S.addClassNames(s, l, []), l;
1939
1966
  }, [e, t, r]);
1940
1967
  }
1941
1968
  var S;
1942
1969
  ((e) => {
1943
1970
  let t = !0, r = {};
1944
- function l(a, v, g, b, s) {
1945
- Object.entries(a).forEach(([c, m]) => {
1946
- if (C.isKeyOf(c, E))
1947
- d(c, m, v, g, b, s);
1948
- else if (C.isKeyOf(c, ue))
1949
- l(m, v, [...g, c], b, s);
1950
- else if (C.isKeyOf(c, U)) {
1971
+ function l(o, v, g, b, i) {
1972
+ Object.entries(o).forEach(([f, m]) => {
1973
+ if ($.isKeyOf(f, j))
1974
+ d(f, m, v, g, b, i);
1975
+ else if ($.isKeyOf(f, ce))
1976
+ l(m, v, [...g, f], b, i);
1977
+ else if ($.isKeyOf(f, H)) {
1951
1978
  if (Array.isArray(m)) {
1952
1979
  const [w, x] = m;
1953
- l(x, v, [...g, c], b, s);
1980
+ l(x, v, [...g, f], b, i);
1954
1981
  }
1955
- C.isObject(m) && l(m, v, [...g, c], b, s);
1956
- } else C.isKeyOf(c, H) ? l(m, v, g, c, s) : C.isKeyOf(c, q) && (typeof m == "string" ? v.push(`${q[c]}-${m}`) : Object.entries(m).forEach(([w, x]) => {
1957
- l(x, v, [...g, q[c]], b, w);
1958
- }));
1982
+ $.isObject(m) && l(m, v, [...g, f], b, i);
1983
+ } else $.isKeyOf(f, B) ? l(m, v, g, f, i) : $.isKeyOf(f, oe) && Object.entries(m).forEach(([w, x]) => {
1984
+ l(x, v, [...g, oe[f]], b, w);
1985
+ });
1959
1986
  });
1960
1987
  }
1961
1988
  e.addClassNames = l;
1962
- function i() {
1989
+ function s() {
1963
1990
  if (!t) return;
1964
1991
  console.debug("\x1B[36m%s\x1B[0m", "[react-box]: flush");
1965
- const a = Object.entries(E).reduce((c, [m], w) => (c[m] = w, c), {}), v = `: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;}
1992
+ const o = Object.entries(j).reduce((f, [m], w) => (f[m] = w, f), {}), v = `: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;}
1966
1993
  html{font-size: 16px;font-family: Arial, sans-serif;}
1967
1994
  body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
1968
1995
  a,ul{all: unset;}
1969
- .${fe}{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;}
1970
- .${A}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;transition: all var(--svgTransitionTime);}.${A} path,.${A} circle,.${A} rect,.${A} line {transition: all var(--svgTransitionTime);}
1996
+ .${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;}
1997
+ .${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);}
1971
1998
  `, g = Object.entries(r);
1972
1999
  g.sort(
1973
- ([c], [m]) => (H[c] ?? 0) - (H[m] ?? 0)
2000
+ ([f], [m]) => (B[f] ?? 0) - (B[m] ?? 0)
1974
2001
  );
1975
2002
  const b = g.reduce(
1976
- (c, [m, w]) => (m !== "normal" && c.push(`@media(min-width: ${H[m]}px){`), Object.entries(w).forEach(([x, D]) => {
1977
- const { __parents: ee, ...me } = D, te = Object.entries(me);
1978
- te.sort(([F], [T]) => a[F] - a[T]), te.forEach(([F, T]) => {
1979
- T.forEach((V) => {
1980
- var k, I;
1981
- const h = E[F].find(($) => Array.isArray($.values) ? $.values.includes(V) : typeof V == typeof $.values);
2003
+ (f, [m, w]) => (m !== "normal" && f.push(`@media(min-width: ${B[m]}px){`), Object.entries(w).forEach(([x, L]) => {
2004
+ const { __parents: P, ...ve } = L, ee = Object.entries(ve);
2005
+ ee.sort(([F], [A]) => o[F] - o[A]), ee.forEach(([F, A]) => {
2006
+ A.forEach((V) => {
2007
+ var T, I;
2008
+ const h = j[F].find((C) => Array.isArray(C.values) ? C.values.includes(V) : typeof V == typeof C.values);
1982
2009
  if (!h) return;
1983
- const z = o(F, V, +x, m), K = W[+x].map(($) => Z[$]).join(""), p = ((k = h.selector) == null ? void 0 : k.call(h, `.${z}`, K)) ?? `.${z}${K}`, B = Array.isArray(h.styleName) ? h.styleName : [h.styleName ?? F], O = ((I = h.valueFormat) == null ? void 0 : I.call(h, V, N.getVariableValue)) ?? V;
1984
- c.push(`${p}{${B.map(($) => `${$}:${O}`).join(";")}}`);
2010
+ const z = a(F, V, +x, m), U = D[+x].map((C) => Z[C]).join(""), p = ((T = h.selector) == null ? void 0 : T.call(h, `.${z}`, U)) ?? `.${z}${U}`, R = Array.isArray(h.styleName) ? h.styleName : [h.styleName ?? F], k = ((I = h.valueFormat) == null ? void 0 : I.call(h, V, N.getVariableValue)) ?? V;
2011
+ f.push(`${p}{${R.map((C) => `${C}:${k}`).join(";")}}`);
1985
2012
  });
1986
- }), ee && Object.entries(ee).forEach(([F, T]) => {
1987
- const V = Object.entries(T);
1988
- V.sort(([j], [h]) => a[j] - a[h]), V.forEach(([j, h]) => {
2013
+ }), P && Object.entries(P).forEach(([F, A]) => {
2014
+ const V = Object.entries(A);
2015
+ V.sort(([E], [h]) => o[E] - o[h]), V.forEach(([E, h]) => {
1989
2016
  h.forEach((z) => {
1990
- var re, oe;
1991
- const p = E[j].find((_) => Array.isArray(_.values) ? _.values.includes(z) : typeof z == typeof _.values);
2017
+ var te, re;
2018
+ const p = j[E].find((_) => Array.isArray(_.values) ? _.values.includes(z) : typeof z == typeof _.values);
1992
2019
  if (!p) return;
1993
- const B = o(j, z, +x, m, F), [O] = W[+x], k = ((re = p.selector) == null ? void 0 : re.call(p, `.${O}-${F}:${O} .${B}`, "")) ?? `.${O}-${F}:${O} .${B}`, I = Array.isArray(p.styleName) ? p.styleName : [p.styleName ?? j], $ = ((oe = p.valueFormat) == null ? void 0 : oe.call(p, z, N.getVariableValue)) ?? z;
1994
- c.push(`${k}{${I.map((_) => `${_}:${$}`).join(";")}}`);
2020
+ const R = a(E, z, +x, m, F), [k] = D[+x], T = k === "theme" ? `.${F} .${R}` : `.${F}:${k} .${R}`, I = ((te = p.selector) == null ? void 0 : te.call(p, T, "")) ?? T, C = Array.isArray(p.styleName) ? p.styleName : [p.styleName ?? E], be = ((re = p.valueFormat) == null ? void 0 : re.call(p, z, N.getVariableValue)) ?? z;
2021
+ f.push(`${I}{${C.map((_) => `${_}:${be}`).join(";")}}`);
1995
2022
  });
1996
2023
  });
1997
2024
  });
1998
- }), m !== "normal" && c.push("}"), c),
2025
+ }), m !== "normal" && f.push("}"), f),
1999
2026
  [v]
2000
2027
  );
2001
2028
  b.unshift(`:root{${N.generateVariables()}}`);
2002
- const s = y();
2003
- s.innerHTML = b.join(""), t = !1;
2029
+ const i = y();
2030
+ i.innerHTML = b.join(""), t = !1;
2004
2031
  }
2005
- e.flush = i;
2032
+ e.flush = s;
2006
2033
  function n() {
2007
2034
  r = {};
2008
2035
  }
2009
2036
  e.clear = n;
2010
- function d(a, v, g, b, s = "normal", c) {
2037
+ function d(o, v, g, b, i = "normal", f) {
2011
2038
  if (v == null) return;
2012
- const m = b.reduce((x, D) => x + de[D], 0);
2013
- r[s] ? r[s][m] ? r[s][m][a] || (r[s][m][a] = /* @__PURE__ */ new Set()) : r[s][m] = { [a]: /* @__PURE__ */ new Set() } : r[s] = { [m]: { [a]: /* @__PURE__ */ new Set() } }, c ? (r[s][m].__parents ? r[s][m].__parents[c] ? r[s][m].__parents[c][a] || (r[s][m].__parents[c][a] = /* @__PURE__ */ new Set()) : r[s][m].__parents[c] = { [a]: /* @__PURE__ */ new Set() } : r[s][m].__parents = { [c]: { [a]: /* @__PURE__ */ new Set() } }, r[s][m].__parents[c][a].has(v) || (r[s][m].__parents[c][a].add(v), t = !0)) : r[s][m][a].has(v) || (r[s][m][a].add(v), t = !0);
2014
- const w = o(a, v, m, s, c);
2039
+ const m = b.reduce((x, L) => x + de[L], 0);
2040
+ r[i] ? r[i][m] ? r[i][m][o] || (r[i][m][o] = /* @__PURE__ */ new Set()) : r[i][m] = { [o]: /* @__PURE__ */ new Set() } : r[i] = { [m]: { [o]: /* @__PURE__ */ new Set() } }, f ? (r[i][m].__parents ? r[i][m].__parents[f] ? r[i][m].__parents[f][o] || (r[i][m].__parents[f][o] = /* @__PURE__ */ new Set()) : r[i][m].__parents[f] = { [o]: /* @__PURE__ */ new Set() } : r[i][m].__parents = { [f]: { [o]: /* @__PURE__ */ new Set() } }, r[i][m].__parents[f][o].has(v) || (r[i][m].__parents[f][o].add(v), t = !0)) : r[i][m][o].has(v) || (r[i][m][o].add(v), t = !0);
2041
+ const w = a(o, v, m, i, f);
2015
2042
  g.push(w);
2016
2043
  }
2017
- function o(a, v, g, b, s) {
2018
- const c = W[g], m = `${b === "normal" ? "" : `${b}-`}${c.map((w) => `${w}-`).join("")}${s ? `${s}-` : ""}${a}-${v}`;
2019
- return ce ? m : Ne.getIdentity(m);
2044
+ function a(o, v, g, b, i) {
2045
+ const f = D[g], m = `${b === "normal" ? "" : `${b}-`}${f.map((w) => `${w}-`).join("")}${i ? `${i}-` : ""}${o}-${v}`;
2046
+ return fe ? m : Ve.getIdentity(m);
2020
2047
  }
2021
- const f = "crono-styles";
2048
+ const c = "crono-styles";
2022
2049
  function y() {
2023
- let a = document.getElementById(f);
2024
- return a || (a = document.createElement("style"), a.setAttribute("id", f), a.setAttribute("type", "text/css"), document.head.insertBefore(a, document.head.firstChild)), a;
2050
+ let o = document.getElementById(c);
2051
+ return o || (o = document.createElement("style"), o.setAttribute("id", c), o.setAttribute("type", "text/css"), document.head.insertBefore(o, document.head.firstChild)), o;
2025
2052
  }
2026
2053
  })(S || (S = {}));
2027
- var ae;
2054
+ var le;
2028
2055
  ((e) => {
2029
2056
  e.flush = S.flush, e.clear = S.clear;
2030
- })(ae || (ae = {}));
2031
- var Y;
2032
- ((e) => {
2033
- function t(r, l, i) {
2034
- return N.setUserVariables(r), Object.entries(l).forEach(([n, d]) => {
2035
- E[n] = d;
2036
- }), Object.entries(i).forEach(([n, d]) => {
2037
- const o = E[n];
2038
- E[n] = o ? [...d, ...o] : d;
2039
- }), { extendedProps: l, extendedPropTypes: i };
2040
- }
2041
- e.extend = t;
2042
- })(Y || (Y = {}));
2043
- const je = Y;
2044
- function G(e) {
2045
- const { children: t, theme: r } = e, [l, i] = ne(r), n = L(() => {
2046
- var a;
2047
- const d = (a = G.userThemes) == null ? void 0 : a[l];
2048
- if (!d) return R;
2049
- const { components: o, ...f } = d, y = o ?? {};
2050
- return Object.entries(f).forEach(([v, g]) => {
2051
- y[v] = g;
2052
- }), Object.keys(y).forEach((v) => {
2053
- y[v].clean && v in R && delete R[v];
2054
- }), C.mergeDeep(R, y);
2055
- }, [l]);
2056
- return /* @__PURE__ */ ge(P.Provider, { value: { themeStyles: n, theme: l, setTheme: i }, children: t });
2057
+ })(le || (le = {}));
2058
+ const M = ye.createContext({ theme: "", setTheme: () => {
2059
+ } });
2060
+ function X(e) {
2061
+ const { children: t, theme: r, use: l = "local" } = e, [s, n] = ue(r);
2062
+ return ie(() => {
2063
+ if (l === "local") return;
2064
+ const d = document.documentElement;
2065
+ return d.classList.add(s), () => {
2066
+ d.classList.remove(s);
2067
+ };
2068
+ }, [s]), l === "local" ? /* @__PURE__ */ G(M.Provider, { value: { theme: s, setTheme: n }, children: /* @__PURE__ */ G(pe, { className: s, children: t }) }) : /* @__PURE__ */ G(M.Provider, { value: { theme: s, setTheme: n }, children: t });
2057
2069
  }
2058
2070
  ((e) => {
2059
- e.userThemes = void 0;
2060
- function t(l) {
2061
- e.userThemes = l;
2062
- }
2063
- e.setup = t;
2064
- function r() {
2065
- const { theme: l, setTheme: i } = se(P);
2066
- return [l, i];
2071
+ function t() {
2072
+ const { theme: r, setTheme: l } = ge(M);
2073
+ return [r, l];
2067
2074
  }
2068
- e.useTheme = r;
2069
- })(G || (G = {}));
2070
- const Oe = G, Ce = {
2075
+ e.useTheme = t;
2076
+ })(X || (X = {}));
2077
+ const _e = X, Ee = {
2071
2078
  selected: "aria-selected"
2072
2079
  };
2073
- var J;
2080
+ var Y;
2074
2081
  ((e) => {
2075
- function t(r, l, i) {
2076
- r !== void 0 && r != null && (i[Ce[l] ?? l] = Array.isArray(r) ? r[0] : r);
2082
+ function t(r, l, s) {
2083
+ r !== void 0 && r != null && (s[Ee[l] ?? l] = Array.isArray(r) ? r[0] : r);
2077
2084
  }
2078
2085
  e.assignBooleanProp = t;
2079
- })(J || (J = {}));
2080
- const Ae = J;
2086
+ })(Y || (Y = {}));
2087
+ const Re = Y;
2081
2088
  Array.prototype.removeBy || (Array.prototype.removeBy = function(e) {
2082
2089
  return this.filter(e);
2083
2090
  });
2084
- function Se(e = null) {
2085
- const [t, r] = ne(!1), l = ye(null);
2086
- return ie(() => {
2087
- function i(d) {
2088
- const o = e ?? l.current;
2089
- (o == null ? void 0 : o.contains(d.target)) === !1 && r(!1);
2091
+ function ke(e = null) {
2092
+ const [t, r] = ue(!1), l = he(null);
2093
+ return ne(() => {
2094
+ function s(d) {
2095
+ const a = e ?? l.current;
2096
+ (a == null ? void 0 : a.contains(d.target)) === !1 && r(!1);
2090
2097
  }
2091
2098
  function n(d) {
2092
2099
  d.key === "Escape" && r(!1);
2093
2100
  }
2094
- return t && (window.addEventListener("click", i), window.addEventListener("keydown", n)), () => {
2095
- window.removeEventListener("click", i), window.removeEventListener("keydown", n);
2101
+ return t && (window.addEventListener("click", s), window.addEventListener("keydown", n)), () => {
2102
+ window.removeEventListener("click", s), window.removeEventListener("keydown", n);
2096
2103
  };
2097
2104
  }, [e, t]), [t, r, l];
2098
2105
  }
2099
- function Te() {
2100
- return L(() => {
2106
+ function Ie() {
2107
+ return Q(() => {
2101
2108
  const e = "crono-box";
2102
2109
  let t = document.getElementById(e);
2103
2110
  return t || (t = document.createElement("div"), t.id = e, document.body.appendChild(t)), t;
2104
2111
  }, []);
2105
2112
  }
2106
- var Q;
2113
+ var J;
2107
2114
  ((e) => {
2108
2115
  function t(l) {
2109
- const i = Array.from(l.elements).reduce(
2116
+ const s = Array.from(l.elements).reduce(
2110
2117
  (n, d) => {
2111
- const o = d.name;
2112
- return o && (n[o] || (n[o] = []), n[o].push(d)), n;
2118
+ const a = d.name;
2119
+ return a && (n[a] || (n[a] = []), n[a].push(d)), n;
2113
2120
  },
2114
2121
  {}
2115
2122
  );
2116
- return Object.entries(i).reduce((n, [d, o]) => {
2117
- if (o.length === 1) {
2118
- const f = o[0];
2119
- r(n, d, f.type === "checkbox" || f.type === "radio" ? f.checked : f.value);
2123
+ return Object.entries(s).reduce((n, [d, a]) => {
2124
+ if (a.length === 1) {
2125
+ const c = a[0];
2126
+ r(n, d, c.type === "checkbox" || c.type === "radio" ? c.checked : c.value);
2120
2127
  } else {
2121
- const f = o.reduce((y, a) => (a.type === "checkbox" || a.type === "radio" ? a.checked && y.push(a.value) : y.push(a.value), y), []);
2122
- r(n, d, f);
2128
+ const c = a.reduce((y, o) => (o.type === "checkbox" || o.type === "radio" ? o.checked && y.push(o.value) : y.push(o.value), y), []);
2129
+ r(n, d, c);
2123
2130
  }
2124
2131
  return n;
2125
2132
  }, {});
2126
2133
  }
2127
2134
  e.getFormEntries = t;
2128
- function r(l, i, n) {
2129
- if (i.includes(".")) {
2130
- const d = i.split(".");
2131
- let o = l;
2132
- d.forEach((f, y) => {
2135
+ function r(l, s, n) {
2136
+ if (s.includes(".")) {
2137
+ const d = s.split(".");
2138
+ let a = l;
2139
+ d.forEach((c, y) => {
2133
2140
  if (d.length > y + 1) {
2134
- const a = f.match(/^(.+)\[(\d)\]$/);
2135
- if (a) {
2136
- const [, v, g] = a;
2137
- o[v] = o[v] || [], o[v][g] = o[v][g] || {}, o = o[v][g];
2141
+ const o = c.match(/^(.+)\[(\d)\]$/);
2142
+ if (o) {
2143
+ const [, v, g] = o;
2144
+ a[v] = a[v] || [], a[v][g] = a[v][g] || {}, a = a[v][g];
2138
2145
  } else
2139
- o[f] = o[f] || {}, o = o[f];
2146
+ a[c] = a[c] || {}, a = a[c];
2140
2147
  } else
2141
- o[f] = n;
2148
+ a[c] = n;
2142
2149
  });
2143
2150
  } else
2144
- l[i] = n;
2151
+ l[s] = n;
2145
2152
  }
2146
- })(Q || (Q = {}));
2147
- const _e = Q;
2153
+ })(J || (J = {}));
2154
+ const Be = J;
2148
2155
  export {
2149
- je as B,
2150
- _e as F,
2151
- C as O,
2152
- ae as S,
2153
- Oe as T,
2156
+ Ce as B,
2157
+ Be as F,
2158
+ $ as O,
2159
+ le as S,
2160
+ _e as T,
2154
2161
  N as V,
2155
- Ae as a,
2156
- Se as b,
2157
- he as c,
2158
- Te as d,
2159
- Ee as u
2162
+ Re as a,
2163
+ ke as b,
2164
+ we as c,
2165
+ Ie as d,
2166
+ Te as u
2160
2167
  };