@cronocode/react-box 3.0.3 → 3.0.5

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,81 +1,84 @@
1
- import { useMemo as J, useLayoutEffect as ue, useEffect as fe } from "react";
2
- function ce(...e) {
3
- return e.reduce((t, a) => a ? typeof a == "string" ? (t.push(a), t) : Array.isArray(a) ? (t.push(...ce(...a)), t) : (Object.entries(a).forEach(([u, d]) => {
4
- d && t.push(u);
1
+ import { useMemo as Q, useLayoutEffect as ce, useEffect as le, useState as fe, useRef as me } from "react";
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);
5
5
  }), t) : t, []);
6
6
  }
7
7
  var n;
8
8
  ((e) => {
9
9
  ((t) => {
10
- function a(d, s) {
10
+ function r(d, s) {
11
11
  return `${d}${s.replace("/", "-")}`;
12
12
  }
13
- t.fraction = a;
14
- function u(d) {
13
+ t.fraction = r;
14
+ function l(d) {
15
15
  return [`${d} path`, `${d} circle`, `${d} rect`, `${d} line`];
16
16
  }
17
- t.svg = u;
17
+ t.svg = l;
18
18
  })(e.ClassName || (e.ClassName = {})), ((t) => {
19
- function a(y) {
20
- return `${y / 4}rem`;
19
+ function r(b) {
20
+ return `${b / 4}rem`;
21
21
  }
22
- t.rem = a;
23
- function u(y) {
24
- return `${y}px`;
22
+ t.rem = r;
23
+ function l(b) {
24
+ return `${b}px`;
25
25
  }
26
- t.px = u;
27
- function d(y, o) {
28
- const [c, f] = o.split("/");
29
- return `${+c / +f * 100}%`;
26
+ t.px = l;
27
+ function d(b, i) {
28
+ const [m, c] = i.split("/");
29
+ return `${+m / +c * 100}%`;
30
30
  }
31
31
  t.fraction = d;
32
- function s(y, o) {
33
- switch (o) {
32
+ function s(b, i) {
33
+ switch (i) {
34
34
  case "fit":
35
35
  return "100%";
36
36
  case "fit-screen":
37
- return y.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
37
+ return b.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
38
38
  default:
39
- return o;
39
+ return i;
40
40
  }
41
41
  }
42
42
  t.widthHeight = s;
43
- function l(y) {
44
- return (o, c) => `var(--${y}${c});`;
43
+ function f(b) {
44
+ return (i, m) => `var(--${b}${m});`;
45
45
  }
46
- t.variables = l;
47
- function i(y) {
48
- return (o, c) => `var(--${y}${c});`;
46
+ t.variables = f;
47
+ function a(b) {
48
+ return (i, m) => `var(--${b}${m});`;
49
49
  }
50
- t.svgVariables = i;
51
- function m(y, o) {
52
- return `repeat(${o},minmax(0,1fr))`;
50
+ t.svgVariables = a;
51
+ function u(b, i) {
52
+ return `repeat(${i},minmax(0,1fr))`;
53
53
  }
54
- t.gridColumns = m;
55
- function b(y, o) {
56
- return o === "full-row" ? "1/-1" : `span ${o}/span ${o}`;
54
+ t.gridColumns = u;
55
+ function y(b, i) {
56
+ return i === "full-row" ? "1/-1" : `span ${i}/span ${i}`;
57
57
  }
58
- t.gridColumn = b;
59
- function r(y, o) {
60
- return `${o}ms`;
58
+ t.gridColumn = y;
59
+ function o(b, i) {
60
+ return `${i}ms`;
61
61
  }
62
- t.ms = r;
63
- function v(y, o) {
64
- return `${o}deg`;
62
+ t.ms = o;
63
+ function v(b, i) {
64
+ return `${i}deg`;
65
65
  }
66
66
  t.rotate = v;
67
- function h(y, o) {
68
- return o === "xAxis" ? "-1 1" : "1 -1";
67
+ function g(b, i) {
68
+ return i === "xAxis" ? "-1 1" : "1 -1";
69
69
  }
70
- t.flip = h;
70
+ t.flip = g;
71
71
  })(e.Value || (e.Value = {}));
72
72
  })(n || (n = {}));
73
73
  var W;
74
74
  ((e) => {
75
75
  e.colors = {
76
- inherit: "inherit",
77
- current: "currentColor",
76
+ currentColor: "currentColor",
78
77
  transparent: "transparent",
78
+ green: "green",
79
+ red: "red",
80
+ blue: "blue",
81
+ gray: "gray",
79
82
  black: "#000",
80
83
  white: "#fff",
81
84
  "slate-50": "#f8fafc",
@@ -266,6 +269,7 @@ var W;
266
269
  "indigo-900": "#312e81",
267
270
  "indigo-950": "#1e1b4b",
268
271
  "violet-50": "#f5f3ff",
272
+ "violet-XX": "#9747FF",
269
273
  "violet-100": "#ede9fe",
270
274
  "violet-200": "#ddd6fe",
271
275
  "violet-300": "#c4b5fd",
@@ -276,6 +280,7 @@ var W;
276
280
  "violet-800": "#5b21b6",
277
281
  "violet-900": "#4c1d95",
278
282
  "violet-950": "#2e1065",
283
+ vi: "#7949FF",
279
284
  "purple-50": "#faf5ff",
280
285
  "purple-100": "#f3e8ff",
281
286
  "purple-200": "#e9d5ff",
@@ -321,22 +326,28 @@ var W;
321
326
  "rose-900": "#881337",
322
327
  "rose-950": "#4c0519"
323
328
  };
324
- const t = {};
325
- let a = {};
326
- function u(l) {
327
- return l in a ? t[l] = a[l] : l in e.colors && (t[l] = e.colors[l]), `var(--${l})`;
329
+ const t = {
330
+ inherit: "inherit",
331
+ none: "none",
332
+ "bg-img-checked": `url("data:image/svg+xml,${encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' width='100%' viewBox='0 0 20 20'><path fill='none' stroke='#FFF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 10l3 3l6-6'/></svg>")}")`,
333
+ "bg-img-indeterminate": `url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' width='100%' viewBox='0 0 20 20'><line stroke='${e.colors["violet-400"]}' x1='4' y1='10' x2='16' y2='10' stroke-width='1' /></svg>`)}")`,
334
+ "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
+ }, r = {};
336
+ 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})`;
328
339
  }
329
- e.getVariableValue = u;
330
- function d() {
331
- return Object.entries(t).map(([l, i]) => `--${l}: ${i};`).join("");
340
+ e.getVariableValue = d;
341
+ function s() {
342
+ return Object.entries(r).map(([a, u]) => `--${a}: ${u};`).join("");
332
343
  }
333
- e.generateVariables = d;
334
- function s(l) {
335
- a = l;
344
+ e.generateVariables = s;
345
+ function f(a) {
346
+ l = a;
336
347
  }
337
- e.setUserVariables = s;
348
+ e.setUserVariables = f;
338
349
  })(W || (W = {}));
339
- const E = W, j = {
350
+ const z = W, E = {
340
351
  /** The appearance CSS property is used to display UI elements with platform-specific styling, based on the operating system's theme. */
341
352
  appearance: [
342
353
  {
@@ -781,8 +792,8 @@ const E = W, j = {
781
792
  "11/12"
782
793
  ],
783
794
  valueFormat: (e) => {
784
- const [t, a] = e.split("/");
785
- return `${+t / +a * 100}%`;
795
+ const [t, r] = e.split("/");
796
+ return `${+t / +r * 100}%`;
786
797
  }
787
798
  },
788
799
  {
@@ -833,8 +844,8 @@ const E = W, j = {
833
844
  "11/12"
834
845
  ],
835
846
  valueFormat: (e) => {
836
- const [t, a] = e.split("/");
837
- return `${+t / +a * 100}%`;
847
+ const [t, r] = e.split("/");
848
+ return `${+t / +r * 100}%`;
838
849
  }
839
850
  },
840
851
  {
@@ -886,8 +897,8 @@ const E = W, j = {
886
897
  "11/12"
887
898
  ],
888
899
  valueFormat: (e) => {
889
- const [t, a] = e.split("/");
890
- return `${+t / +a * 100}%`;
900
+ const [t, r] = e.split("/");
901
+ return `${+t / +r * 100}%`;
891
902
  }
892
903
  },
893
904
  {
@@ -936,8 +947,8 @@ const E = W, j = {
936
947
  "11/12"
937
948
  ],
938
949
  valueFormat: (e) => {
939
- const [t, a] = e.split("/");
940
- return `${+t / +a * 100}%`;
950
+ const [t, r] = e.split("/");
951
+ return `${+t / +r * 100}%`;
941
952
  }
942
953
  },
943
954
  {
@@ -988,8 +999,8 @@ const E = W, j = {
988
999
  "11/12"
989
1000
  ],
990
1001
  valueFormat: (e) => {
991
- const [t, a] = e.split("/");
992
- return `${+t / +a * 100}%`;
1002
+ const [t, r] = e.split("/");
1003
+ return `${+t / +r * 100}%`;
993
1004
  }
994
1005
  },
995
1006
  {
@@ -1041,8 +1052,8 @@ const E = W, j = {
1041
1052
  "11/12"
1042
1053
  ],
1043
1054
  valueFormat: (e) => {
1044
- const [t, a] = e.split("/");
1045
- return `${+t / +a * 100}%`;
1055
+ const [t, r] = e.split("/");
1056
+ return `${+t / +r * 100}%`;
1046
1057
  }
1047
1058
  },
1048
1059
  {
@@ -1459,32 +1470,39 @@ const E = W, j = {
1459
1470
  ],
1460
1471
  color: [
1461
1472
  {
1462
- values: Object.keys(E.colors),
1473
+ values: Object.keys(z.colors),
1463
1474
  valueFormat: (e, t) => t(e)
1464
1475
  }
1465
1476
  ],
1466
1477
  bgColor: [
1467
1478
  {
1468
- values: Object.keys(E.colors),
1479
+ values: Object.keys(z.colors),
1469
1480
  valueFormat: (e, t) => t(e),
1470
1481
  styleName: "background-color"
1471
1482
  }
1472
1483
  ],
1473
1484
  borderColor: [
1474
1485
  {
1475
- values: Object.keys(E.colors),
1486
+ values: Object.keys(z.colors),
1476
1487
  valueFormat: (e, t) => t(e),
1477
1488
  styleName: "border-color"
1478
1489
  }
1479
1490
  ],
1480
1491
  outlineColor: [
1481
1492
  {
1482
- values: Object.keys(E.colors),
1493
+ values: Object.keys(z.colors),
1483
1494
  valueFormat: (e, t) => t(e),
1484
1495
  styleName: "outline-color"
1485
1496
  }
1497
+ ],
1498
+ bgImage: [
1499
+ {
1500
+ values: ["none", "bg-img-checked", "bg-img-indeterminate", "bg-img-radio"],
1501
+ valueFormat: (e, t) => t(e),
1502
+ styleName: "background-image"
1503
+ }
1486
1504
  ]
1487
- }, le = {
1505
+ }, se = {
1488
1506
  hover: ":hover",
1489
1507
  focus: ":focus-within",
1490
1508
  hasFocus: ":has(:focus)",
@@ -1497,63 +1515,63 @@ const E = W, j = {
1497
1515
  hasChecked: ":has(:checked)",
1498
1516
  hasRequired: ":has(:required)",
1499
1517
  hasDisabled: ":has([disabled])"
1500
- }, D = {
1518
+ }, L = {
1501
1519
  indeterminate: ":indeterminate",
1502
1520
  checked: ":checked",
1503
1521
  required: ":required",
1504
1522
  disabled: "[disabled]"
1505
- }, Q = { ...le, ...D }, se = Object.entries(Q).reduce(
1506
- (e, [t], a) => (e[t] = Math.pow(2, a), e),
1523
+ }, Z = { ...se, ...L }, ie = Object.entries(Z).reduce(
1524
+ (e, [t], r) => (e[t] = Math.pow(2, r), e),
1507
1525
  {}
1508
- ), K = Object.entries(Q).reduce(
1526
+ ), D = Object.entries(Z).reduce(
1509
1527
  (e, [t]) => {
1510
- const a = se[t];
1511
- return Object.entries(e).forEach(([u, d]) => {
1512
- e[+u + a] = [...d, t];
1528
+ const r = ie[t];
1529
+ return Object.entries(e).forEach(([l, d]) => {
1530
+ e[+l + r] = [...d, t];
1513
1531
  }), e;
1514
1532
  },
1515
1533
  { 0: [] }
1516
- ), L = {
1534
+ ), K = {
1517
1535
  hoverGroup: "hover",
1518
1536
  focusGroup: "focus",
1519
1537
  activeGroup: "active",
1520
1538
  disabledGroup: "disabled"
1521
- }, G = {
1539
+ }, H = {
1522
1540
  sm: 640,
1523
1541
  md: 768,
1524
1542
  lg: 1024,
1525
1543
  xl: 1280,
1526
1544
  xxl: 1536
1527
1545
  };
1528
- var k;
1546
+ var q;
1529
1547
  ((e) => {
1530
- function t(s, l, i) {
1531
- const m = { ...s }, b = m.props || {};
1532
- return l.forEach((r) => {
1533
- r in m && (b[r] = m[r], delete m[r]);
1534
- }), i && Object.entries(i).forEach(([r, v]) => {
1535
- b[r] = v;
1536
- }), m.props = b, m;
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;
1537
1555
  }
1538
1556
  e.buildProps = t;
1539
- function a(s) {
1557
+ function r(s) {
1540
1558
  return !!s && typeof s == "object";
1541
1559
  }
1542
- e.isObject = a;
1543
- function u(...s) {
1544
- return s.reduce((l, i) => (Object.keys(i).forEach((m) => {
1545
- const b = l[m], r = i[m];
1546
- m in D && typeof r == "boolean" || (m in D && Array.isArray(r) ? l[m] = u(b, r[1] ?? {}) : Array.isArray(b) && Array.isArray(r) ? l[m] = b.concat(...r) : a(b) && a(r) ? l[m] = u(b, r) : l[m] = r);
1547
- }), l), {});
1560
+ e.isObject = r;
1561
+ 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), {});
1548
1566
  }
1549
- e.mergeDeep = u;
1550
- function d(s, l) {
1551
- return s in l;
1567
+ e.mergeDeep = l;
1568
+ function d(s, f) {
1569
+ return s in f;
1552
1570
  }
1553
1571
  e.isKeyOf = d;
1554
- })(k || (k = {}));
1555
- const $ = k;
1556
- class de {
1572
+ })(q || (q = {}));
1573
+ const $ = q;
1574
+ class be {
1557
1575
  constructor() {
1558
1576
  this._index = 0, this._cache = {};
1559
1577
  }
@@ -1561,134 +1579,131 @@ class de {
1561
1579
  return this._cache[t] || (this._cache[t] = this.getByIndex(this._index++)), this._cache[t];
1562
1580
  }
1563
1581
  getByIndex(t) {
1564
- const { first: a, next: u } = me, d = t - a.length;
1582
+ const { first: r, next: l } = ye, d = t - r.length;
1565
1583
  if (d < 0)
1566
- return a[t];
1567
- const s = Math.floor(d / u.length), l = d - s * u.length;
1568
- return this.getByIndex(s) + u[l];
1584
+ return r[t];
1585
+ const s = Math.floor(d / l.length), f = d - s * l.length;
1586
+ return this.getByIndex(s) + l[f];
1569
1587
  }
1570
1588
  }
1571
- const me = {
1589
+ const ye = {
1572
1590
  first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
1573
1591
  next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
1574
1592
  };
1575
- var H;
1593
+ var R;
1576
1594
  ((e) => {
1577
1595
  e.components = {};
1578
- })(H || (H = {}));
1579
- function ve(e) {
1580
- const { clean: t, theme: a, component: u } = e;
1581
- return J(() => {
1582
- var l;
1596
+ })(R || (R = {}));
1597
+ function ge(e) {
1598
+ const { clean: t, theme: r, component: l } = e;
1599
+ return Q(() => {
1600
+ var f;
1583
1601
  if (t) return;
1584
- const d = u == null ? void 0 : u.split(".");
1602
+ const d = l == null ? void 0 : l.split(".");
1585
1603
  if (!d) return;
1586
- const s = d.reduce((i, m, b) => {
1587
- var r, v;
1588
- return b === 0 ? (r = H.components) == null ? void 0 : r[m] : (v = i == null ? void 0 : i.children) == null ? void 0 : v[m];
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];
1589
1607
  }, void 0);
1590
1608
  if (s)
1591
- return a ? $.mergeDeep(s.styles, ((l = s.themes) == null ? void 0 : l[a]) ?? {}) : s.styles;
1592
- }, [u, t, a]);
1609
+ return r ? $.mergeDeep(s.styles, ((f = s.themes) == null ? void 0 : f[r]) ?? {}) : s.styles;
1610
+ }, [l, t, r]);
1593
1611
  }
1594
- const ye = new de(), be = typeof window < "u" && typeof window.document < "u";
1595
- var re;
1596
- const oe = typeof process == "object" && ((re = process.env) == null ? void 0 : re.NODE_ENV) === "test", he = be && !oe ? ue : fe, ne = "_b", S = "_s";
1597
- function ge(e, t) {
1598
- he(A.flush, [e]);
1599
- const a = ve(e);
1600
- return J(() => {
1601
- var s;
1602
- const u = [t ? S : ne];
1603
- (s = e.props) == null || s.name;
1604
- const d = a ? $.mergeDeep(a, e) : e;
1605
- return A.addClassNames(d, u, []), u;
1606
- }, [e, t, a]);
1612
+ 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]);
1617
+ const r = ge(e);
1618
+ return Q(() => {
1619
+ const l = [t ? S : ue], d = r ? $.mergeDeep(r, e) : e;
1620
+ return A.addClassNames(d, l, []), l;
1621
+ }, [e, t, r]);
1607
1622
  }
1608
1623
  var A;
1609
1624
  ((e) => {
1610
- let t = !0, a = {};
1611
- function u(r, v, h, y, o) {
1612
- Object.entries(r).forEach(([c, f]) => {
1613
- if ($.isKeyOf(c, j))
1614
- l(c, f, v, h, y, o);
1615
- else if ($.isKeyOf(c, le))
1616
- u(f, v, [...h, c], y, o);
1617
- else if ($.isKeyOf(c, D)) {
1618
- if (Array.isArray(f)) {
1619
- const [x, N] = f;
1620
- u(N, v, [...h, c], y, o);
1625
+ 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))
1631
+ l(c, v, [...g, m], b, i);
1632
+ else if ($.isKeyOf(m, L)) {
1633
+ if (Array.isArray(c)) {
1634
+ const [w, x] = c;
1635
+ l(x, v, [...g, m], b, i);
1621
1636
  }
1622
- $.isObject(f) && u(f, v, [...h, c], y, o);
1623
- } else $.isKeyOf(c, G) ? u(f, v, h, c, o) : $.isKeyOf(c, L) && (typeof f == "string" ? v.push(`${L[c]}-${f}`) : Object.entries(f).forEach(([x, N]) => {
1624
- u(N, v, [...h, L[c]], y, x);
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]) => {
1639
+ l(x, v, [...g, K[m]], b, w);
1625
1640
  }));
1626
1641
  });
1627
1642
  }
1628
- e.addClassNames = u;
1643
+ e.addClassNames = l;
1629
1644
  function d() {
1630
1645
  if (!t) return;
1631
1646
  console.debug("\x1B[36m%s\x1B[0m", "[react-box]: flush");
1632
- const r = Object.entries(j).reduce((c, [f], x) => (c[f] = x, 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;}
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;}
1633
1648
  html{font-size: 16px;font-family: Arial, sans-serif;}
1634
1649
  body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
1635
1650
  a,ul{all: unset;}
1636
- .${ne}{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;}
1651
+ .${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;}
1637
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);}
1638
- `, h = Object.entries(a);
1639
- h.sort(
1640
- ([c], [f]) => (G[c] ?? 0) - (G[f] ?? 0)
1653
+ `, g = Object.entries(r);
1654
+ g.sort(
1655
+ ([m], [c]) => (H[m] ?? 0) - (H[c] ?? 0)
1641
1656
  );
1642
- const y = h.reduce(
1643
- (c, [f, x]) => (f !== "normal" && c.push(`@media(min-width: ${G[f]}px){`), Object.entries(x).forEach(([N, U]) => {
1644
- const { __parents: Z, ...ie } = U, P = Object.entries(ie);
1645
- P.sort(([w], [T]) => r[w] - r[T]), P.forEach(([w, T]) => {
1646
- T.forEach((V) => {
1647
- var B, R;
1648
- const p = j[w].find((F) => Array.isArray(F.values) ? F.values.includes(V) : typeof V == typeof F.values);
1649
- if (!p) return;
1650
- const z = i(w, V, +N, f), q = K[+N].map((F) => Q[F]).join(""), g = ((B = p.selector) == null ? void 0 : B.call(p, `.${z}`, q)) ?? `.${z}${q}`, I = Array.isArray(p.styleName) ? p.styleName : [p.styleName ?? w], _ = ((R = p.valueFormat) == null ? void 0 : R.call(p, V, E.getVariableValue)) ?? V;
1651
- c.push(`${g}{${I.map((F) => `${F}:${_}`).join(";")}}`);
1657
+ 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) => {
1662
+ var B, k;
1663
+ const h = E[N].find((F) => Array.isArray(F.values) ? F.values.includes(C) : typeof C == typeof F.values);
1664
+ 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(";")}}`);
1652
1667
  });
1653
- }), Z && Object.entries(Z).forEach(([w, T]) => {
1654
- const V = Object.entries(T);
1655
- V.sort(([O], [p]) => r[O] - r[p]), V.forEach(([O, p]) => {
1656
- p.forEach((z) => {
1657
- var ee, te;
1658
- const g = j[O].find((C) => Array.isArray(C.values) ? C.values.includes(z) : typeof z == typeof C.values);
1659
- if (!g) return;
1660
- const I = i(O, z, +N, f, w), [_] = K[+N], B = ((ee = g.selector) == null ? void 0 : ee.call(g, `.${_}-${w}:${_} .${I}`, "")) ?? `.${_}-${w}:${_} .${I}`, R = Array.isArray(g.styleName) ? g.styleName : [g.styleName ?? O], F = ((te = g.valueFormat) == null ? void 0 : te.call(g, z, E.getVariableValue)) ?? z;
1661
- c.push(`${B}{${R.map((C) => `${C}:${F}`).join(";")}}`);
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) => {
1672
+ var te, re;
1673
+ const p = E[j].find((T) => Array.isArray(T.values) ? T.values.includes(V) : typeof V == typeof T.values);
1674
+ 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(";")}}`);
1662
1677
  });
1663
1678
  });
1664
1679
  });
1665
- }), f !== "normal" && c.push("}"), c),
1680
+ }), c !== "normal" && m.push("}"), m),
1666
1681
  [v]
1667
1682
  );
1668
- y.unshift(`:root{${E.generateVariables()}}`);
1669
- const o = b();
1670
- o.innerHTML = y.join(""), t = !1;
1683
+ b.unshift(`:root{${z.generateVariables()}}`);
1684
+ const i = y();
1685
+ i.innerHTML = b.join(""), t = !1;
1671
1686
  }
1672
1687
  e.flush = d;
1673
1688
  function s() {
1674
- a = {};
1689
+ r = {};
1675
1690
  }
1676
1691
  e.clear = s;
1677
- function l(r, v, h, y, o = "normal", c) {
1692
+ function f(o, v, g, b, i = "normal", m) {
1678
1693
  if (v == null) return;
1679
- const f = y.reduce((N, U) => N + se[U], 0);
1680
- a[o] ? a[o][f] ? a[o][f][r] || (a[o][f][r] = /* @__PURE__ */ new Set()) : a[o][f] = { [r]: /* @__PURE__ */ new Set() } : a[o] = { [f]: { [r]: /* @__PURE__ */ new Set() } }, c ? (a[o][f].__parents ? a[o][f].__parents[c] ? a[o][f].__parents[c][r] || (a[o][f].__parents[c][r] = /* @__PURE__ */ new Set()) : a[o][f].__parents[c] = { [r]: /* @__PURE__ */ new Set() } : a[o][f].__parents = { [c]: { [r]: /* @__PURE__ */ new Set() } }, a[o][f].__parents[c][r].has(v) || (a[o][f].__parents[c][r].add(v), t = !0)) : a[o][f][r].has(v) || (a[o][f][r].add(v), t = !0);
1681
- const x = i(r, v, f, o, c);
1682
- h.push(x);
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);
1697
+ g.push(w);
1683
1698
  }
1684
- function i(r, v, h, y, o) {
1685
- const c = K[h], f = `${y === "normal" ? "" : `${y}-`}${c.map((x) => `${x}-`).join("")}${o ? `${o}-` : ""}${r}-${v}`;
1686
- return oe ? f : ye.getIdentity(f);
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}`;
1701
+ return ne ? c : he.getIdentity(c);
1687
1702
  }
1688
- const m = "crono-styles";
1689
- function b() {
1690
- let r = document.getElementById(m);
1691
- return r || (r = document.createElement("style"), r.setAttribute("id", m), r.setAttribute("type", "text/css"), document.head.insertBefore(r, document.head.firstChild)), r;
1703
+ const u = "crono-styles";
1704
+ 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;
1692
1707
  }
1693
1708
  })(A || (A = {}));
1694
1709
  var ae;
@@ -1697,143 +1712,321 @@ var ae;
1697
1712
  })(ae || (ae = {}));
1698
1713
  var M;
1699
1714
  ((e) => {
1700
- function t(a, u, d) {
1701
- return E.setUserVariables(a), Object.entries(u).forEach(([s, l]) => {
1702
- j[s] = l;
1703
- }), Object.entries(d).forEach(([s, l]) => {
1704
- const i = j[s];
1705
- j[s] = i ? [...l, ...i] : l;
1706
- }), { extendedProps: u, extendedPropTypes: d };
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 };
1707
1722
  }
1708
1723
  e.extend = t;
1709
1724
  })(M || (M = {}));
1710
- const xe = M;
1725
+ const Fe = M;
1711
1726
  var X;
1712
1727
  ((e) => {
1713
1728
  const t = {
1714
1729
  button: {
1715
1730
  styles: {
1716
- display: "inline-block",
1731
+ display: "inline-flex",
1732
+ color: "white",
1733
+ bgColor: "violet-500",
1734
+ borderColor: "violet-500",
1717
1735
  p: 3,
1718
1736
  cursor: "pointer",
1719
1737
  b: 1,
1720
1738
  borderRadius: 1,
1721
1739
  userSelect: "none",
1740
+ hover: {
1741
+ bgColor: "violet-600",
1742
+ borderColor: "violet-600"
1743
+ },
1722
1744
  disabled: {
1723
- cursor: "default"
1745
+ cursor: "not-allowed",
1746
+ bgColor: "violet-50",
1747
+ color: "gray-400",
1748
+ borderColor: "gray-300"
1724
1749
  }
1725
1750
  }
1726
1751
  },
1727
- checkbox: {
1752
+ textbox: {
1728
1753
  styles: {
1729
- display: "inline-block"
1754
+ display: "inline-block",
1755
+ b: 1,
1756
+ borderColor: "violet-200",
1757
+ bgColor: "violet-50",
1758
+ color: "violet-950",
1759
+ borderRadius: 1,
1760
+ p: 3,
1761
+ transition: "none",
1762
+ hover: {
1763
+ borderColor: "violet-300"
1764
+ },
1765
+ focus: {
1766
+ outline: 1,
1767
+ borderColor: "violet-500",
1768
+ outlineColor: "violet-500"
1769
+ },
1770
+ disabled: {
1771
+ cursor: "not-allowed",
1772
+ bgColor: "violet-50",
1773
+ color: "gray-400",
1774
+ borderColor: "gray-300"
1775
+ }
1730
1776
  }
1731
1777
  },
1732
- radioButton: {
1778
+ textarea: {
1733
1779
  styles: {
1734
1780
  display: "inline-block",
1735
1781
  b: 1,
1736
- p: 2
1782
+ borderColor: "violet-200",
1783
+ bgColor: "violet-50",
1784
+ color: "violet-950",
1785
+ borderRadius: 1,
1786
+ p: 3,
1787
+ transition: "none",
1788
+ hover: {
1789
+ borderColor: "violet-300"
1790
+ },
1791
+ focus: {
1792
+ outline: 1,
1793
+ borderColor: "violet-500",
1794
+ outlineColor: "violet-500"
1795
+ },
1796
+ disabled: {
1797
+ cursor: "not-allowed",
1798
+ bgColor: "violet-50",
1799
+ color: "gray-400",
1800
+ borderColor: "gray-300",
1801
+ resize: "none"
1802
+ }
1737
1803
  }
1738
1804
  },
1739
- textbox: {
1805
+ checkbox: {
1740
1806
  styles: {
1741
1807
  display: "inline-block",
1808
+ appearance: "none",
1742
1809
  b: 1,
1810
+ borderColor: "violet-300",
1743
1811
  borderRadius: 1,
1744
- p: 3
1812
+ p: 2,
1813
+ cursor: "pointer",
1814
+ transition: "none",
1815
+ hover: {
1816
+ borderColor: "violet-500"
1817
+ },
1818
+ focus: {
1819
+ outline: 2,
1820
+ outlineOffset: 2,
1821
+ outlineColor: "violet-500"
1822
+ },
1823
+ checked: {
1824
+ bgColor: "violet-500",
1825
+ borderColor: "violet-500",
1826
+ bgImage: "bg-img-checked"
1827
+ },
1828
+ indeterminate: {
1829
+ color: "violet-500",
1830
+ bgImage: "bg-img-indeterminate"
1831
+ },
1832
+ disabled: {
1833
+ cursor: "not-allowed",
1834
+ bgColor: "violet-100",
1835
+ color: "gray-400",
1836
+ borderColor: "gray-300"
1837
+ }
1745
1838
  }
1746
1839
  },
1747
- textarea: {
1840
+ radioButton: {
1748
1841
  styles: {
1749
- display: "inline-block",
1842
+ appearance: "none",
1843
+ b: 1,
1844
+ borderColor: "violet-300",
1845
+ borderRadius: 3,
1846
+ p: 2,
1847
+ cursor: "pointer",
1848
+ transition: "none",
1849
+ hover: {
1850
+ borderColor: "violet-500"
1851
+ },
1852
+ focus: {
1853
+ outline: 2,
1854
+ outlineOffset: 2,
1855
+ outlineColor: "violet-500"
1856
+ },
1857
+ checked: {
1858
+ bgColor: "violet-500",
1859
+ borderColor: "violet-500",
1860
+ bgImage: "bg-img-radio"
1861
+ },
1862
+ disabled: {
1863
+ cursor: "not-allowed",
1864
+ bgColor: "violet-100",
1865
+ color: "gray-400",
1866
+ borderColor: "violet-200"
1867
+ }
1868
+ }
1869
+ },
1870
+ dropdown: {
1871
+ styles: {
1872
+ display: "inline-flex",
1873
+ ai: "center",
1874
+ gap: 2,
1875
+ jc: "space-between",
1876
+ p: 3,
1877
+ cursor: "pointer",
1878
+ bgColor: "violet-50",
1879
+ color: "violet-950",
1750
1880
  b: 1,
1751
- borderRadius: 1
1881
+ borderColor: "violet-200",
1882
+ borderRadius: 1,
1883
+ userSelect: "none",
1884
+ lineHeight: 20,
1885
+ minWidth: 40,
1886
+ transition: "none",
1887
+ hover: {
1888
+ borderColor: "violet-300"
1889
+ },
1890
+ focus: {
1891
+ outline: 1,
1892
+ borderColor: "violet-500",
1893
+ outlineColor: "violet-500"
1894
+ },
1895
+ disabled: {
1896
+ cursor: "not-allowed",
1897
+ bgColor: "violet-50",
1898
+ color: "gray-400",
1899
+ borderColor: "gray-300"
1900
+ }
1901
+ },
1902
+ children: {
1903
+ items: {
1904
+ styles: {
1905
+ p: 1,
1906
+ b: 1,
1907
+ borderRadius: 1,
1908
+ position: "relative",
1909
+ top: 1,
1910
+ bgColor: "white",
1911
+ overflow: "auto",
1912
+ maxHeight: 62,
1913
+ borderColor: "violet-300",
1914
+ color: "violet-950"
1915
+ }
1916
+ },
1917
+ item: {
1918
+ styles: {
1919
+ display: "flex",
1920
+ width: "fit",
1921
+ p: 3,
1922
+ cursor: "pointer",
1923
+ lineHeight: 20,
1924
+ borderRadius: 1,
1925
+ hover: {
1926
+ bgColor: "violet-50"
1927
+ },
1928
+ focus: {
1929
+ bgColor: "violet-50"
1930
+ }
1931
+ }
1932
+ }
1752
1933
  }
1753
1934
  }
1754
- // dropdown: {
1755
- // styles: {
1756
- // width: 'min-content',
1757
- // b: 1,
1758
- // borderRadius: 1,
1759
- // p: 3,
1760
- // cursor: 'pointer',
1761
- // },
1762
- // children: {
1763
- // items: {
1764
- // styles: {
1765
- // b: 1,
1766
- // },
1767
- // },
1768
- // },
1769
- // },
1770
1935
  };
1771
- function a(u) {
1772
- const { components: d, ...s } = u, l = d ?? {};
1773
- Object.entries(s).forEach(([i, m]) => {
1774
- l[i] = m;
1775
- }), H.components = $.mergeDeep(t, l);
1936
+ 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);
1776
1941
  }
1777
- e.setup = a;
1942
+ e.setup = r, R.components = { ...t };
1778
1943
  })(X || (X = {}));
1779
- const Ne = X;
1944
+ const $e = X;
1780
1945
  var Y;
1781
1946
  ((e) => {
1782
- function t(u) {
1783
- const d = Array.from(u.elements).reduce(
1784
- (s, l) => {
1785
- const i = l.name;
1786
- return i && (s[i] || (s[i] = []), s[i].push(l)), s;
1947
+ function t(r, l, d) {
1948
+ r !== void 0 && r != null && (d[l] = Array.isArray(r) ? r[0] : r);
1949
+ }
1950
+ e.assignBooleanProp = t;
1951
+ })(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
+ }
1960
+ function ze(e = null) {
1961
+ const [t, r] = fe(!1), l = me(null);
1962
+ 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);
1969
+ }
1970
+ function f(a) {
1971
+ a.key === "Escape" && r(!1);
1972
+ }
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);
1975
+ };
1976
+ }, [e, t]), [t, r, l];
1977
+ }
1978
+ var J;
1979
+ ((e) => {
1980
+ 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;
1787
1985
  },
1788
1986
  {}
1789
1987
  );
1790
- return Object.entries(d).reduce((s, [l, i]) => {
1791
- if (i.length === 1) {
1792
- const m = i[0];
1793
- a(s, l, m.type === "checkbox" || m.type === "radio" ? m.checked : m.value);
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);
1794
1992
  } else {
1795
- const m = i.reduce((b, r) => (r.type === "checkbox" || r.type === "radio" ? r.checked && b.push(r.value) : b.push(r.value), b), []);
1796
- a(s, l, m);
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);
1797
1995
  }
1798
1996
  return s;
1799
1997
  }, {});
1800
1998
  }
1801
1999
  e.getFormEntries = t;
1802
- function a(u, d, s) {
2000
+ function r(l, d, s) {
1803
2001
  if (d.includes(".")) {
1804
- const l = d.split(".");
1805
- let i = u;
1806
- l.forEach((m, b) => {
1807
- if (l.length > b + 1) {
1808
- const r = m.match(/^(.+)\[(\d)\]$/);
1809
- if (r) {
1810
- const [, v, h] = r;
1811
- i[v] = i[v] || [], i[v][h] = i[v][h] || {}, i = i[v][h];
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];
1812
2010
  } else
1813
- i[m] = i[m] || {}, i = i[m];
2011
+ a[u] = a[u] || {}, a = a[u];
1814
2012
  } else
1815
- i[m] = s;
2013
+ a[u] = s;
1816
2014
  });
1817
2015
  } else
1818
- u[d] = s;
2016
+ l[d] = s;
1819
2017
  }
1820
- })(Y || (Y = {}));
1821
- const we = Y;
1822
- function Fe() {
1823
- return J(() => {
1824
- const e = "crono-box";
1825
- let t = document.getElementById(e);
1826
- return t || (t = document.createElement("div"), t.id = e, document.body.appendChild(t)), t;
1827
- }, []);
1828
- }
2018
+ })(J || (J = {}));
2019
+ const Ee = J;
1829
2020
  export {
1830
- xe as B,
1831
- we as F,
2021
+ Fe as B,
2022
+ Ee as F,
1832
2023
  $ as O,
1833
2024
  ae as S,
1834
- Ne as T,
1835
- E as V,
1836
- Fe as a,
1837
- ce as c,
1838
- ge as u
2025
+ $e as T,
2026
+ z as V,
2027
+ Ce as a,
2028
+ ze as b,
2029
+ ve as c,
2030
+ Ve as d,
2031
+ Ne as u
1839
2032
  };