@cronocode/react-box 1.8.4 → 1.8.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,71 +1,72 @@
1
- import { useMemo as P, useLayoutEffect as G, useEffect as M } from "react";
1
+ import { useMemo as q, useLayoutEffect as M, useEffect as U } from "react";
2
+ import { O as B } from "./utils.mjs";
2
3
  var e;
3
- ((t) => {
4
+ ((u) => {
4
5
  ((r) => {
5
- function m(l, b) {
6
- return `${l}${b.replace("/", "-")}`;
6
+ function c(l, n) {
7
+ return `${l}${n.replace("/", "-")}`;
7
8
  }
8
- r.fraction = m;
9
- function v(l) {
9
+ r.fraction = c;
10
+ function h(l) {
10
11
  return [`${l} path`, `${l} circle`, `${l} rect`, `${l} line`];
11
12
  }
12
- r.svg = v;
13
- })(t.ClassName || (t.ClassName = {})), ((r) => {
14
- function m(s, a) {
15
- return `${a / 4}rem`;
13
+ r.svg = h;
14
+ })(u.ClassName || (u.ClassName = {})), ((r) => {
15
+ function c(a, s) {
16
+ return `${s / 4}rem`;
16
17
  }
17
- r.rem = m;
18
- function v(s, a) {
19
- return `${a}px`;
18
+ r.rem = c;
19
+ function h(a, s) {
20
+ return `${s}px`;
20
21
  }
21
- r.px = v;
22
- function l(s, a) {
23
- const [u, p] = a.split("/");
24
- return `${+u / +p * 100}%`;
22
+ r.px = h;
23
+ function l(a, s) {
24
+ const [t, N] = s.split("/");
25
+ return `${+t / +N * 100}%`;
25
26
  }
26
27
  r.fraction = l;
27
- function b(s, a) {
28
- switch (a) {
28
+ function n(a, s) {
29
+ switch (s) {
29
30
  case "fit":
30
31
  return "100%";
31
32
  case "fit-screen":
32
- return s.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
33
+ return a.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
33
34
  default:
34
- return a;
35
+ return s;
35
36
  }
36
37
  }
37
- r.widthHeight = b;
38
- function N(s) {
39
- return (a, u) => `var(--${s}${u});`;
38
+ r.widthHeight = n;
39
+ function m(a) {
40
+ return (s, t) => `var(--${a}${t});`;
40
41
  }
41
- r.variables = N;
42
- function x(s) {
43
- return (a, u) => `var(--${s}${u});`;
42
+ r.variables = m;
43
+ function C(a) {
44
+ return (s, t) => `var(--${a}${t});`;
44
45
  }
45
- r.svgVariables = x;
46
- function j(s, a) {
47
- return `repeat(${a},minmax(0,1fr))`;
46
+ r.svgVariables = C;
47
+ function i(a, s) {
48
+ return `repeat(${s},minmax(0,1fr))`;
48
49
  }
49
- r.gridColumns = j;
50
- function o(s, a) {
51
- return a === "full-row" ? "1/-1" : `span ${a}/span ${a}`;
50
+ r.gridColumns = i;
51
+ function p(a, s) {
52
+ return s === "full-row" ? "1/-1" : `span ${s}/span ${s}`;
52
53
  }
53
- r.gridColumn = o;
54
- function n(s, a) {
55
- return `${a}ms`;
54
+ r.gridColumn = p;
55
+ function f(a, s) {
56
+ return `${s}ms`;
56
57
  }
57
- r.ms = n;
58
- function g(s, a) {
59
- return `${a}deg`;
58
+ r.ms = f;
59
+ function b(a, s) {
60
+ return `${s}deg`;
60
61
  }
61
- r.rotate = g;
62
- function f(s, a) {
63
- return a === "xAxis" ? "-1 1" : "1 -1";
62
+ r.rotate = b;
63
+ function V(a, s) {
64
+ return s === "xAxis" ? "-1 1" : "1 -1";
64
65
  }
65
- r.flip = f;
66
- })(t.Value || (t.Value = {}));
66
+ r.flip = V;
67
+ })(u.Value || (u.Value = {}));
67
68
  })(e || (e = {}));
68
- const i = [
69
+ const v = [
69
70
  0,
70
71
  1,
71
72
  2,
@@ -124,7 +125,7 @@ const i = [
124
125
  200,
125
126
  250,
126
127
  300
127
- ], U = [
128
+ ], X = [
128
129
  -1,
129
130
  -2,
130
131
  -3,
@@ -170,7 +171,7 @@ const i = [
170
171
  -92,
171
172
  -96,
172
173
  -100
173
- ], d = [...i, ...U], B = ["solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset", "none", "hidden"], H = ["auto", "hidden", "scroll", "visible"], k = [
174
+ ], d = [...v, ...X], R = ["solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset", "none", "hidden"], I = ["auto", "hidden", "scroll", "visible"], k = [
174
175
  "1/2",
175
176
  "1/3",
176
177
  "2/3",
@@ -197,7 +198,7 @@ const i = [
197
198
  "9/12",
198
199
  "10/12",
199
200
  "11/12"
200
- ], C = ["fit", "fit-screen", "auto", "fit-content", "max-content", "min-content"], F = ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"], w = {
201
+ ], j = ["fit", "fit-screen", "auto", "fit-content", "max-content", "min-content"], _ = ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"], x = {
201
202
  /** The `display` CSS property sets whether an element is treated as a block or inline box and the layout used for its children, such as flow layout, grid or flex. */
202
203
  display: {
203
204
  cssNames: ["display"],
@@ -221,8 +222,8 @@ const i = [
221
222
  },
222
223
  width: {
223
224
  cssNames: ["width"],
224
- values1: { values: C, formatValue: e.Value.widthHeight },
225
- values2: { values: i, formatValue: e.Value.rem },
225
+ values1: { values: j, formatValue: e.Value.widthHeight },
226
+ values2: { values: v, formatValue: e.Value.rem },
226
227
  values3: {
227
228
  values: k,
228
229
  formatValue: e.Value.fraction
@@ -231,8 +232,8 @@ const i = [
231
232
  },
232
233
  minWidth: {
233
234
  cssNames: ["min-width"],
234
- values1: { values: C, formatValue: e.Value.widthHeight },
235
- values2: { values: i, formatValue: e.Value.rem },
235
+ values1: { values: j, formatValue: e.Value.widthHeight },
236
+ values2: { values: v, formatValue: e.Value.rem },
236
237
  values3: {
237
238
  values: k,
238
239
  formatValue: e.Value.fraction
@@ -241,8 +242,8 @@ const i = [
241
242
  },
242
243
  maxWidth: {
243
244
  cssNames: ["max-width"],
244
- values1: { values: C, formatValue: e.Value.widthHeight },
245
- values2: { values: i, formatValue: e.Value.rem },
245
+ values1: { values: j, formatValue: e.Value.widthHeight },
246
+ values2: { values: v, formatValue: e.Value.rem },
246
247
  values3: {
247
248
  values: k,
248
249
  formatValue: e.Value.fraction
@@ -251,8 +252,8 @@ const i = [
251
252
  },
252
253
  height: {
253
254
  cssNames: ["height"],
254
- values1: { values: C, formatValue: e.Value.widthHeight },
255
- values2: { values: i, formatValue: e.Value.rem },
255
+ values1: { values: j, formatValue: e.Value.widthHeight },
256
+ values2: { values: v, formatValue: e.Value.rem },
256
257
  values3: {
257
258
  values: k,
258
259
  formatValue: e.Value.fraction
@@ -261,8 +262,8 @@ const i = [
261
262
  },
262
263
  minHeight: {
263
264
  cssNames: ["min-height"],
264
- values1: { values: C, formatValue: e.Value.widthHeight },
265
- values2: { values: i, formatValue: e.Value.rem },
265
+ values1: { values: j, formatValue: e.Value.widthHeight },
266
+ values2: { values: v, formatValue: e.Value.rem },
266
267
  values3: {
267
268
  values: k,
268
269
  formatValue: e.Value.fraction
@@ -271,8 +272,8 @@ const i = [
271
272
  },
272
273
  maxHeight: {
273
274
  cssNames: ["max-height"],
274
- values1: { values: C, formatValue: e.Value.widthHeight },
275
- values2: { values: i, formatValue: e.Value.rem },
275
+ values1: { values: j, formatValue: e.Value.widthHeight },
276
+ values2: { values: v, formatValue: e.Value.rem },
276
277
  values3: {
277
278
  values: k,
278
279
  formatValue: e.Value.fraction
@@ -401,7 +402,7 @@ const i = [
401
402
  },
402
403
  b: {
403
404
  cssNames: ["border-width"],
404
- values1: { values: i, formatValue: e.Value.px },
405
+ values1: { values: v, formatValue: e.Value.px },
405
406
  values2: { values: [] },
406
407
  values3: { values: [] }
407
408
  },
@@ -443,61 +444,61 @@ const i = [
443
444
  },
444
445
  borderStyle: {
445
446
  cssNames: ["border-style"],
446
- values1: { values: B },
447
+ values1: { values: R },
447
448
  values2: { values: [] },
448
449
  values3: { values: [] }
449
450
  },
450
451
  borderRadius: {
451
452
  cssNames: ["border-radius"],
452
- values1: { values: i, formatValue: e.Value.rem },
453
+ values1: { values: v, formatValue: e.Value.rem },
453
454
  values2: { values: [] },
454
455
  values3: { values: [] }
455
456
  },
456
457
  borderRadiusTop: {
457
458
  cssNames: ["border-top-left-radius", "border-top-right-radius"],
458
- values1: { values: i, formatValue: e.Value.rem },
459
+ values1: { values: v, formatValue: e.Value.rem },
459
460
  values2: { values: [] },
460
461
  values3: { values: [] }
461
462
  },
462
463
  borderRadiusRight: {
463
464
  cssNames: ["border-top-right-radius", "border-bottom-right-radius"],
464
- values1: { values: i, formatValue: e.Value.rem },
465
+ values1: { values: v, formatValue: e.Value.rem },
465
466
  values2: { values: [] },
466
467
  values3: { values: [] }
467
468
  },
468
469
  borderRadiusBottom: {
469
470
  cssNames: ["border-bottom-left-radius", "border-bottom-right-radius"],
470
- values1: { values: i, formatValue: e.Value.rem },
471
+ values1: { values: v, formatValue: e.Value.rem },
471
472
  values2: { values: [] },
472
473
  values3: { values: [] }
473
474
  },
474
475
  borderRadiusLeft: {
475
476
  cssNames: ["border-top-left-radius", "border-bottom-left-radius"],
476
- values1: { values: i, formatValue: e.Value.rem },
477
+ values1: { values: v, formatValue: e.Value.rem },
477
478
  values2: { values: [] },
478
479
  values3: { values: [] }
479
480
  },
480
481
  borderRadiusTopLeft: {
481
482
  cssNames: ["border-top-left-radius"],
482
- values1: { values: i, formatValue: e.Value.rem },
483
+ values1: { values: v, formatValue: e.Value.rem },
483
484
  values2: { values: [] },
484
485
  values3: { values: [] }
485
486
  },
486
487
  borderRadiusTopRight: {
487
488
  cssNames: ["border-top-right-radius"],
488
- values1: { values: i, formatValue: e.Value.rem },
489
+ values1: { values: v, formatValue: e.Value.rem },
489
490
  values2: { values: [] },
490
491
  values3: { values: [] }
491
492
  },
492
493
  borderRadiusBottomLeft: {
493
494
  cssNames: ["border-bottom-left-radius"],
494
- values1: { values: i, formatValue: e.Value.rem },
495
+ values1: { values: v, formatValue: e.Value.rem },
495
496
  values2: { values: [] },
496
497
  values3: { values: [] }
497
498
  },
498
499
  borderRadiusBottomRight: {
499
500
  cssNames: ["border-bottom-right-radius"],
500
- values1: { values: i, formatValue: e.Value.rem },
501
+ values1: { values: v, formatValue: e.Value.rem },
501
502
  values2: { values: [] },
502
503
  values3: { values: [] }
503
504
  },
@@ -556,19 +557,19 @@ const i = [
556
557
  },
557
558
  overflow: {
558
559
  cssNames: ["overflow"],
559
- values1: { values: H },
560
+ values1: { values: I },
560
561
  values2: { values: [] },
561
562
  values3: { values: [] }
562
563
  },
563
564
  overflowX: {
564
565
  cssNames: ["overflow-x"],
565
- values1: { values: H },
566
+ values1: { values: I },
566
567
  values2: { values: [] },
567
568
  values3: { values: [] }
568
569
  },
569
570
  overflowY: {
570
571
  cssNames: ["overflow-y"],
571
- values1: { values: H },
572
+ values1: { values: I },
572
573
  values2: { values: [] },
573
574
  values3: { values: [] }
574
575
  },
@@ -580,7 +581,7 @@ const i = [
580
581
  },
581
582
  fontSize: {
582
583
  cssNames: ["font-size"],
583
- values1: { values: i, formatValue: e.Value.px },
584
+ values1: { values: v, formatValue: e.Value.px },
584
585
  values2: { values: ["inherit"] },
585
586
  values3: { values: [] }
586
587
  },
@@ -598,13 +599,13 @@ const i = [
598
599
  },
599
600
  letterSpacing: {
600
601
  cssNames: ["letter-spacing"],
601
- values1: { values: i, formatValue: e.Value.px },
602
+ values1: { values: v, formatValue: e.Value.px },
602
603
  values2: { values: [] },
603
604
  values3: { values: [] }
604
605
  },
605
606
  lineHeight: {
606
607
  cssNames: ["line-height"],
607
- values1: { values: i, formatValue: e.Value.px },
608
+ values1: { values: v, formatValue: e.Value.px },
608
609
  values2: { values: ["font-size"], formatValue: () => "1" },
609
610
  values3: { values: [] }
610
611
  },
@@ -693,91 +694,91 @@ const i = [
693
694
  },
694
695
  gap: {
695
696
  cssNames: ["gap"],
696
- values1: { values: i, formatValue: e.Value.rem },
697
+ values1: { values: v, formatValue: e.Value.rem },
697
698
  values2: { values: [] },
698
699
  values3: { values: [] }
699
700
  },
700
701
  rowGap: {
701
702
  cssNames: ["row-gap"],
702
- values1: { values: i, formatValue: e.Value.rem },
703
+ values1: { values: v, formatValue: e.Value.rem },
703
704
  values2: { values: [] },
704
705
  values3: { values: [] }
705
706
  },
706
707
  columnGap: {
707
708
  cssNames: ["column-gap"],
708
- values1: { values: i, formatValue: e.Value.rem },
709
+ values1: { values: v, formatValue: e.Value.rem },
709
710
  values2: { values: [] },
710
711
  values3: { values: [] }
711
712
  },
712
713
  order: {
713
714
  cssNames: ["order"],
714
- values1: { values: i },
715
+ values1: { values: v },
715
716
  values2: { values: [] },
716
717
  values3: { values: [] }
717
718
  },
718
719
  flexGrow: {
719
720
  cssNames: ["flex-grow"],
720
- values1: { values: i },
721
+ values1: { values: v },
721
722
  values2: { values: [] },
722
723
  values3: { values: [] }
723
724
  },
724
725
  flexShrink: {
725
726
  cssNames: ["flex-shrink"],
726
- values1: { values: i },
727
+ values1: { values: v },
727
728
  values2: { values: [] },
728
729
  values3: { values: [] }
729
730
  },
730
731
  alignSelf: {
731
732
  cssNames: ["align-self"],
732
- values1: { values: F },
733
+ values1: { values: _ },
733
734
  values2: { values: [] },
734
735
  values3: { values: [] }
735
736
  },
736
737
  justifySelf: {
737
738
  cssNames: ["justify-self"],
738
- values1: { values: F },
739
+ values1: { values: _ },
739
740
  values2: { values: [] },
740
741
  values3: { values: [] }
741
742
  },
742
743
  gridColumns: {
743
744
  cssNames: ["grid-template-columns"],
744
- values1: { values: i, formatValue: e.Value.gridColumns },
745
+ values1: { values: v, formatValue: e.Value.gridColumns },
745
746
  values2: { values: [] },
746
747
  values3: { values: [] }
747
748
  },
748
749
  colSpan: {
749
750
  cssNames: ["grid-column"],
750
- values1: { values: i, formatValue: e.Value.gridColumn },
751
+ values1: { values: v, formatValue: e.Value.gridColumn },
751
752
  values2: { values: ["full-row"], formatValue: e.Value.gridColumn },
752
753
  values3: { values: [] }
753
754
  },
754
755
  colStart: {
755
756
  cssNames: ["grid-column-start"],
756
- values1: { values: i },
757
+ values1: { values: v },
757
758
  values2: { values: [] },
758
759
  values3: { values: [] }
759
760
  },
760
761
  colEnd: {
761
762
  cssNames: ["grid-column-end"],
762
- values1: { values: i },
763
+ values1: { values: v },
763
764
  values2: { values: [] },
764
765
  values3: { values: [] }
765
766
  },
766
767
  outline: {
767
768
  cssNames: ["outline-width"],
768
- values1: { values: i, formatValue: e.Value.px },
769
+ values1: { values: v, formatValue: e.Value.px },
769
770
  values2: { values: [] },
770
771
  values3: { values: [] }
771
772
  },
772
773
  outlineStyle: {
773
774
  cssNames: ["outline-style"],
774
- values1: { values: B },
775
+ values1: { values: R },
775
776
  values2: { values: [] },
776
777
  values3: { values: [] }
777
778
  },
778
779
  outlineOffset: {
779
780
  cssNames: ["outline-offset"],
780
- values1: { values: i, formatValue: e.Value.px },
781
+ values1: { values: v, formatValue: e.Value.px },
781
782
  values2: { values: [] },
782
783
  values3: { values: [] }
783
784
  },
@@ -838,7 +839,7 @@ const i = [
838
839
  values2: { values: [] },
839
840
  values3: { values: [] }
840
841
  }
841
- }, R = {
842
+ }, D = {
842
843
  shadow: { cssNames: ["box-shadow"], formatValue: e.Value.variables("shadow") },
843
844
  background: { cssNames: ["background"], formatValue: e.Value.variables("background") },
844
845
  backgroundImage: { cssNames: ["background-image"], formatValue: e.Value.variables("backgroundImage") },
@@ -846,7 +847,7 @@ const i = [
846
847
  bgColor: { cssNames: ["background-color"], formatValue: e.Value.variables("color") },
847
848
  borderColor: { cssNames: ["border-color"], formatValue: e.Value.variables("color") },
848
849
  outlineColor: { cssNames: ["outline-color"], formatValue: e.Value.variables("color") }
849
- }, _ = {
850
+ }, L = {
850
851
  fill: {
851
852
  cssNames: ["fill"],
852
853
  formatValue: e.Value.svgVariables("color"),
@@ -857,7 +858,7 @@ const i = [
857
858
  formatValue: e.Value.svgVariables("color"),
858
859
  formatSelector: e.ClassName.svg
859
860
  }
860
- }, X = ["H", "F", "A"], Y = [
861
+ }, Y = [
861
862
  "H",
862
863
  "F",
863
864
  "A",
@@ -872,16 +873,16 @@ const i = [
872
873
  hover: { className: "_h" },
873
874
  focus: { className: "_f" }
874
875
  };
875
- Object.keys(R).forEach((t) => {
876
- w[t] = R[t], w[t].isThemeStyle = !0;
876
+ Object.keys(D).forEach((u) => {
877
+ x[u] = D[u], x[u].isThemeStyle = !0;
877
878
  });
878
- Object.keys(_).forEach((t) => {
879
- w[t] = _[t], w[t].isThemeStyle = !0;
879
+ Object.keys(L).forEach((u) => {
880
+ x[u] = L[u], x[u].isThemeStyle = !0;
880
881
  });
881
- const J = Object.keys(w);
882
- Y.forEach((t) => {
882
+ const J = Object.keys(x);
883
+ Y.forEach((u) => {
883
884
  J.forEach((r) => {
884
- w[`${r}${t}`] = { ...w[r], pseudoSuffix: t };
885
+ x[`${r}${u}`] = { ...x[r], pseudoSuffix: u };
885
886
  });
886
887
  });
887
888
  class Q {
@@ -892,93 +893,93 @@ class Q {
892
893
  return this._cache[r] || (this._cache[r] = this.getByIndex(this._index++)), this._cache[r];
893
894
  }
894
895
  getByIndex(r) {
895
- const { first: m, next: v } = Z, l = r - m.length;
896
+ const { first: c, next: h } = Z, l = r - c.length;
896
897
  if (l < 0)
897
- return m[r];
898
- const b = Math.floor(l / v.length), N = l - b * v.length;
899
- return this.getByIndex(b) + v[N];
898
+ return c[r];
899
+ const n = Math.floor(l / h.length), m = l - n * h.length;
900
+ return this.getByIndex(n) + h[m];
900
901
  }
901
902
  }
902
903
  const Z = {
903
904
  first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
904
905
  next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
905
906
  };
906
- var A;
907
- ((t) => {
908
- t.boxClassName = "_box", t.svgClassName = "_svg", t.cronoStylesElementId = "crono-styles";
907
+ var E;
908
+ ((u) => {
909
+ u.boxClassName = "_box", u.svgClassName = "_svg", u.cronoStylesElementId = "crono-styles";
909
910
  const r = `: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;}}
910
911
  html{font-size: 16px;font-family: Arial, sans-serif;}
911
912
  body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
912
913
  a,ul{all: unset;}
913
- .${t.boxClassName}{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;}
914
- .${t.svgClassName}{transition: all var(--svgTransitionTime);}.${t.svgClassName} path,.${t.svgClassName} circle,.${t.svgClassName} rect,.${t.svgClassName} line {transition: all var(--svgTransitionTime);}
915
- `, m = new Q(), v = Object.keys(w);
916
- let l = !0, b = v.reduce(
917
- (s, a) => (s[a] = /* @__PURE__ */ new Set(), s),
914
+ .${u.boxClassName}{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;}
915
+ .${u.svgClassName}{transition: all var(--svgTransitionTime);}.${u.svgClassName} path,.${u.svgClassName} circle,.${u.svgClassName} rect,.${u.svgClassName} line {transition: all var(--svgTransitionTime);}
916
+ `, c = new Q(), h = Object.keys(x);
917
+ let l = !0, n = h.reduce(
918
+ (a, s) => (a[s] = /* @__PURE__ */ new Set(), a),
918
919
  {}
919
920
  );
920
- function N(s, a) {
921
- if (s in w)
922
- return o(s, a);
923
- if (s in T)
924
- return T[s].className;
921
+ function m(a, s) {
922
+ if (a in x)
923
+ return p(a, s);
924
+ if (a in T && s)
925
+ return T[a].className;
925
926
  }
926
- t.get = N;
927
- function x() {
927
+ u.get = m;
928
+ function C() {
928
929
  if (l) {
929
- let s = n([r]);
930
- s = n(s, "H"), s = n(s, "F"), s = n(s, "A"), s = n(s, "Checked"), s = n(s, "Indeterminate"), s = n(s, "Valid"), s = n(s, "Invalid"), s = n(s, "Required"), s = n(s, "Disabled");
931
- const a = f();
932
- a.innerHTML = s.join(""), l = !1;
930
+ let a = f([r]);
931
+ a = f(a, "H"), a = f(a, "F"), a = f(a, "A"), a = f(a, "Checked"), a = f(a, "Indeterminate"), a = f(a, "Valid"), a = f(a, "Invalid"), a = f(a, "Required"), a = f(a, "Disabled");
932
+ const s = V();
933
+ s.innerHTML = a.join(""), l = !1;
933
934
  }
934
935
  }
935
- t.flush = x;
936
- function j() {
937
- b = v.reduce(
938
- (s, a) => (s[a] = /* @__PURE__ */ new Set(), s),
936
+ u.flush = C;
937
+ function i() {
938
+ n = h.reduce(
939
+ (a, s) => (a[s] = /* @__PURE__ */ new Set(), a),
939
940
  {}
940
941
  );
941
942
  }
942
- t.clear = j;
943
- function o(s, a) {
943
+ u.clear = i;
944
+ function p(a, s) {
944
945
  var y;
945
- b[s].has(a) || (l = !0, b[s].add(a));
946
- const u = g(s, a), p = ((y = u.formatClassName) == null ? void 0 : y.call(u, s, a)) ?? `${s}${a}`;
947
- return m.getIdentity(p);
946
+ n[a].has(s) || (l = !0, n[a].add(s));
947
+ const t = b(a, s), N = ((y = t.formatClassName) == null ? void 0 : y.call(t, a, s)) ?? `${a}${s}`;
948
+ return c.getIdentity(N);
948
949
  }
949
- function n(s, a) {
950
- return Object.entries(b).filter(([p]) => {
950
+ function f(a, s) {
951
+ return Object.entries(n).filter(([N]) => {
951
952
  var y;
952
- return ((y = w[p]) == null ? void 0 : y.pseudoSuffix) === a;
953
- }).reduce((p, [y, I]) => (I.forEach(($) => {
954
- var E;
955
- const V = g(y, $), c = `.${o(y, $)}`;
956
- let h = [];
957
- a ? a === "H" ? h = [
958
- ...u(`${c}:hover`, V),
959
- ...u(`.${T.hover.className}:hover>${c}`, V)
960
- ] : a === "F" ? h = [
961
- ...u(`${c}:focus-within`, V),
962
- ...u(`.${T.focus.className}:focus-within>${c}`, V)
963
- ] : a === "A" ? h = u(`${c}:active`, V) : a === "Checked" ? h = u(`${c}:checked`, V) : a === "Indeterminate" ? h = u(`${c}:indeterminate`, V) : a === "Valid" ? h = u(`${c}:valid`, V) : a === "Invalid" ? h = u(`${c}:invalid`, V) : a === "Required" ? h = u(`${c}:required`, V) : a === "Optional" ? h = u(`${c}:optional`, V) : a === "Disabled" && (h = u(`${c}:disabled`, V)) : h = u(c, V);
964
- const L = ((E = V.formatValue) == null ? void 0 : E.call(V, y, $)) ?? $, q = w[y].cssNames.map((W) => `${W}:${L};`).join("");
965
- p.push(`${h.join(",")}{${q}}`);
966
- }), p), s);
967
- function u(p, y) {
968
- return y.formatSelector ? y.formatSelector(p) : [p];
953
+ return ((y = x[N]) == null ? void 0 : y.pseudoSuffix) === s;
954
+ }).reduce((N, [y, S]) => (S.forEach(($) => {
955
+ var H;
956
+ const o = b(y, $), g = `.${p(y, $)}`;
957
+ let w = [];
958
+ s ? s === "H" ? w = [
959
+ ...t(`${g}:hover`, o),
960
+ ...t(`.${T.hover.className}:hover>${g}`, o)
961
+ ] : s === "F" ? w = [
962
+ ...t(`${g}:focus-within`, o),
963
+ ...t(`.${T.focus.className}:focus-within>${g}`, o)
964
+ ] : s === "A" ? w = t(`${g}:active`, o) : s === "Checked" ? w = t(`${g}:checked`, o) : s === "Indeterminate" ? w = t(`${g}:indeterminate`, o) : s === "Valid" ? w = t(`${g}:valid`, o) : s === "Invalid" ? w = t(`${g}:invalid`, o) : s === "Required" ? w = t(`${g}:required`, o) : s === "Optional" ? w = t(`${g}:optional`, o) : s === "Disabled" && (w = t(`${g}:disabled`, o)) : w = t(g, o);
965
+ const F = ((H = o.formatValue) == null ? void 0 : H.call(o, y, $)) ?? $, W = x[y].cssNames.map((G) => `${G}:${F};`).join("");
966
+ N.push(`${w.join(",")}{${W}}`);
967
+ }), N), a);
968
+ function t(N, y) {
969
+ return y.formatSelector ? y.formatSelector(N) : [N];
969
970
  }
970
971
  }
971
- function g(s, a) {
972
- const u = w[s];
973
- return u.isThemeStyle ? u : u.values1.values.includes(a) ? u.values1 : u.values2.values.includes(a) ? u.values2 : u.values3;
972
+ function b(a, s) {
973
+ const t = x[a];
974
+ return t.isThemeStyle ? t : t.values1.values.includes(s) ? t.values1 : t.values2.values.includes(s) ? t.values2 : t.values3;
974
975
  }
975
- function f() {
976
- const a = typeof window < "u" && typeof window.document < "u" ? window.document : global.document;
977
- let u = a.getElementById(t.cronoStylesElementId);
978
- return u || (u = a.createElement("style"), u.setAttribute("id", t.cronoStylesElementId), u.setAttribute("type", "text/css"), a.head.insertBefore(u, a.head.firstChild)), u;
976
+ function V() {
977
+ const s = typeof window < "u" && typeof window.document < "u" ? window.document : global.document;
978
+ let t = s.getElementById(u.cronoStylesElementId);
979
+ return t || (t = s.createElement("style"), t.setAttribute("id", u.cronoStylesElementId), t.setAttribute("type", "text/css"), s.head.insertBefore(t, s.head.firstChild)), t;
979
980
  }
980
- })(A || (A = {}));
981
- const z = A, S = {
981
+ })(E || (E = {}));
982
+ const O = E, z = {
982
983
  button: {
983
984
  styles: {
984
985
  display: "inline-block",
@@ -1020,138 +1021,143 @@ const z = A, S = {
1020
1021
  }
1021
1022
  }
1022
1023
  };
1023
- var O;
1024
- ((t) => {
1025
- t.Styles = b(S);
1026
- function r(o) {
1027
- t.Styles = l(o);
1024
+ var A;
1025
+ ((u) => {
1026
+ u.Styles = l(z);
1027
+ function r(i) {
1028
+ u.Styles = h(i);
1028
1029
  }
1029
- t.setup = r;
1030
- function m(o, n) {
1031
- const g = Object.entries(o.colors).map(([c, h]) => `--color${c}: ${h};`).join(`
1032
- `), f = Object.entries(o.shadows).map(([c, h]) => `--shadow${c}: ${h};`).join(`
1033
- `), s = Object.entries(o.backgrounds).map(([c, h]) => `--background${c}: ${h};`).join(`
1034
- `), a = Object.entries(o.backgroundImages).map(([c, h]) => `--backgroundImage${c}: ${h};`).join(`
1035
- `), u = [":root {"];
1036
- g && u.push(` ${g}`), f && u.push(` ${f}`), s && u.push(` ${s}`), a && u.push(` ${a}`), u.push("}");
1037
- const p = Object.keys(o.colors).map((c) => `'${c}'`).join(" | "), y = Object.keys(o.backgrounds).map((c) => `'${c}'`).join(" | "), I = Object.keys(o.backgroundImages).map((c) => `'${c}'`).join(" | "), $ = Object.keys(o.shadows).map((c) => `'${c}'`).join(" | "), V = `import '@cronocode/react-box';
1030
+ u.setup = r;
1031
+ function c(i, p) {
1032
+ const f = Object.entries(i.colors).map(([o, g]) => `--color${o}: ${g};`).join(`
1033
+ `), b = Object.entries(i.shadows).map(([o, g]) => `--shadow${o}: ${g};`).join(`
1034
+ `), V = Object.entries(i.backgrounds).map(([o, g]) => `--background${o}: ${g};`).join(`
1035
+ `), a = Object.entries(i.backgroundImages).map(([o, g]) => `--backgroundImage${o}: ${g};`).join(`
1036
+ `), s = [":root {"];
1037
+ f && s.push(` ${f}`), b && s.push(` ${b}`), V && s.push(` ${V}`), a && s.push(` ${a}`), s.push("}");
1038
+ const t = Object.keys(i.colors).map((o) => `'${o}'`).join(" | "), N = Object.keys(i.backgrounds).map((o) => `'${o}'`).join(" | "), y = Object.keys(i.backgroundImages).map((o) => `'${o}'`).join(" | "), S = Object.keys(i.shadows).map((o) => `'${o}'`).join(" | "), $ = `import '@cronocode/react-box';
1038
1039
 
1039
- declare module '${(n == null ? void 0 : n.namespacePath) ?? "@cronocode/react-box/core/types"}' {
1040
- type ColorType = ${p};
1041
- type BackgroundType = ${y};
1042
- type BackgroundImageType = ${I};
1043
- type ShadowType = ${$};
1040
+ declare module '${(p == null ? void 0 : p.namespacePath) ?? "@cronocode/react-box/core/types"}' {
1041
+ type ColorType = ${t};
1042
+ type BackgroundType = ${N};
1043
+ type BackgroundImageType = ${y};
1044
+ type ShadowType = ${S};
1044
1045
 
1045
1046
  namespace Augmented {
1046
1047
  interface BoxProps {
1047
- ${v("color", "ColorType")}
1048
- ${v("bgColor", "ColorType")}
1049
- ${v("borderColor", "ColorType")}
1050
- ${v("outlineColor", "ColorType")}
1051
- ${v("background", "BackgroundType")}
1052
- ${v("backgroundImage", "BackgroundImageType")}
1053
- ${v("shadow", "ShadowType")}
1048
+ color?: ColorType;
1049
+ bgColor?: ColorType;
1050
+ borderColor?: ColorType;
1051
+ outlineColor?: ColorType;
1052
+ background?: BackgroundType;
1053
+ backgroundImage?: BackgroundImageType;
1054
+ shadow?: ShadowType;
1054
1055
  }
1055
1056
 
1056
1057
  interface SvgProps {
1057
- ${v("fill", "ColorType")}
1058
- ${v("stroke", "ColorType")}
1058
+ fill?: ColorType;
1059
+ stroke?: ColorType;
1059
1060
  }
1060
1061
  }
1061
1062
  }
1062
1063
  `;
1063
1064
  return {
1064
- variables: u.join(`
1065
+ variables: s.join(`
1065
1066
  `),
1066
- boxDts: V
1067
+ boxDts: $
1067
1068
  };
1068
1069
  }
1069
- t.setupAugmentedProps = m;
1070
- function v(o, n) {
1071
- const g = X.map((f) => ` ${o}${f}?: ${n};`);
1072
- return g.unshift(` ${o}?: ${n};`), g.join(`
1073
- `);
1070
+ u.setupAugmentedProps = c;
1071
+ function h(i) {
1072
+ const p = l(i);
1073
+ return Object.keys(z).forEach((b) => {
1074
+ const V = p[b], a = z[b];
1075
+ V ? V.styles = { ...a.styles, ...V.styles } : p[b] = z[b];
1076
+ }), p;
1074
1077
  }
1075
- function l(o) {
1076
- const n = b(o);
1077
- return Object.keys(S).forEach((f) => {
1078
- const s = n[f], a = S[f];
1079
- s ? s.styles = { ...a.styles, ...s.styles } : n[f] = S[f];
1080
- }), n;
1078
+ function l(i) {
1079
+ return n(i), C(i), i;
1081
1080
  }
1082
- function b(o) {
1083
- return N(o), j(o), o;
1084
- }
1085
- function N(o) {
1086
- if (!o.components)
1081
+ function n(i) {
1082
+ if (!i.components)
1087
1083
  return;
1088
- const n = Object.keys(o.components);
1089
- for (const g of n) {
1090
- const f = o.components[g], s = x(g, f);
1091
- delete f.children;
1092
- for (const a of s) {
1093
- const [u, p] = a;
1094
- o.components[u] = p;
1084
+ const p = Object.keys(i.components);
1085
+ for (const f of p) {
1086
+ const b = i.components[f], V = m(f, b);
1087
+ delete b.children;
1088
+ for (const a of V) {
1089
+ const [s, t] = a;
1090
+ i.components[s] = t;
1095
1091
  }
1096
1092
  }
1097
1093
  }
1098
- function x(o, n) {
1099
- if (!n.children)
1094
+ function m(i, p) {
1095
+ if (!p.children)
1100
1096
  return [];
1101
- const g = Object.keys(n.children), f = [];
1102
- for (const s of g) {
1103
- const a = `${o}.${s}`, u = n.children[s], p = x(a, u);
1104
- f.push(...p), delete u.children, f.push([a, u]);
1097
+ const f = Object.keys(p.children), b = [];
1098
+ for (const V of f) {
1099
+ const a = `${i}.${V}`, s = p.children[V], t = m(a, s);
1100
+ b.push(...t), delete s.children, b.push([a, s]);
1105
1101
  }
1106
- return f;
1102
+ return b;
1107
1103
  }
1108
- function j(o) {
1109
- const { components: n, ...g } = o, f = Object.values(g);
1110
- n && f.push(...Object.values(n));
1111
- for (const s of f)
1104
+ function C(i) {
1105
+ const { components: p, ...f } = i, b = Object.values(f);
1106
+ p && b.push(...Object.values(p));
1107
+ for (const V of b)
1112
1108
  [
1113
1109
  ["disabled", "Disabled"],
1114
1110
  ["indeterminate", "Indeterminate"],
1115
1111
  ["checked", "Checked"]
1116
- ].forEach(([a, u]) => {
1117
- a in s.styles && (Object.entries(s.styles[a]).map(([p, y]) => {
1118
- s.styles[`${p}${u}`] = y;
1119
- }), delete s.styles[a]);
1112
+ ].forEach(([a, s]) => {
1113
+ a in V.styles && (Object.entries(V.styles[a]).map(([t, N]) => {
1114
+ V.styles[`${t}${s}`] = N;
1115
+ }), delete V.styles[a]);
1120
1116
  });
1121
1117
  }
1122
- })(O || (O = {}));
1123
- const D = O;
1124
- function K(t) {
1125
- const { clean: r, theme: m, component: v } = t;
1126
- return P(() => {
1127
- var b, N;
1118
+ })(A || (A = {}));
1119
+ const P = A;
1120
+ function K(u) {
1121
+ const { clean: r, theme: c, component: h } = u;
1122
+ return q(() => {
1123
+ var n, m;
1128
1124
  if (r)
1129
1125
  return;
1130
- let l = D.Styles[v] ?? ((b = D.Styles.components) == null ? void 0 : b[v]);
1126
+ let l = P.Styles[h] ?? ((n = P.Styles.components) == null ? void 0 : n[h]);
1131
1127
  if (l)
1132
- return m ? { ...l.styles, ...(N = l.themes) == null ? void 0 : N[m].styles } : l.styles;
1133
- }, [v, r, m]);
1128
+ return c ? { ...l.styles, ...(m = l.themes) == null ? void 0 : m[c].styles } : l.styles;
1129
+ }, [h, r, c]);
1134
1130
  }
1135
- const ee = typeof window < "u" && typeof window.document < "u", se = ee ? G : M;
1136
- function te(t, r) {
1137
- const m = K(t);
1138
- return se(z.flush, [t]), P(() => {
1139
- const v = [r ? z.svgClassName : z.boxClassName], l = m ? { ...m, ...t } : { ...t };
1140
- return Array.isArray(l.disabled) && (Object.entries(l.disabled[1]).forEach(([b, N]) => {
1141
- l[`${b}Disabled`] = N;
1142
- }), delete l.disabled), "inline" in l && (l.display === "block" || !l.display ? l.display = "inline-block" : l.display === "flex" ? l.display = "inline-flex" : l.display === "grid" && (l.display = "inline-grid"), delete l.inline), "inlineH" in l && (l.displayH === "block" || !l.displayH ? l.displayH = "inline-block" : l.displayH === "flex" ? l.displayH = "inline-flex" : l.displayH === "grid" && (l.displayH = "inline-grid"), delete l.inlineH), "inlineF" in l && (l.displayF === "block" || !l.displayF ? l.displayF = "inline-block" : l.displayF === "flex" ? l.displayF = "inline-flex" : l.displayF === "grid" && (l.displayF = "inline-grid"), delete l.inlineF), "inlineA" in l && (l.displayA === "block" || !l.displayA ? l.displayA = "inline-block" : l.displayA === "flex" ? l.displayA = "inline-flex" : l.displayA === "grid" && (l.displayA = "inline-grid"), delete l.inlineA), Object.entries(l).forEach(([b, N]) => {
1143
- v.push(z.get(b, N));
1144
- }), v;
1145
- }, [t, m]);
1131
+ const ee = typeof window < "u" && typeof window.document < "u", se = ee ? M : U;
1132
+ function re(u, r) {
1133
+ const c = K(u);
1134
+ return se(O.flush, [u]), q(() => {
1135
+ const h = [r ? O.svgClassName : O.boxClassName], l = c ? { ...c, ...u } : { ...u };
1136
+ return Array.isArray(l.disabled) && (Object.entries(l.disabled[1]).forEach(([n, m]) => {
1137
+ l[`${n}Disabled`] = m;
1138
+ }), delete l.disabled), Array.isArray(l.hover) ? (Object.entries(l.hover[1]).forEach(([n, m]) => {
1139
+ l[`${n}H`] = m;
1140
+ }), l.hover = l.hover[0]) : B.isObject(l.hover) && (Object.entries(l.hover).forEach(([n, m]) => {
1141
+ l[`${n}H`] = m;
1142
+ }), delete l.hover), Array.isArray(l.focus) ? (Object.entries(l.focus[1]).forEach(([n, m]) => {
1143
+ l[`${n}F`] = m;
1144
+ }), l.focus = l.focus[0]) : B.isObject(l.focus) && (Object.entries(l.focus).forEach(([n, m]) => {
1145
+ l[`${n}F`] = m;
1146
+ }), delete l.focus), l.active && (Object.entries(l.active).forEach(([n, m]) => {
1147
+ l[`${n}A`] = m;
1148
+ }), delete l.active), "inline" in l && (l.display === "block" || !l.display ? l.display = "inline-block" : l.display === "flex" ? l.display = "inline-flex" : l.display === "grid" && (l.display = "inline-grid"), delete l.inline), Object.entries(l).forEach(([n, m]) => {
1149
+ h.push(O.get(n, m));
1150
+ }), h;
1151
+ }, [u, c]);
1146
1152
  }
1147
- function ae(...t) {
1148
- return t.reduce((r, m) => m ? typeof m == "string" ? (r.push(m), r) : Array.isArray(m) ? (r.push(...ae(...m)), r) : (Object.entries(m).forEach(([v, l]) => {
1149
- l && r.push(v);
1153
+ function ae(...u) {
1154
+ return u.reduce((r, c) => c ? typeof c == "string" ? (r.push(c), r) : Array.isArray(c) ? (r.push(...ae(...c)), r) : (Object.entries(c).forEach(([h, l]) => {
1155
+ l && r.push(h);
1150
1156
  }), r) : r, []);
1151
1157
  }
1152
1158
  export {
1153
- z as S,
1154
- D as T,
1159
+ O as S,
1160
+ P as T,
1155
1161
  ae as c,
1156
- te as u
1162
+ re as u
1157
1163
  };