@cronocode/react-box 3.0.5 → 3.0.7

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,18 +1,18 @@
1
1
  import { useMemo as Q, useLayoutEffect as ce, useEffect as le, useState as fe, useRef as me } from "react";
2
2
  function ve(...e) {
3
- 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(([l, d]) => {
4
- d && t.push(l);
3
+ 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(([l, u]) => {
4
+ u && t.push(l);
5
5
  }), t) : t, []);
6
6
  }
7
7
  var n;
8
8
  ((e) => {
9
9
  ((t) => {
10
- function r(d, s) {
11
- return `${d}${s.replace("/", "-")}`;
10
+ function r(u, s) {
11
+ return `${u}${s.replace("/", "-")}`;
12
12
  }
13
13
  t.fraction = r;
14
- function l(d) {
15
- return [`${d} path`, `${d} circle`, `${d} rect`, `${d} line`];
14
+ function l(u) {
15
+ return [`${u} path`, `${u} circle`, `${u} rect`, `${u} line`];
16
16
  }
17
17
  t.svg = l;
18
18
  })(e.ClassName || (e.ClassName = {})), ((t) => {
@@ -24,11 +24,11 @@ var n;
24
24
  return `${b}px`;
25
25
  }
26
26
  t.px = l;
27
- function d(b, i) {
27
+ function u(b, i) {
28
28
  const [m, c] = i.split("/");
29
29
  return `${+m / +c * 100}%`;
30
30
  }
31
- t.fraction = d;
31
+ t.fraction = u;
32
32
  function s(b, i) {
33
33
  switch (i) {
34
34
  case "fit":
@@ -40,26 +40,26 @@ var n;
40
40
  }
41
41
  }
42
42
  t.widthHeight = s;
43
- function f(b) {
43
+ function d(b) {
44
44
  return (i, m) => `var(--${b}${m});`;
45
45
  }
46
- t.variables = f;
47
- function a(b) {
46
+ t.variables = d;
47
+ function o(b) {
48
48
  return (i, m) => `var(--${b}${m});`;
49
49
  }
50
- t.svgVariables = a;
51
- function u(b, i) {
50
+ t.svgVariables = o;
51
+ function f(b, i) {
52
52
  return `repeat(${i},minmax(0,1fr))`;
53
53
  }
54
- t.gridColumns = u;
54
+ t.gridColumns = f;
55
55
  function y(b, i) {
56
56
  return i === "full-row" ? "1/-1" : `span ${i}/span ${i}`;
57
57
  }
58
58
  t.gridColumn = y;
59
- function o(b, i) {
59
+ function a(b, i) {
60
60
  return `${i}ms`;
61
61
  }
62
- t.ms = o;
62
+ t.ms = a;
63
63
  function v(b, i) {
64
64
  return `${i}deg`;
65
65
  }
@@ -269,7 +269,6 @@ var W;
269
269
  "indigo-900": "#312e81",
270
270
  "indigo-950": "#1e1b4b",
271
271
  "violet-50": "#f5f3ff",
272
- "violet-XX": "#9747FF",
273
272
  "violet-100": "#ede9fe",
274
273
  "violet-200": "#ddd6fe",
275
274
  "violet-300": "#c4b5fd",
@@ -334,20 +333,20 @@ var W;
334
333
  "bg-img-radio": `url("data:image/svg+xml,${encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' width='100%' viewBox='0 0 20 20'><circle fill='#FFF' cx='10' cy='10' r='5'/></svg>")}")`
335
334
  }, r = {};
336
335
  let l = {};
337
- function d(a) {
338
- 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})`;
336
+ function u(o) {
337
+ 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})`;
339
338
  }
340
- e.getVariableValue = d;
339
+ e.getVariableValue = u;
341
340
  function s() {
342
- return Object.entries(r).map(([a, u]) => `--${a}: ${u};`).join("");
341
+ return Object.entries(r).map(([o, f]) => `--${o}: ${f};`).join("");
343
342
  }
344
343
  e.generateVariables = s;
345
- function f(a) {
346
- l = a;
344
+ function d(o) {
345
+ l = o;
347
346
  }
348
- e.setUserVariables = f;
347
+ e.setUserVariables = d;
349
348
  })(W || (W = {}));
350
- const z = W, E = {
349
+ const N = W, E = {
351
350
  /** The appearance CSS property is used to display UI elements with platform-specific styling, based on the operating system's theme. */
352
351
  appearance: [
353
352
  {
@@ -1470,31 +1469,43 @@ const z = W, E = {
1470
1469
  ],
1471
1470
  color: [
1472
1471
  {
1473
- values: Object.keys(z.colors),
1472
+ values: Object.keys(N.colors),
1474
1473
  valueFormat: (e, t) => t(e)
1475
1474
  }
1476
1475
  ],
1477
1476
  bgColor: [
1478
1477
  {
1479
- values: Object.keys(z.colors),
1478
+ values: Object.keys(N.colors),
1480
1479
  valueFormat: (e, t) => t(e),
1481
1480
  styleName: "background-color"
1482
1481
  }
1483
1482
  ],
1484
1483
  borderColor: [
1485
1484
  {
1486
- values: Object.keys(z.colors),
1485
+ values: Object.keys(N.colors),
1487
1486
  valueFormat: (e, t) => t(e),
1488
1487
  styleName: "border-color"
1489
1488
  }
1490
1489
  ],
1491
1490
  outlineColor: [
1492
1491
  {
1493
- values: Object.keys(z.colors),
1492
+ values: Object.keys(N.colors),
1494
1493
  valueFormat: (e, t) => t(e),
1495
1494
  styleName: "outline-color"
1496
1495
  }
1497
1496
  ],
1497
+ fill: [
1498
+ {
1499
+ values: Object.keys(N.colors),
1500
+ valueFormat: (e, t) => t(e)
1501
+ }
1502
+ ],
1503
+ stroke: [
1504
+ {
1505
+ values: Object.keys(N.colors),
1506
+ valueFormat: (e, t) => t(e)
1507
+ }
1508
+ ],
1498
1509
  bgImage: [
1499
1510
  {
1500
1511
  values: ["none", "bg-img-checked", "bg-img-indeterminate", "bg-img-radio"],
@@ -1515,19 +1526,20 @@ const z = W, E = {
1515
1526
  hasChecked: ":has(:checked)",
1516
1527
  hasRequired: ":has(:required)",
1517
1528
  hasDisabled: ":has([disabled])"
1518
- }, L = {
1529
+ }, U = {
1519
1530
  indeterminate: ":indeterminate",
1520
1531
  checked: ":checked",
1521
1532
  required: ":required",
1522
- disabled: "[disabled]"
1523
- }, Z = { ...se, ...L }, ie = Object.entries(Z).reduce(
1533
+ disabled: "[disabled]",
1534
+ selected: '[aria-selected="true"]'
1535
+ }, Z = { ...se, ...U }, ie = Object.entries(Z).reduce(
1524
1536
  (e, [t], r) => (e[t] = Math.pow(2, r), e),
1525
1537
  {}
1526
1538
  ), D = Object.entries(Z).reduce(
1527
1539
  (e, [t]) => {
1528
1540
  const r = ie[t];
1529
- return Object.entries(e).forEach(([l, d]) => {
1530
- e[+l + r] = [...d, t];
1541
+ return Object.entries(e).forEach(([l, u]) => {
1542
+ e[+l + r] = [...u, t];
1531
1543
  }), e;
1532
1544
  },
1533
1545
  { 0: [] }
@@ -1545,13 +1557,13 @@ const z = W, E = {
1545
1557
  };
1546
1558
  var q;
1547
1559
  ((e) => {
1548
- function t(s, f, a) {
1549
- const u = { ...s }, y = u.props || {};
1550
- return f.forEach((o) => {
1551
- o in u && (y[o] = u[o], delete u[o]);
1552
- }), a && Object.entries(a).forEach(([o, v]) => {
1553
- y[o] = v;
1554
- }), u.props = y, u;
1560
+ function t(s, d, o) {
1561
+ const f = { ...s }, y = f.props || {};
1562
+ return d.forEach((a) => {
1563
+ a in f && (y[a] = f[a], delete f[a]);
1564
+ }), o && Object.entries(o).forEach(([a, v]) => {
1565
+ y[a] = v;
1566
+ }), f.props = y, f;
1555
1567
  }
1556
1568
  e.buildProps = t;
1557
1569
  function r(s) {
@@ -1559,18 +1571,18 @@ var q;
1559
1571
  }
1560
1572
  e.isObject = r;
1561
1573
  function l(...s) {
1562
- return s.reduce((f, a) => (Object.keys(a ?? {}).forEach((u) => {
1563
- const y = f[u], o = a[u];
1564
- u in L && typeof o == "boolean" || (u in L && Array.isArray(o) ? f[u] = l(y, o[1] ?? {}) : Array.isArray(y) && Array.isArray(o) ? f[u] = y.concat(...o) : r(y) && r(o) ? f[u] = l(y, o) : f[u] = o);
1565
- }), f), {});
1574
+ return s.reduce((d, o) => (Object.keys(o ?? {}).forEach((f) => {
1575
+ const y = d[f], a = o[f];
1576
+ 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);
1577
+ }), d), {});
1566
1578
  }
1567
1579
  e.mergeDeep = l;
1568
- function d(s, f) {
1569
- return s in f;
1580
+ function u(s, d) {
1581
+ return s in d;
1570
1582
  }
1571
- e.isKeyOf = d;
1583
+ e.isKeyOf = u;
1572
1584
  })(q || (q = {}));
1573
- const $ = q;
1585
+ const C = q;
1574
1586
  class be {
1575
1587
  constructor() {
1576
1588
  this._index = 0, this._cache = {};
@@ -1579,150 +1591,150 @@ class be {
1579
1591
  return this._cache[t] || (this._cache[t] = this.getByIndex(this._index++)), this._cache[t];
1580
1592
  }
1581
1593
  getByIndex(t) {
1582
- const { first: r, next: l } = ye, d = t - r.length;
1583
- if (d < 0)
1594
+ const { first: r, next: l } = ye, u = t - r.length;
1595
+ if (u < 0)
1584
1596
  return r[t];
1585
- const s = Math.floor(d / l.length), f = d - s * l.length;
1586
- return this.getByIndex(s) + l[f];
1597
+ const s = Math.floor(u / l.length), d = u - s * l.length;
1598
+ return this.getByIndex(s) + l[d];
1587
1599
  }
1588
1600
  }
1589
1601
  const ye = {
1590
1602
  first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
1591
1603
  next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
1592
1604
  };
1593
- var R;
1605
+ var I;
1594
1606
  ((e) => {
1595
1607
  e.components = {};
1596
- })(R || (R = {}));
1608
+ })(I || (I = {}));
1597
1609
  function ge(e) {
1598
1610
  const { clean: t, theme: r, component: l } = e;
1599
1611
  return Q(() => {
1600
- var f;
1612
+ var d;
1601
1613
  if (t) return;
1602
- const d = l == null ? void 0 : l.split(".");
1603
- if (!d) return;
1604
- const s = d.reduce((a, u, y) => {
1605
- var o, v;
1606
- return y === 0 ? (o = R.components) == null ? void 0 : o[u] : (v = a == null ? void 0 : a.children) == null ? void 0 : v[u];
1614
+ const u = l == null ? void 0 : l.split(".");
1615
+ if (!u) return;
1616
+ const s = u.reduce((o, f, y) => {
1617
+ var a, v;
1618
+ return y === 0 ? (a = I.components) == null ? void 0 : a[f] : (v = o == null ? void 0 : o.children) == null ? void 0 : v[f];
1607
1619
  }, void 0);
1608
1620
  if (s)
1609
- return r ? $.mergeDeep(s.styles, ((f = s.themes) == null ? void 0 : f[r]) ?? {}) : s.styles;
1621
+ return r ? C.mergeDeep(s.styles, ((d = s.themes) == null ? void 0 : d[r]) ?? {}) : s.styles;
1610
1622
  }, [l, t, r]);
1611
1623
  }
1612
1624
  const he = new be(), pe = typeof window < "u" && typeof window.document < "u";
1613
- var oe;
1614
- const ne = typeof process == "object" && ((oe = process.env) == null ? void 0 : oe.NODE_ENV) === "test", we = pe && !ne ? ce : le, ue = "_b", S = "_s";
1615
- function Ne(e, t) {
1616
- we(A.flush, [e]);
1625
+ var ae;
1626
+ const ne = typeof process == "object" && ((ae = process.env) == null ? void 0 : ae.NODE_ENV) === "test", we = pe && !ne ? ce : le, ue = "_b", A = "_s";
1627
+ function Fe(e, t) {
1628
+ we(S.flush, [e]);
1617
1629
  const r = ge(e);
1618
1630
  return Q(() => {
1619
- const l = [t ? S : ue], d = r ? $.mergeDeep(r, e) : e;
1620
- return A.addClassNames(d, l, []), l;
1631
+ const l = [t ? A : ue], u = r ? C.mergeDeep(r, e) : e;
1632
+ return S.addClassNames(u, l, []), l;
1621
1633
  }, [e, t, r]);
1622
1634
  }
1623
- var A;
1635
+ var S;
1624
1636
  ((e) => {
1625
1637
  let t = !0, r = {};
1626
- function l(o, v, g, b, i) {
1627
- Object.entries(o).forEach(([m, c]) => {
1628
- if ($.isKeyOf(m, E))
1629
- f(m, c, v, g, b, i);
1630
- else if ($.isKeyOf(m, se))
1638
+ function l(a, v, g, b, i) {
1639
+ Object.entries(a).forEach(([m, c]) => {
1640
+ if (C.isKeyOf(m, E))
1641
+ d(m, c, v, g, b, i);
1642
+ else if (C.isKeyOf(m, se))
1631
1643
  l(c, v, [...g, m], b, i);
1632
- else if ($.isKeyOf(m, L)) {
1644
+ else if (C.isKeyOf(m, U)) {
1633
1645
  if (Array.isArray(c)) {
1634
1646
  const [w, x] = c;
1635
1647
  l(x, v, [...g, m], b, i);
1636
1648
  }
1637
- $.isObject(c) && l(c, v, [...g, m], b, i);
1638
- } else $.isKeyOf(m, H) ? l(c, v, g, m, i) : $.isKeyOf(m, K) && (typeof c == "string" ? v.push(`${K[m]}-${c}`) : Object.entries(c).forEach(([w, x]) => {
1649
+ C.isObject(c) && l(c, v, [...g, m], b, i);
1650
+ } else C.isKeyOf(m, H) ? l(c, v, g, m, i) : C.isKeyOf(m, K) && (typeof c == "string" ? v.push(`${K[m]}-${c}`) : Object.entries(c).forEach(([w, x]) => {
1639
1651
  l(x, v, [...g, K[m]], b, w);
1640
1652
  }));
1641
1653
  });
1642
1654
  }
1643
1655
  e.addClassNames = l;
1644
- function d() {
1656
+ function u() {
1645
1657
  if (!t) return;
1646
1658
  console.debug("\x1B[36m%s\x1B[0m", "[react-box]: flush");
1647
- const o = Object.entries(E).reduce((m, [c], w) => (m[c] = w, m), {}), 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;}
1659
+ const a = Object.entries(E).reduce((m, [c], w) => (m[c] = w, m), {}), 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;}
1648
1660
  html{font-size: 16px;font-family: Arial, sans-serif;}
1649
1661
  body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
1650
1662
  a,ul{all: unset;}
1651
1663
  .${ue}{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;}
1652
- .${S}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;transition: all var(--svgTransitionTime);}.${S} path,.${S} circle,.${S} rect,.${S} line {transition: all var(--svgTransitionTime);}
1664
+ .${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);}
1653
1665
  `, g = Object.entries(r);
1654
1666
  g.sort(
1655
1667
  ([m], [c]) => (H[m] ?? 0) - (H[c] ?? 0)
1656
1668
  );
1657
1669
  const b = g.reduce(
1658
- (m, [c, w]) => (c !== "normal" && m.push(`@media(min-width: ${H[c]}px){`), Object.entries(w).forEach(([x, U]) => {
1659
- const { __parents: P, ...de } = U, ee = Object.entries(de);
1660
- ee.sort(([N], [_]) => o[N] - o[_]), ee.forEach(([N, _]) => {
1661
- _.forEach((C) => {
1670
+ (m, [c, w]) => (c !== "normal" && m.push(`@media(min-width: ${H[c]}px){`), Object.entries(w).forEach(([x, G]) => {
1671
+ const { __parents: P, ...de } = G, ee = Object.entries(de);
1672
+ ee.sort(([F], [_]) => a[F] - a[_]), ee.forEach(([F, _]) => {
1673
+ _.forEach((V) => {
1662
1674
  var B, k;
1663
- const h = E[N].find((F) => Array.isArray(F.values) ? F.values.includes(C) : typeof C == typeof F.values);
1675
+ const h = E[F].find(($) => Array.isArray($.values) ? $.values.includes(V) : typeof V == typeof $.values);
1664
1676
  if (!h) return;
1665
- const V = a(N, C, +x, c), G = D[+x].map((F) => Z[F]).join(""), p = ((B = h.selector) == null ? void 0 : B.call(h, `.${V}`, G)) ?? `.${V}${G}`, I = Array.isArray(h.styleName) ? h.styleName : [h.styleName ?? N], O = ((k = h.valueFormat) == null ? void 0 : k.call(h, C, z.getVariableValue)) ?? C;
1666
- m.push(`${p}{${I.map((F) => `${F}:${O}`).join(";")}}`);
1677
+ const z = o(F, V, +x, c), L = D[+x].map(($) => Z[$]).join(""), p = ((B = h.selector) == null ? void 0 : B.call(h, `.${z}`, L)) ?? `.${z}${L}`, T = Array.isArray(h.styleName) ? h.styleName : [h.styleName ?? F], O = ((k = h.valueFormat) == null ? void 0 : k.call(h, V, N.getVariableValue)) ?? V;
1678
+ m.push(`${p}{${T.map(($) => `${$}:${O}`).join(";")}}`);
1667
1679
  });
1668
- }), P && Object.entries(P).forEach(([N, _]) => {
1669
- const C = Object.entries(_);
1670
- C.sort(([j], [h]) => o[j] - o[h]), C.forEach(([j, h]) => {
1671
- h.forEach((V) => {
1680
+ }), P && Object.entries(P).forEach(([F, _]) => {
1681
+ const V = Object.entries(_);
1682
+ V.sort(([j], [h]) => a[j] - a[h]), V.forEach(([j, h]) => {
1683
+ h.forEach((z) => {
1672
1684
  var te, re;
1673
- const p = E[j].find((T) => Array.isArray(T.values) ? T.values.includes(V) : typeof V == typeof T.values);
1685
+ const p = E[j].find((R) => Array.isArray(R.values) ? R.values.includes(z) : typeof z == typeof R.values);
1674
1686
  if (!p) return;
1675
- const I = a(j, V, +x, c, N), [O] = D[+x], B = ((te = p.selector) == null ? void 0 : te.call(p, `.${O}-${N}:${O} .${I}`, "")) ?? `.${O}-${N}:${O} .${I}`, k = Array.isArray(p.styleName) ? p.styleName : [p.styleName ?? j], F = ((re = p.valueFormat) == null ? void 0 : re.call(p, V, z.getVariableValue)) ?? V;
1676
- m.push(`${B}{${k.map((T) => `${T}:${F}`).join(";")}}`);
1687
+ const T = o(j, z, +x, c, F), [O] = D[+x], B = ((te = p.selector) == null ? void 0 : te.call(p, `.${O}-${F}:${O} .${T}`, "")) ?? `.${O}-${F}:${O} .${T}`, k = Array.isArray(p.styleName) ? p.styleName : [p.styleName ?? j], $ = ((re = p.valueFormat) == null ? void 0 : re.call(p, z, N.getVariableValue)) ?? z;
1688
+ m.push(`${B}{${k.map((R) => `${R}:${$}`).join(";")}}`);
1677
1689
  });
1678
1690
  });
1679
1691
  });
1680
1692
  }), c !== "normal" && m.push("}"), m),
1681
1693
  [v]
1682
1694
  );
1683
- b.unshift(`:root{${z.generateVariables()}}`);
1695
+ b.unshift(`:root{${N.generateVariables()}}`);
1684
1696
  const i = y();
1685
1697
  i.innerHTML = b.join(""), t = !1;
1686
1698
  }
1687
- e.flush = d;
1699
+ e.flush = u;
1688
1700
  function s() {
1689
1701
  r = {};
1690
1702
  }
1691
1703
  e.clear = s;
1692
- function f(o, v, g, b, i = "normal", m) {
1704
+ function d(a, v, g, b, i = "normal", m) {
1693
1705
  if (v == null) return;
1694
- const c = b.reduce((x, U) => x + ie[U], 0);
1695
- r[i] ? r[i][c] ? r[i][c][o] || (r[i][c][o] = /* @__PURE__ */ new Set()) : r[i][c] = { [o]: /* @__PURE__ */ new Set() } : r[i] = { [c]: { [o]: /* @__PURE__ */ new Set() } }, m ? (r[i][c].__parents ? r[i][c].__parents[m] ? r[i][c].__parents[m][o] || (r[i][c].__parents[m][o] = /* @__PURE__ */ new Set()) : r[i][c].__parents[m] = { [o]: /* @__PURE__ */ new Set() } : r[i][c].__parents = { [m]: { [o]: /* @__PURE__ */ new Set() } }, r[i][c].__parents[m][o].has(v) || (r[i][c].__parents[m][o].add(v), t = !0)) : r[i][c][o].has(v) || (r[i][c][o].add(v), t = !0);
1696
- const w = a(o, v, c, i, m);
1706
+ const c = b.reduce((x, G) => x + ie[G], 0);
1707
+ r[i] ? r[i][c] ? r[i][c][a] || (r[i][c][a] = /* @__PURE__ */ new Set()) : r[i][c] = { [a]: /* @__PURE__ */ new Set() } : r[i] = { [c]: { [a]: /* @__PURE__ */ new Set() } }, m ? (r[i][c].__parents ? r[i][c].__parents[m] ? r[i][c].__parents[m][a] || (r[i][c].__parents[m][a] = /* @__PURE__ */ new Set()) : r[i][c].__parents[m] = { [a]: /* @__PURE__ */ new Set() } : r[i][c].__parents = { [m]: { [a]: /* @__PURE__ */ new Set() } }, r[i][c].__parents[m][a].has(v) || (r[i][c].__parents[m][a].add(v), t = !0)) : r[i][c][a].has(v) || (r[i][c][a].add(v), t = !0);
1708
+ const w = o(a, v, c, i, m);
1697
1709
  g.push(w);
1698
1710
  }
1699
- function a(o, v, g, b, i) {
1700
- const m = D[g], c = `${b === "normal" ? "" : `${b}-`}${m.map((w) => `${w}-`).join("")}${i ? `${i}-` : ""}${o}-${v}`;
1711
+ function o(a, v, g, b, i) {
1712
+ const m = D[g], c = `${b === "normal" ? "" : `${b}-`}${m.map((w) => `${w}-`).join("")}${i ? `${i}-` : ""}${a}-${v}`;
1701
1713
  return ne ? c : he.getIdentity(c);
1702
1714
  }
1703
- const u = "crono-styles";
1715
+ const f = "crono-styles";
1704
1716
  function y() {
1705
- let o = document.getElementById(u);
1706
- return o || (o = document.createElement("style"), o.setAttribute("id", u), o.setAttribute("type", "text/css"), document.head.insertBefore(o, document.head.firstChild)), o;
1717
+ let a = document.getElementById(f);
1718
+ return a || (a = document.createElement("style"), a.setAttribute("id", f), a.setAttribute("type", "text/css"), document.head.insertBefore(a, document.head.firstChild)), a;
1707
1719
  }
1708
- })(A || (A = {}));
1709
- var ae;
1720
+ })(S || (S = {}));
1721
+ var oe;
1710
1722
  ((e) => {
1711
- e.flush = A.flush, e.clear = A.clear;
1712
- })(ae || (ae = {}));
1723
+ e.flush = S.flush, e.clear = S.clear;
1724
+ })(oe || (oe = {}));
1713
1725
  var M;
1714
1726
  ((e) => {
1715
- function t(r, l, d) {
1716
- return z.setUserVariables(r), Object.entries(l).forEach(([s, f]) => {
1717
- E[s] = f;
1718
- }), Object.entries(d).forEach(([s, f]) => {
1719
- const a = E[s];
1720
- E[s] = a ? [...f, ...a] : f;
1721
- }), { extendedProps: l, extendedPropTypes: d };
1727
+ function t(r, l, u) {
1728
+ return N.setUserVariables(r), Object.entries(l).forEach(([s, d]) => {
1729
+ E[s] = d;
1730
+ }), Object.entries(u).forEach(([s, d]) => {
1731
+ const o = E[s];
1732
+ E[s] = o ? [...d, ...o] : d;
1733
+ }), { extendedProps: l, extendedPropTypes: u };
1722
1734
  }
1723
1735
  e.extend = t;
1724
1736
  })(M || (M = {}));
1725
- const Fe = M;
1737
+ const $e = M;
1726
1738
  var X;
1727
1739
  ((e) => {
1728
1740
  const t = {
@@ -1737,6 +1749,7 @@ var X;
1737
1749
  b: 1,
1738
1750
  borderRadius: 1,
1739
1751
  userSelect: "none",
1752
+ lineHeight: 20,
1740
1753
  hover: {
1741
1754
  bgColor: "violet-600",
1742
1755
  borderColor: "violet-600"
@@ -1759,6 +1772,7 @@ var X;
1759
1772
  borderRadius: 1,
1760
1773
  p: 3,
1761
1774
  transition: "none",
1775
+ lineHeight: 20,
1762
1776
  hover: {
1763
1777
  borderColor: "violet-300"
1764
1778
  },
@@ -1902,6 +1916,9 @@ var X;
1902
1916
  children: {
1903
1917
  items: {
1904
1918
  styles: {
1919
+ display: "flex",
1920
+ d: "column",
1921
+ gap: 1,
1905
1922
  p: 1,
1906
1923
  b: 1,
1907
1924
  borderRadius: 1,
@@ -1915,6 +1932,35 @@ var X;
1915
1932
  }
1916
1933
  },
1917
1934
  item: {
1935
+ styles: {
1936
+ display: "flex",
1937
+ width: "fit",
1938
+ p: 3,
1939
+ cursor: "pointer",
1940
+ borderRadius: 1,
1941
+ hover: {
1942
+ bgColor: "gray-100"
1943
+ },
1944
+ focus: {
1945
+ bgColor: "violet-50"
1946
+ },
1947
+ selected: {
1948
+ bgColor: "violet-50",
1949
+ cursor: "default",
1950
+ hover: {
1951
+ bgColor: "violet-100"
1952
+ }
1953
+ }
1954
+ },
1955
+ themes: {
1956
+ multiple: {
1957
+ selected: {
1958
+ cursor: "pointer"
1959
+ }
1960
+ }
1961
+ }
1962
+ },
1963
+ unselectItem: {
1918
1964
  styles: {
1919
1965
  display: "flex",
1920
1966
  width: "fit",
@@ -1922,111 +1968,129 @@ var X;
1922
1968
  cursor: "pointer",
1923
1969
  lineHeight: 20,
1924
1970
  borderRadius: 1,
1971
+ color: "violet-400",
1925
1972
  hover: {
1926
1973
  bgColor: "violet-50"
1927
1974
  },
1928
1975
  focus: {
1929
1976
  bgColor: "violet-50"
1977
+ },
1978
+ selected: {
1979
+ bgColor: "violet-50",
1980
+ cursor: "default"
1930
1981
  }
1931
1982
  }
1983
+ },
1984
+ emptyItem: {
1985
+ styles: {
1986
+ display: "flex",
1987
+ width: "fit",
1988
+ p: 3,
1989
+ cursor: "default",
1990
+ lineHeight: 20,
1991
+ borderRadius: 1,
1992
+ color: "violet-400"
1993
+ }
1932
1994
  }
1933
1995
  }
1934
1996
  }
1935
1997
  };
1936
1998
  function r(l) {
1937
- const { components: d, ...s } = l, f = d ?? {};
1938
- Object.entries(s).forEach(([a, u]) => {
1939
- f[a] = u;
1940
- }), R.components = $.mergeDeep(t, f);
1999
+ const { components: u, ...s } = l, d = u ?? {};
2000
+ Object.entries(s).forEach(([o, f]) => {
2001
+ d[o] = f;
2002
+ }), I.components = C.mergeDeep(t, d);
1941
2003
  }
1942
- e.setup = r, R.components = { ...t };
2004
+ e.setup = r, I.components = { ...t };
1943
2005
  })(X || (X = {}));
1944
- const $e = X;
2006
+ const Ce = X, xe = {
2007
+ selected: "aria-selected"
2008
+ };
1945
2009
  var Y;
1946
2010
  ((e) => {
1947
- function t(r, l, d) {
1948
- r !== void 0 && r != null && (d[l] = Array.isArray(r) ? r[0] : r);
2011
+ function t(r, l, u) {
2012
+ r !== void 0 && r != null && (u[xe[l] ?? l] = Array.isArray(r) ? r[0] : r);
1949
2013
  }
1950
2014
  e.assignBooleanProp = t;
1951
2015
  })(Y || (Y = {}));
1952
- const Ce = Y;
1953
- function Ve() {
1954
- return Q(() => {
1955
- const e = "crono-box";
1956
- let t = document.getElementById(e);
1957
- return t || (t = document.createElement("div"), t.id = e, document.body.appendChild(t)), t;
1958
- }, []);
1959
- }
2016
+ const Ve = Y;
2017
+ Array.prototype.removeBy || (Array.prototype.removeBy = function(e) {
2018
+ return this.filter(e);
2019
+ });
1960
2020
  function ze(e = null) {
1961
2021
  const [t, r] = fe(!1), l = me(null);
1962
2022
  return le(() => {
1963
- function d(a) {
1964
- const u = e ?? l.current;
1965
- (u == null ? void 0 : u.contains(a.target)) === !1 && r(!1);
1966
- }
1967
- function s() {
1968
- r(!1);
2023
+ function u(d) {
2024
+ const o = e ?? l.current;
2025
+ (o == null ? void 0 : o.contains(d.target)) === !1 && r(!1);
1969
2026
  }
1970
- function f(a) {
1971
- a.key === "Escape" && r(!1);
2027
+ function s(d) {
2028
+ d.key === "Escape" && r(!1);
1972
2029
  }
1973
- return t && (window.addEventListener("mousedown", d), window.addEventListener("resize", s), window.addEventListener("keydown", f)), () => {
1974
- window.removeEventListener("mousedown", d), window.removeEventListener("resize", s), window.removeEventListener("keydown", f);
2030
+ return t && (window.addEventListener("mousedown", u), window.addEventListener("keydown", s)), () => {
2031
+ window.removeEventListener("mousedown", u), window.removeEventListener("keydown", s);
1975
2032
  };
1976
2033
  }, [e, t]), [t, r, l];
1977
2034
  }
2035
+ function Ee() {
2036
+ return Q(() => {
2037
+ const e = "crono-box";
2038
+ let t = document.getElementById(e);
2039
+ return t || (t = document.createElement("div"), t.id = e, document.body.appendChild(t)), t;
2040
+ }, []);
2041
+ }
1978
2042
  var J;
1979
2043
  ((e) => {
1980
2044
  function t(l) {
1981
- const d = Array.from(l.elements).reduce(
1982
- (s, f) => {
1983
- const a = f.name;
1984
- return a && (s[a] || (s[a] = []), s[a].push(f)), s;
2045
+ const u = Array.from(l.elements).reduce(
2046
+ (s, d) => {
2047
+ const o = d.name;
2048
+ return o && (s[o] || (s[o] = []), s[o].push(d)), s;
1985
2049
  },
1986
2050
  {}
1987
2051
  );
1988
- return Object.entries(d).reduce((s, [f, a]) => {
1989
- if (a.length === 1) {
1990
- const u = a[0];
1991
- r(s, f, u.type === "checkbox" || u.type === "radio" ? u.checked : u.value);
2052
+ return Object.entries(u).reduce((s, [d, o]) => {
2053
+ if (o.length === 1) {
2054
+ const f = o[0];
2055
+ r(s, d, f.type === "checkbox" || f.type === "radio" ? f.checked : f.value);
1992
2056
  } else {
1993
- const u = a.reduce((y, o) => (o.type === "checkbox" || o.type === "radio" ? o.checked && y.push(o.value) : y.push(o.value), y), []);
1994
- r(s, f, u);
2057
+ const f = o.reduce((y, a) => (a.type === "checkbox" || a.type === "radio" ? a.checked && y.push(a.value) : y.push(a.value), y), []);
2058
+ r(s, d, f);
1995
2059
  }
1996
2060
  return s;
1997
2061
  }, {});
1998
2062
  }
1999
2063
  e.getFormEntries = t;
2000
- function r(l, d, s) {
2001
- if (d.includes(".")) {
2002
- const f = d.split(".");
2003
- let a = l;
2004
- f.forEach((u, y) => {
2005
- if (f.length > y + 1) {
2006
- const o = u.match(/^(.+)\[(\d)\]$/);
2007
- if (o) {
2008
- const [, v, g] = o;
2009
- a[v] = a[v] || [], a[v][g] = a[v][g] || {}, a = a[v][g];
2064
+ function r(l, u, s) {
2065
+ if (u.includes(".")) {
2066
+ const d = u.split(".");
2067
+ let o = l;
2068
+ d.forEach((f, y) => {
2069
+ if (d.length > y + 1) {
2070
+ const a = f.match(/^(.+)\[(\d)\]$/);
2071
+ if (a) {
2072
+ const [, v, g] = a;
2073
+ o[v] = o[v] || [], o[v][g] = o[v][g] || {}, o = o[v][g];
2010
2074
  } else
2011
- a[u] = a[u] || {}, a = a[u];
2075
+ o[f] = o[f] || {}, o = o[f];
2012
2076
  } else
2013
- a[u] = s;
2077
+ o[f] = s;
2014
2078
  });
2015
2079
  } else
2016
- l[d] = s;
2080
+ l[u] = s;
2017
2081
  }
2018
2082
  })(J || (J = {}));
2019
- const Ee = J;
2083
+ const je = J;
2020
2084
  export {
2021
- Fe as B,
2022
- Ee as F,
2023
- $ as O,
2024
- ae as S,
2025
- $e as T,
2026
- z as V,
2027
- Ce as a,
2085
+ $e as B,
2086
+ je as F,
2087
+ C as O,
2088
+ oe as S,
2089
+ Ce as T,
2090
+ N as V,
2091
+ Ve as a,
2028
2092
  ze as b,
2029
2093
  ve as c,
2030
- Ve as d,
2031
- Ne as u
2094
+ Ee as d,
2095
+ Fe as u
2032
2096
  };