@cronocode/react-box 1.8.0 → 1.8.2

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,69 +1,69 @@
1
- import { useMemo as W, useLayoutEffect as U, useEffect as X } from "react";
1
+ import { useMemo as P, useLayoutEffect as G, useEffect as M } from "react";
2
2
  var e;
3
- ((s) => {
4
- ((l) => {
5
- function c(a, d) {
6
- return `${a}${d.replace("/", "-")}`;
3
+ ((u) => {
4
+ ((r) => {
5
+ function m(a, b) {
6
+ return `${a}${b.replace("/", "-")}`;
7
7
  }
8
- l.fraction = c;
9
- function v(a) {
8
+ r.fraction = m;
9
+ function n(a) {
10
10
  return [`${a} path`, `${a} circle`, `${a} rect`, `${a} line`];
11
11
  }
12
- l.svg = v;
13
- })(s.ClassName || (s.ClassName = {})), ((l) => {
14
- function c(o, u) {
15
- return `${u / 4}rem`;
12
+ r.svg = n;
13
+ })(u.ClassName || (u.ClassName = {})), ((r) => {
14
+ function m(l, s) {
15
+ return `${s / 4}rem`;
16
16
  }
17
- l.rem = c;
18
- function v(o, u) {
19
- return `${u}px`;
17
+ r.rem = m;
18
+ function n(l, s) {
19
+ return `${s}px`;
20
20
  }
21
- l.px = v;
22
- function a(o, u) {
23
- const [t, N] = u.split("/");
21
+ r.px = n;
22
+ function a(l, s) {
23
+ const [t, N] = s.split("/");
24
24
  return `${+t / +N * 100}%`;
25
25
  }
26
- l.fraction = a;
27
- function d(o, u) {
28
- switch (u) {
26
+ r.fraction = a;
27
+ function b(l, s) {
28
+ switch (s) {
29
29
  case "fit":
30
30
  return "100%";
31
31
  case "fit-screen":
32
- return o.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
32
+ return l.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
33
33
  default:
34
- return u;
34
+ return s;
35
35
  }
36
36
  }
37
- l.widthHeight = d;
38
- function n(o) {
39
- return (u, t) => `var(--${o}${t});`;
37
+ r.widthHeight = b;
38
+ function V(l) {
39
+ return (s, t) => `var(--${l}${t});`;
40
40
  }
41
- l.variables = n;
42
- function f(o) {
43
- return (u, t) => `var(--${o}${t});`;
41
+ r.variables = V;
42
+ function $(l) {
43
+ return (s, t) => `var(--${l}${t});`;
44
44
  }
45
- l.svgVariables = f;
46
- function g(o, u) {
47
- return `repeat(${u},minmax(0,1fr))`;
45
+ r.svgVariables = $;
46
+ function v(l, s) {
47
+ return `repeat(${s},minmax(0,1fr))`;
48
48
  }
49
- l.gridColumns = g;
50
- function p(o, u) {
51
- return u === "full-row" ? "1/-1" : `span ${u}/span ${u}`;
49
+ r.gridColumns = v;
50
+ function d(l, s) {
51
+ return s === "full-row" ? "1/-1" : `span ${s}/span ${s}`;
52
52
  }
53
- l.gridColumn = p;
54
- function y(o, u) {
55
- return `${u}ms`;
53
+ r.gridColumn = d;
54
+ function c(l, s) {
55
+ return `${s}ms`;
56
56
  }
57
- l.ms = y;
58
- function k(o, u) {
59
- return `${u}deg`;
57
+ r.ms = c;
58
+ function p(l, s) {
59
+ return `${s}deg`;
60
60
  }
61
- l.rotate = k;
62
- function h(o, u) {
63
- return u === "xAxis" ? "-1 1" : "1 -1";
61
+ r.rotate = p;
62
+ function h(l, s) {
63
+ return s === "xAxis" ? "-1 1" : "1 -1";
64
64
  }
65
- l.flip = h;
66
- })(s.Value || (s.Value = {}));
65
+ r.flip = h;
66
+ })(u.Value || (u.Value = {}));
67
67
  })(e || (e = {}));
68
68
  const i = [
69
69
  0,
@@ -116,8 +116,15 @@ const i = [
116
116
  88,
117
117
  92,
118
118
  96,
119
- 100
120
- ], Y = [
119
+ 100,
120
+ 120,
121
+ 140,
122
+ 160,
123
+ 180,
124
+ 200,
125
+ 250,
126
+ 300
127
+ ], U = [
121
128
  -1,
122
129
  -2,
123
130
  -3,
@@ -163,7 +170,7 @@ const i = [
163
170
  -92,
164
171
  -96,
165
172
  -100
166
- ], m = [...i, ...Y], R = ["solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset", "none", "hidden"], I = ["auto", "hidden", "scroll", "visible"], $ = [
173
+ ], f = [...i, ...U], B = ["solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset", "none", "hidden"], H = ["auto", "hidden", "scroll", "visible"], C = [
167
174
  "1/2",
168
175
  "1/3",
169
176
  "2/3",
@@ -190,7 +197,7 @@ const i = [
190
197
  "9/12",
191
198
  "10/12",
192
199
  "11/12"
193
- ], H = ["fit", "fit-screen", "auto", "fit-content", "max-content", "min-content"], L = ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"], r = {
200
+ ], j = ["fit", "fit-screen", "auto", "fit-content", "max-content", "min-content"], F = ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"], w = {
194
201
  /** 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. */
195
202
  display: {
196
203
  cssNames: ["display"],
@@ -214,60 +221,60 @@ const i = [
214
221
  },
215
222
  width: {
216
223
  cssNames: ["width"],
217
- values1: { values: H, formatValue: e.Value.widthHeight },
224
+ values1: { values: j, formatValue: e.Value.widthHeight },
218
225
  values2: { values: i, formatValue: e.Value.rem },
219
226
  values3: {
220
- values: $,
227
+ values: C,
221
228
  formatValue: e.Value.fraction
222
229
  // formatClassName: BoxStylesFormatters.ClassName.fraction,
223
230
  }
224
231
  },
225
232
  minWidth: {
226
233
  cssNames: ["min-width"],
227
- values1: { values: H, formatValue: e.Value.widthHeight },
234
+ values1: { values: j, formatValue: e.Value.widthHeight },
228
235
  values2: { values: i, formatValue: e.Value.rem },
229
236
  values3: {
230
- values: $,
237
+ values: C,
231
238
  formatValue: e.Value.fraction
232
239
  // formatClassName: BoxStylesFormatters.ClassName.fraction,
233
240
  }
234
241
  },
235
242
  maxWidth: {
236
243
  cssNames: ["max-width"],
237
- values1: { values: H, formatValue: e.Value.widthHeight },
244
+ values1: { values: j, formatValue: e.Value.widthHeight },
238
245
  values2: { values: i, formatValue: e.Value.rem },
239
246
  values3: {
240
- values: $,
247
+ values: C,
241
248
  formatValue: e.Value.fraction
242
249
  // formatClassName: BoxStylesFormatters.ClassName.fraction,
243
250
  }
244
251
  },
245
252
  height: {
246
253
  cssNames: ["height"],
247
- values1: { values: H, formatValue: e.Value.widthHeight },
254
+ values1: { values: j, formatValue: e.Value.widthHeight },
248
255
  values2: { values: i, formatValue: e.Value.rem },
249
256
  values3: {
250
- values: $,
257
+ values: C,
251
258
  formatValue: e.Value.fraction
252
259
  // formatClassName: BoxStylesFormatters.ClassName.fraction,
253
260
  }
254
261
  },
255
262
  minHeight: {
256
263
  cssNames: ["min-height"],
257
- values1: { values: H, formatValue: e.Value.widthHeight },
264
+ values1: { values: j, formatValue: e.Value.widthHeight },
258
265
  values2: { values: i, formatValue: e.Value.rem },
259
266
  values3: {
260
- values: $,
267
+ values: C,
261
268
  formatValue: e.Value.fraction
262
269
  // formatClassName: BoxStylesFormatters.ClassName.fraction,
263
270
  }
264
271
  },
265
272
  maxHeight: {
266
273
  cssNames: ["max-height"],
267
- values1: { values: H, formatValue: e.Value.widthHeight },
274
+ values1: { values: j, formatValue: e.Value.widthHeight },
268
275
  values2: { values: i, formatValue: e.Value.rem },
269
276
  values3: {
270
- values: $,
277
+ values: C,
271
278
  formatValue: e.Value.fraction
272
279
  // formatClassName: BoxStylesFormatters.ClassName.fraction,
273
280
  }
@@ -280,163 +287,163 @@ const i = [
280
287
  },
281
288
  top: {
282
289
  cssNames: ["top"],
283
- values1: { values: m, formatValue: e.Value.rem },
290
+ values1: { values: f, formatValue: e.Value.rem },
284
291
  values2: { values: [] },
285
292
  values3: { values: [] }
286
293
  },
287
294
  right: {
288
295
  cssNames: ["right"],
289
- values1: { values: m, formatValue: e.Value.rem },
296
+ values1: { values: f, formatValue: e.Value.rem },
290
297
  values2: { values: [] },
291
298
  values3: { values: [] }
292
299
  },
293
300
  bottom: {
294
301
  cssNames: ["bottom"],
295
- values1: { values: m, formatValue: e.Value.rem },
302
+ values1: { values: f, formatValue: e.Value.rem },
296
303
  values2: { values: [] },
297
304
  values3: { values: [] }
298
305
  },
299
306
  left: {
300
307
  cssNames: ["left"],
301
- values1: { values: m, formatValue: e.Value.rem },
308
+ values1: { values: f, formatValue: e.Value.rem },
302
309
  values2: { values: [] },
303
310
  values3: { values: [] }
304
311
  },
305
312
  inset: {
306
313
  cssNames: ["inset"],
307
- values1: { values: m, formatValue: e.Value.rem },
314
+ values1: { values: f, formatValue: e.Value.rem },
308
315
  values2: { values: [] },
309
316
  values3: { values: [] }
310
317
  },
311
- margin: {
318
+ m: {
312
319
  cssNames: ["margin"],
313
- values1: { values: m, formatValue: e.Value.rem },
320
+ values1: { values: f, formatValue: e.Value.rem },
314
321
  values2: { values: ["auto"] },
315
322
  values3: { values: [] }
316
323
  },
317
- marginHorizontal: {
324
+ mx: {
318
325
  cssNames: ["margin-inline"],
319
- values1: { values: m, formatValue: e.Value.rem },
326
+ values1: { values: f, formatValue: e.Value.rem },
320
327
  values2: { values: ["auto"] },
321
328
  values3: { values: [] }
322
329
  },
323
- marginVertical: {
330
+ my: {
324
331
  cssNames: ["margin-block"],
325
- values1: { values: m, formatValue: e.Value.rem },
332
+ values1: { values: f, formatValue: e.Value.rem },
326
333
  values2: { values: ["auto"] },
327
334
  values3: { values: [] }
328
335
  },
329
- marginTop: {
336
+ mt: {
330
337
  cssNames: ["margin-top"],
331
- values1: { values: m, formatValue: e.Value.rem },
338
+ values1: { values: f, formatValue: e.Value.rem },
332
339
  values2: { values: ["auto"] },
333
340
  values3: { values: [] }
334
341
  },
335
- marginRight: {
342
+ mr: {
336
343
  cssNames: ["margin-right"],
337
- values1: { values: m, formatValue: e.Value.rem },
344
+ values1: { values: f, formatValue: e.Value.rem },
338
345
  values2: { values: ["auto"] },
339
346
  values3: { values: [] }
340
347
  },
341
- marginBottom: {
348
+ mb: {
342
349
  cssNames: ["margin-bottom"],
343
- values1: { values: m, formatValue: e.Value.rem },
350
+ values1: { values: f, formatValue: e.Value.rem },
344
351
  values2: { values: ["auto"] },
345
352
  values3: { values: [] }
346
353
  },
347
- marginLeft: {
354
+ ml: {
348
355
  cssNames: ["margin-left"],
349
- values1: { values: m, formatValue: e.Value.rem },
356
+ values1: { values: f, formatValue: e.Value.rem },
350
357
  values2: { values: ["auto"] },
351
358
  values3: { values: [] }
352
359
  },
353
- padding: {
360
+ p: {
354
361
  cssNames: ["padding"],
355
- values1: { values: m, formatValue: e.Value.rem },
362
+ values1: { values: f, formatValue: e.Value.rem },
356
363
  values2: { values: [] },
357
364
  values3: { values: [] }
358
365
  },
359
- paddingHorizontal: {
366
+ px: {
360
367
  cssNames: ["padding-inline"],
361
- values1: { values: m, formatValue: e.Value.rem },
368
+ values1: { values: f, formatValue: e.Value.rem },
362
369
  values2: { values: [] },
363
370
  values3: { values: [] }
364
371
  },
365
- paddingVertical: {
372
+ py: {
366
373
  cssNames: ["padding-block"],
367
- values1: { values: m, formatValue: e.Value.rem },
374
+ values1: { values: f, formatValue: e.Value.rem },
368
375
  values2: { values: [] },
369
376
  values3: { values: [] }
370
377
  },
371
- paddingTop: {
378
+ pt: {
372
379
  cssNames: ["padding-top"],
373
- values1: { values: m, formatValue: e.Value.rem },
380
+ values1: { values: f, formatValue: e.Value.rem },
374
381
  values2: { values: [] },
375
382
  values3: { values: [] }
376
383
  },
377
- paddingRight: {
384
+ pr: {
378
385
  cssNames: ["padding-right"],
379
- values1: { values: m, formatValue: e.Value.rem },
386
+ values1: { values: f, formatValue: e.Value.rem },
380
387
  values2: { values: [] },
381
388
  values3: { values: [] }
382
389
  },
383
- paddingBottom: {
390
+ pb: {
384
391
  cssNames: ["padding-bottom"],
385
- values1: { values: m, formatValue: e.Value.rem },
392
+ values1: { values: f, formatValue: e.Value.rem },
386
393
  values2: { values: [] },
387
394
  values3: { values: [] }
388
395
  },
389
- paddingLeft: {
396
+ pl: {
390
397
  cssNames: ["padding-left"],
391
- values1: { values: m, formatValue: e.Value.rem },
398
+ values1: { values: f, formatValue: e.Value.rem },
392
399
  values2: { values: [] },
393
400
  values3: { values: [] }
394
401
  },
395
- border: {
402
+ b: {
396
403
  cssNames: ["border-width"],
397
404
  values1: { values: i, formatValue: e.Value.px },
398
405
  values2: { values: [] },
399
406
  values3: { values: [] }
400
407
  },
401
- borderHorizontal: {
408
+ bx: {
402
409
  cssNames: ["border-inline-width"],
403
- values1: { values: m, formatValue: e.Value.px },
410
+ values1: { values: f, formatValue: e.Value.px },
404
411
  values2: { values: [] },
405
412
  values3: { values: [] }
406
413
  },
407
- borderVertical: {
414
+ by: {
408
415
  cssNames: ["border-block-width"],
409
- values1: { values: m, formatValue: e.Value.px },
416
+ values1: { values: f, formatValue: e.Value.px },
410
417
  values2: { values: [] },
411
418
  values3: { values: [] }
412
419
  },
413
- borderTop: {
420
+ bt: {
414
421
  cssNames: ["border-top-width"],
415
- values1: { values: m, formatValue: e.Value.px },
422
+ values1: { values: f, formatValue: e.Value.px },
416
423
  values2: { values: [] },
417
424
  values3: { values: [] }
418
425
  },
419
- borderRight: {
426
+ br: {
420
427
  cssNames: ["border-right-width"],
421
- values1: { values: m, formatValue: e.Value.px },
428
+ values1: { values: f, formatValue: e.Value.px },
422
429
  values2: { values: [] },
423
430
  values3: { values: [] }
424
431
  },
425
- borderBottom: {
432
+ bb: {
426
433
  cssNames: ["border-bottom-width"],
427
- values1: { values: m, formatValue: e.Value.px },
434
+ values1: { values: f, formatValue: e.Value.px },
428
435
  values2: { values: [] },
429
436
  values3: { values: [] }
430
437
  },
431
- borderLeft: {
438
+ bl: {
432
439
  cssNames: ["border-left-width"],
433
- values1: { values: m, formatValue: e.Value.px },
440
+ values1: { values: f, formatValue: e.Value.px },
434
441
  values2: { values: [] },
435
442
  values3: { values: [] }
436
443
  },
437
444
  borderStyle: {
438
445
  cssNames: ["border-style"],
439
- values1: { values: R },
446
+ values1: { values: B },
440
447
  values2: { values: [] },
441
448
  values3: { values: [] }
442
449
  },
@@ -549,19 +556,19 @@ const i = [
549
556
  },
550
557
  overflow: {
551
558
  cssNames: ["overflow"],
552
- values1: { values: I },
559
+ values1: { values: H },
553
560
  values2: { values: [] },
554
561
  values3: { values: [] }
555
562
  },
556
563
  overflowX: {
557
564
  cssNames: ["overflow-x"],
558
- values1: { values: I },
565
+ values1: { values: H },
559
566
  values2: { values: [] },
560
567
  values3: { values: [] }
561
568
  },
562
569
  overflowY: {
563
570
  cssNames: ["overflow-y"],
564
- values1: { values: I },
571
+ values1: { values: H },
565
572
  values2: { values: [] },
566
573
  values3: { values: [] }
567
574
  },
@@ -625,7 +632,7 @@ const i = [
625
632
  values2: { values: [] },
626
633
  values3: { values: [] }
627
634
  },
628
- justifyContent: {
635
+ jc: {
629
636
  cssNames: ["justify-content"],
630
637
  values1: {
631
638
  values: [
@@ -645,7 +652,7 @@ const i = [
645
652
  values2: { values: [] },
646
653
  values3: { values: [] }
647
654
  },
648
- alignItems: {
655
+ ai: {
649
656
  cssNames: ["align-items"],
650
657
  values1: {
651
658
  values: ["stretch", "flex-start", "flex-end", "center", "baseline", "start", "end", "self-start", "self-end"]
@@ -678,7 +685,7 @@ const i = [
678
685
  values2: { values: [] },
679
686
  values3: { values: [] }
680
687
  },
681
- flexDirection: {
688
+ d: {
682
689
  cssNames: ["flex-direction"],
683
690
  values1: { values: ["row", "row-reverse", "column", "column-reverse"] },
684
691
  values2: { values: [] },
@@ -722,13 +729,13 @@ const i = [
722
729
  },
723
730
  alignSelf: {
724
731
  cssNames: ["align-self"],
725
- values1: { values: L },
732
+ values1: { values: F },
726
733
  values2: { values: [] },
727
734
  values3: { values: [] }
728
735
  },
729
736
  justifySelf: {
730
737
  cssNames: ["justify-self"],
731
- values1: { values: L },
738
+ values1: { values: F },
732
739
  values2: { values: [] },
733
740
  values3: { values: [] }
734
741
  },
@@ -764,7 +771,7 @@ const i = [
764
771
  },
765
772
  outlineStyle: {
766
773
  cssNames: ["outline-style"],
767
- values1: { values: R },
774
+ values1: { values: B },
768
775
  values2: { values: [] },
769
776
  values3: { values: [] }
770
777
  },
@@ -831,7 +838,7 @@ const i = [
831
838
  values2: { values: [] },
832
839
  values3: { values: [] }
833
840
  }
834
- }, _ = {
841
+ }, R = {
835
842
  shadow: { cssNames: ["box-shadow"], formatValue: e.Value.variables("shadow") },
836
843
  background: { cssNames: ["background"], formatValue: e.Value.variables("background") },
837
844
  backgroundImage: { cssNames: ["background-image"], formatValue: e.Value.variables("backgroundImage") },
@@ -839,7 +846,7 @@ const i = [
839
846
  bgColor: { cssNames: ["background-color"], formatValue: e.Value.variables("color") },
840
847
  borderColor: { cssNames: ["border-color"], formatValue: e.Value.variables("color") },
841
848
  outlineColor: { cssNames: ["outline-color"], formatValue: e.Value.variables("color") }
842
- }, D = {
849
+ }, _ = {
843
850
  fill: {
844
851
  cssNames: ["fill"],
845
852
  formatValue: e.Value.svgVariables("color"),
@@ -850,147 +857,128 @@ const i = [
850
857
  formatValue: e.Value.svgVariables("color"),
851
858
  formatSelector: e.ClassName.svg
852
859
  }
853
- }, J = ["H", "F", "A", "C"], S = {
860
+ }, X = ["H", "F", "A", "Checked", "Indeterminate", "Valid", "Invalid", "Required", "Optional"], Y = [
861
+ "H",
862
+ "F",
863
+ "A",
864
+ "Checked",
865
+ "Indeterminate",
866
+ "Valid",
867
+ "Invalid",
868
+ "Required",
869
+ "Optional",
870
+ "Disabled"
871
+ ], z = {
854
872
  hover: { className: "_h" },
855
873
  focus: { className: "_f" }
856
874
  };
857
- Object.keys(_).forEach((s) => {
858
- r[s] = _[s], r[s].isThemeStyle = !0;
875
+ Object.keys(R).forEach((u) => {
876
+ w[u] = R[u], w[u].isThemeStyle = !0;
859
877
  });
860
- Object.keys(D).forEach((s) => {
861
- r[s] = D[s], r[s].isThemeStyle = !0;
878
+ Object.keys(_).forEach((u) => {
879
+ w[u] = _[u], w[u].isThemeStyle = !0;
862
880
  });
863
- const z = {
864
- w: { ...r.width, key: "width" },
865
- h: { ...r.height, key: "height" },
866
- m: { ...r.margin, key: "margin" },
867
- mx: { ...r.marginHorizontal, key: "marginHorizontal" },
868
- my: { ...r.marginVertical, key: "marginVertical" },
869
- mt: { ...r.marginTop, key: "marginTop" },
870
- mr: { ...r.marginRight, key: "marginRight" },
871
- mb: { ...r.marginBottom, key: "marginBottom" },
872
- ml: { ...r.marginLeft, key: "marginLeft" },
873
- p: { ...r.padding, key: "padding" },
874
- px: { ...r.paddingHorizontal, key: "paddingHorizontal" },
875
- py: { ...r.paddingVertical, key: "paddingVertical" },
876
- pt: { ...r.paddingTop, key: "paddingTop" },
877
- pr: { ...r.paddingRight, key: "paddingRight" },
878
- pb: { ...r.paddingBottom, key: "paddingBottom" },
879
- pl: { ...r.paddingLeft, key: "paddingLeft" },
880
- b: { ...r.border, key: "border" },
881
- bx: { ...r.borderHorizontal, key: "borderHorizontal" },
882
- by: { ...r.borderVertical, key: "borderVertical" },
883
- bt: { ...r.borderTop, key: "borderTop" },
884
- br: { ...r.borderRight, key: "borderRight" },
885
- bb: { ...r.borderBottom, key: "borderBottom" },
886
- bl: { ...r.borderLeft, key: "borderLeft" },
887
- jc: { ...r.justifyContent, key: "justifyContent" },
888
- ai: { ...r.alignItems, key: "alignItems" },
889
- ac: { ...r.alignContent, key: "alignContent" },
890
- d: { ...r.flexDirection, key: "flexDirection" }
891
- }, Q = Object.keys(r), Z = Object.keys(z);
892
- J.forEach((s) => {
893
- Q.forEach((l) => {
894
- r[`${l}${s}`] = { ...r[l] }, r[`${l}${s}`].pseudoSuffix = s;
895
- }), Z.forEach((l) => {
896
- z[`${l}${s}`] = { ...z[l], key: `${z[l].key}${s}` }, z[`${l}${s}`].pseudoSuffix = s;
881
+ const J = Object.keys(w);
882
+ Y.forEach((u) => {
883
+ J.forEach((r) => {
884
+ w[`${r}${u}`] = { ...w[r] }, w[`${r}${u}`].pseudoSuffix = u;
897
885
  });
898
886
  });
899
- class K {
887
+ class Q {
900
888
  constructor() {
901
889
  this._index = 0, this._cache = {};
902
890
  }
903
- getIdentity(l) {
904
- return this._cache[l] || (this._cache[l] = this.getByIndex(this._index++)), this._cache[l];
891
+ getIdentity(r) {
892
+ return this._cache[r] || (this._cache[r] = this.getByIndex(this._index++)), this._cache[r];
905
893
  }
906
- getByIndex(l) {
907
- const { first: c, next: v } = ee, a = l - c.length;
894
+ getByIndex(r) {
895
+ const { first: m, next: n } = Z, a = r - m.length;
908
896
  if (a < 0)
909
- return c[l];
910
- const d = Math.floor(a / v.length), n = a - d * v.length;
911
- return this.getByIndex(d) + v[n];
897
+ return m[r];
898
+ const b = Math.floor(a / n.length), V = a - b * n.length;
899
+ return this.getByIndex(b) + n[V];
912
900
  }
913
901
  }
914
- const ee = {
902
+ const Z = {
915
903
  first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
916
904
  next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
917
905
  };
918
- var F;
919
- ((s) => {
920
- s.boxClassName = "_box", s.svgClassName = "_svg", s.cronoStylesElementId = "crono-styles";
921
- const l = `: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;}}
906
+ var A;
907
+ ((u) => {
908
+ u.boxClassName = "_box", u.svgClassName = "_svg", u.cronoStylesElementId = "crono-styles";
909
+ 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;}}
922
910
  html{font-size: 16px;font-family: Arial, sans-serif;}
923
911
  body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
924
912
  a,ul{all: unset;}
925
- .${s.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;}
926
- .${s.svgClassName}{transition: all var(--svgTransitionTime);}.${s.svgClassName} path,.${s.svgClassName} circle,.${s.svgClassName} rect,.${s.svgClassName} line {transition: all var(--svgTransitionTime);}
927
- `, c = new K(), v = Object.keys(r);
928
- let a = !0, d = v.reduce(
929
- (o, u) => (o[u] = /* @__PURE__ */ new Set(), o),
913
+ .${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;}
914
+ .${u.svgClassName}{transition: all var(--svgTransitionTime);}.${u.svgClassName} path,.${u.svgClassName} circle,.${u.svgClassName} rect,.${u.svgClassName} line {transition: all var(--svgTransitionTime);}
915
+ `, m = new Q(), n = Object.keys(w);
916
+ let a = !0, b = n.reduce(
917
+ (l, s) => (l[s] = /* @__PURE__ */ new Set(), l),
930
918
  {}
931
919
  );
932
- function n(o, u) {
933
- if (o in r)
934
- return p(o, u);
935
- if (o in S)
936
- return S[o].className;
920
+ function V(l, s) {
921
+ if (l in w)
922
+ return d(l, s);
923
+ if (l in z)
924
+ return z[l].className;
937
925
  }
938
- s.get = n;
939
- function f() {
926
+ u.get = V;
927
+ function $() {
940
928
  if (a) {
941
- let o = y([l]);
942
- o = y(o, "H"), o = y(o, "F"), o = y(o, "A"), o = y(o, "C");
943
- const u = h();
944
- u.innerHTML = o.join(""), a = !1;
929
+ let l = c([r]);
930
+ l = c(l, "H"), l = c(l, "F"), l = c(l, "A"), l = c(l, "Checked"), l = c(l, "Indeterminate"), l = c(l, "Valid"), l = c(l, "Invalid"), l = c(l, "Required"), l = c(l, "Disabled");
931
+ const s = h();
932
+ s.innerHTML = l.join(""), a = !1;
945
933
  }
946
934
  }
947
- s.flush = f;
948
- function g() {
949
- d = v.reduce(
950
- (o, u) => (o[u] = /* @__PURE__ */ new Set(), o),
935
+ u.flush = $;
936
+ function v() {
937
+ b = n.reduce(
938
+ (l, s) => (l[s] = /* @__PURE__ */ new Set(), l),
951
939
  {}
952
940
  );
953
941
  }
954
- s.clear = g;
955
- function p(o, u) {
956
- var V;
957
- d[o].has(u) || (a = !0, d[o].add(u));
958
- const t = k(o, u), N = ((V = t.formatClassName) == null ? void 0 : V.call(t, o, u)) ?? `${o}${u}`;
959
- return c.getIdentity(N);
942
+ u.clear = v;
943
+ function d(l, s) {
944
+ var y;
945
+ b[l].has(s) || (a = !0, b[l].add(s));
946
+ const t = p(l, s), N = ((y = t.formatClassName) == null ? void 0 : y.call(t, l, s)) ?? `${l}${s}`;
947
+ return m.getIdentity(N);
960
948
  }
961
- function y(o, u) {
962
- return Object.entries(d).filter(([N]) => {
963
- var V;
964
- return ((V = r[N]) == null ? void 0 : V.pseudoSuffix) === u;
965
- }).reduce((N, [V, b]) => (b.forEach((w) => {
949
+ function c(l, s) {
950
+ return Object.entries(b).filter(([N]) => {
951
+ var y;
952
+ return ((y = w[N]) == null ? void 0 : y.pseudoSuffix) === s;
953
+ }).reduce((N, [y, I]) => (I.forEach((k) => {
966
954
  var E;
967
- const x = k(V, w), C = `.${p(V, w)}`;
968
- let T = [];
969
- u ? u === "H" ? T = [
970
- ...t(`${C}:hover`, x),
971
- ...t(`.${S.hover.className}:hover>${C}`, x)
972
- ] : u === "F" ? T = [
973
- ...t(`${C}:focus-within`, x),
974
- ...t(`.${S.focus.className}:focus-within>${C}`, x)
975
- ] : u === "A" ? T = t(`${C}:active`, x) : u === "C" && (T = t(`${C}:checked`, x)) : T = t(C, x);
976
- const G = ((E = x.formatValue) == null ? void 0 : E.call(x, V, w)) ?? w, M = r[V].cssNames.map((q) => `${q}:${G};`).join("");
977
- N.push(`${T.join(",")}{${M}}`);
978
- }), N), o);
979
- function t(N, V) {
980
- return V.formatSelector ? V.formatSelector(N) : [N];
955
+ const o = p(y, k), g = `.${d(y, k)}`;
956
+ let x = [];
957
+ s ? s === "H" ? x = [
958
+ ...t(`${g}:hover`, o),
959
+ ...t(`.${z.hover.className}:hover>${g}`, o)
960
+ ] : s === "F" ? x = [
961
+ ...t(`${g}:focus-within`, o),
962
+ ...t(`.${z.focus.className}:focus-within>${g}`, o)
963
+ ] : s === "A" ? x = t(`${g}:active`, o) : s === "Checked" ? x = t(`${g}:checked`, o) : s === "Indeterminate" ? x = t(`${g}:indeterminate`, o) : s === "Valid" ? x = t(`${g}:valid`, o) : s === "Invalid" ? x = t(`${g}:invalid`, o) : s === "Required" ? x = t(`${g}:required`, o) : s === "Optional" ? x = t(`${g}:optional`, o) : s === "Disabled" && (x = t(`${g}:disabled`, o)) : x = t(g, o);
964
+ const q = ((E = o.formatValue) == null ? void 0 : E.call(o, y, k)) ?? k, L = w[y].cssNames.map((W) => `${W}:${q};`).join("");
965
+ N.push(`${x.join(",")}{${L}}`);
966
+ }), N), l);
967
+ function t(N, y) {
968
+ return y.formatSelector ? y.formatSelector(N) : [N];
981
969
  }
982
970
  }
983
- function k(o, u) {
984
- const t = r[o];
985
- return t.isThemeStyle ? t : t.values1.values.includes(u) ? t.values1 : t.values2.values.includes(u) ? t.values2 : t.values3;
971
+ function p(l, s) {
972
+ const t = w[l];
973
+ return t.isThemeStyle ? t : t.values1.values.includes(s) ? t.values1 : t.values2.values.includes(s) ? t.values2 : t.values3;
986
974
  }
987
975
  function h() {
988
- const u = typeof window < "u" && typeof window.document < "u" ? window.document : global.document;
989
- let t = u.getElementById(s.cronoStylesElementId);
990
- return t || (t = u.createElement("style"), t.setAttribute("id", s.cronoStylesElementId), t.setAttribute("type", "text/css"), u.head.insertBefore(t, u.head.firstChild)), t;
976
+ const s = typeof window < "u" && typeof window.document < "u" ? window.document : global.document;
977
+ let t = s.getElementById(u.cronoStylesElementId);
978
+ return t || (t = s.createElement("style"), t.setAttribute("id", u.cronoStylesElementId), t.setAttribute("type", "text/css"), s.head.insertBefore(t, s.head.firstChild)), t;
991
979
  }
992
- })(F || (F = {}));
993
- const A = F, j = {
980
+ })(A || (A = {}));
981
+ const S = A, T = {
994
982
  button: {
995
983
  styles: {
996
984
  display: "inline-block",
@@ -998,10 +986,10 @@ const A = F, j = {
998
986
  cursor: "pointer",
999
987
  b: 1,
1000
988
  borderRadius: 1,
1001
- userSelect: "none"
1002
- },
1003
- disabled: {
1004
- cursor: "default"
989
+ userSelect: "none",
990
+ disabled: {
991
+ cursor: "default"
992
+ }
1005
993
  }
1006
994
  },
1007
995
  checkbox: {
@@ -1033,158 +1021,126 @@ const A = F, j = {
1033
1021
  }
1034
1022
  };
1035
1023
  var O;
1036
- ((s) => {
1037
- s.Styles = j;
1038
- function l(n) {
1039
- a(n), s.Styles = n, v();
1024
+ ((u) => {
1025
+ function r(v) {
1026
+ b(v), $(v), u.Styles = v, a();
1040
1027
  }
1041
- s.setup = l;
1042
- function c(n, f) {
1043
- const g = Object.entries(n.colors).map(([b, w]) => `--color${b}: ${w};`).join(`
1044
- `), p = Object.entries(n.shadows).map(([b, w]) => `--shadow${b}: ${w};`).join(`
1045
- `), y = Object.entries(n.backgrounds).map(([b, w]) => `--background${b}: ${w};`).join(`
1046
- `), k = Object.entries(n.backgroundImages).map(([b, w]) => `--backgroundImage${b}: ${w};`).join(`
1047
- `), h = [":root {"];
1048
- g && h.push(` ${g}`), p && h.push(` ${p}`), y && h.push(` ${y}`), k && h.push(` ${k}`), h.push("}");
1049
- const o = Object.keys(n.colors).map((b) => `'${b}'`).join(" | "), u = Object.keys(n.backgrounds).map((b) => `'${b}'`).join(" | "), t = Object.keys(n.backgroundImages).map((b) => `'${b}'`).join(" | "), N = Object.keys(n.shadows).map((b) => `'${b}'`).join(" | "), V = `import '@cronocode/react-box';
1028
+ u.setup = r;
1029
+ function m(v, d) {
1030
+ const c = Object.entries(v.colors).map(([o, g]) => `--color${o}: ${g};`).join(`
1031
+ `), p = Object.entries(v.shadows).map(([o, g]) => `--shadow${o}: ${g};`).join(`
1032
+ `), h = Object.entries(v.backgrounds).map(([o, g]) => `--background${o}: ${g};`).join(`
1033
+ `), l = Object.entries(v.backgroundImages).map(([o, g]) => `--backgroundImage${o}: ${g};`).join(`
1034
+ `), s = [":root {"];
1035
+ c && s.push(` ${c}`), p && s.push(` ${p}`), h && s.push(` ${h}`), l && s.push(` ${l}`), s.push("}");
1036
+ const t = Object.keys(v.colors).map((o) => `'${o}'`).join(" | "), N = Object.keys(v.backgrounds).map((o) => `'${o}'`).join(" | "), y = Object.keys(v.backgroundImages).map((o) => `'${o}'`).join(" | "), I = Object.keys(v.shadows).map((o) => `'${o}'`).join(" | "), k = `import '@cronocode/react-box';
1050
1037
 
1051
- declare module '${(f == null ? void 0 : f.namespacePath) ?? "@cronocode/react-box/core/types"}' {
1052
- type ColorType = ${o};
1053
- type BackgroundType = ${u};
1054
- type BackgroundImageType = ${t};
1055
- type ShadowType = ${N};
1038
+ declare module '${(d == null ? void 0 : d.namespacePath) ?? "@cronocode/react-box/core/types"}' {
1039
+ type ColorType = ${t};
1040
+ type BackgroundType = ${N};
1041
+ type BackgroundImageType = ${y};
1042
+ type ShadowType = ${I};
1056
1043
 
1057
1044
  namespace Augmented {
1058
1045
  interface BoxProps {
1059
- color?: ColorType;
1060
- colorH?: ColorType;
1061
- colorF?: ColorType;
1062
- colorA?: ColorType;
1063
- colorC?: ColorType;
1064
- bgColor?: ColorType;
1065
- bgColorH?: ColorType;
1066
- bgColorF?: ColorType;
1067
- bgColorA?: ColorType;
1068
- bgColorC?: ColorType;
1069
- borderColor?: ColorType;
1070
- borderColorH?: ColorType;
1071
- borderColorF?: ColorType;
1072
- borderColorA?: ColorType;
1073
- borderColorC?: ColorType;
1074
- outlineColor?: ColorType;
1075
- outlineColorH?: ColorType;
1076
- outlineColorF?: ColorType;
1077
- outlineColorA?: ColorType;
1078
- outlineColorC?: ColorType;
1079
- background?: BackgroundType;
1080
- backgroundH?: BackgroundType;
1081
- backgroundF?: BackgroundType;
1082
- backgroundA?: BackgroundType;
1083
- backgroundC?: BackgroundType;
1084
- backgroundImage?: BackgroundImageType;
1085
- backgroundImageH?: BackgroundImageType;
1086
- backgroundImageF?: BackgroundImageType;
1087
- backgroundImageA?: BackgroundImageType;
1088
- backgroundImageC?: BackgroundImageType;
1089
- shadow?: ShadowType;
1090
- shadowH?: ShadowType;
1091
- shadowF?: ShadowType;
1092
- shadowF?: ShadowType;
1093
- shadowA?: ShadowType;
1094
- shadowC?: ShadowType;
1046
+ ${n("color", "ColorType")}
1047
+ ${n("bgColor", "ColorType")}
1048
+ ${n("borderColor", "ColorType")}
1049
+ ${n("outlineColor", "ColorType")}
1050
+ ${n("background", "BackgroundType")}
1051
+ ${n("backgroundImage", "BackgroundImageType")}
1052
+ ${n("shadow", "ShadowType")}
1095
1053
  }
1096
1054
 
1097
1055
  interface SvgProps {
1098
- fill?: ColorType;
1099
- fillH?: ColorType;
1100
- fillF?: ColorType;
1101
- fillA?: ColorType;
1102
- fillC?: ColorType;
1103
- stroke?: ColorType;
1104
- strokeH?: ColorType;
1105
- strokeF?: ColorType;
1106
- strokeA?: ColorType;
1107
- strokeC?: ColorType;
1056
+ ${n("fill", "ColorType")}
1057
+ ${n("stroke", "ColorType")}
1108
1058
  }
1109
1059
  }
1110
1060
  }
1111
1061
  `;
1112
1062
  return {
1113
- variables: h.join(`
1063
+ variables: s.join(`
1114
1064
  `),
1115
- boxDts: V
1065
+ boxDts: k
1116
1066
  };
1117
1067
  }
1118
- s.setupAugmentedProps = c;
1119
- function v() {
1120
- a(j), Object.keys(j).forEach((f) => {
1121
- const g = s.Styles[f], p = j[f];
1122
- g ? (g.styles = { ...p.styles, ...g.styles }, g.disabled && p.disabled && (g.disabled = { ...p.disabled, ...g.disabled })) : s.Styles[f] = j[f];
1068
+ u.setupAugmentedProps = m;
1069
+ function n(v, d) {
1070
+ const c = X.map((p) => ` ${v}${p}?: ${d};`);
1071
+ return c.unshift(` ${v}?: ${d};`), c.join(`
1072
+ `);
1073
+ }
1074
+ function a() {
1075
+ b(T), $(T), Object.keys(T).forEach((d) => {
1076
+ const c = u.Styles[d], p = T[d];
1077
+ c ? c.styles = { ...p.styles, ...c.styles } : u.Styles[d] = T[d];
1123
1078
  });
1124
1079
  }
1125
- function a(n) {
1126
- if (!n.components)
1080
+ function b(v) {
1081
+ if (!v.components)
1127
1082
  return;
1128
- const f = Object.keys(n.components);
1129
- for (const g of f) {
1130
- const p = n.components[g], y = d(g, p);
1083
+ const d = Object.keys(v.components);
1084
+ for (const c of d) {
1085
+ const p = v.components[c], h = V(c, p);
1131
1086
  delete p.children;
1132
- for (const k of y) {
1133
- const [h, o] = k;
1134
- n.components[h] = o;
1087
+ for (const l of h) {
1088
+ const [s, t] = l;
1089
+ v.components[s] = t;
1135
1090
  }
1136
1091
  }
1137
1092
  }
1138
- function d(n, f) {
1139
- if (!f.children)
1093
+ function V(v, d) {
1094
+ if (!d.children)
1140
1095
  return [];
1141
- const g = Object.keys(f.children), p = [];
1142
- for (const y of g) {
1143
- const k = `${n}.${y}`, h = f.children[y], o = d(k, h);
1144
- p.push(...o), delete h.children, p.push([k, h]);
1096
+ const c = Object.keys(d.children), p = [];
1097
+ for (const h of c) {
1098
+ const l = `${v}.${h}`, s = d.children[h], t = V(l, s);
1099
+ p.push(...t), delete s.children, p.push([l, s]);
1145
1100
  }
1146
1101
  return p;
1147
1102
  }
1103
+ function $(v) {
1104
+ const { components: d, ...c } = v, p = Object.values(c);
1105
+ d && p.push(...Object.values(d));
1106
+ for (const h of p)
1107
+ "disabled" in h.styles && (Object.entries(h.styles.disabled).map(([l, s]) => {
1108
+ h.styles[`${l}Disabled`] = s;
1109
+ }), delete h.styles.disabled);
1110
+ }
1148
1111
  })(O || (O = {}));
1149
- const P = O;
1150
- function ae(s) {
1151
- const { clean: l, disabled: c, theme: v, component: a } = s;
1152
- return W(() => {
1153
- var f, g, p;
1154
- if (l)
1112
+ const D = O;
1113
+ function K(u) {
1114
+ const { clean: r, theme: m, component: n } = u;
1115
+ return P(() => {
1116
+ var b, V;
1117
+ if (r)
1155
1118
  return;
1156
- let d = P.Styles[a] ?? ((f = P.Styles.components) == null ? void 0 : f[a]);
1157
- if (!d)
1158
- return;
1159
- let n = v ? { ...d.styles, ...(g = d.themes) == null ? void 0 : g[v].styles } : d.styles;
1160
- return c ? v ? { ...n, ...d.disabled, ...(p = d.themes) == null ? void 0 : p[v].disabled } : { ...n, ...d.disabled } : n;
1161
- }, [a, l, c, v]);
1162
- }
1163
- const se = typeof window < "u" && typeof window.document < "u", le = se ? U : X;
1164
- function te(s, l) {
1165
- const c = ae(s);
1166
- return le(A.flush, [s]), W(() => {
1167
- const v = [l ? A.svgClassName : A.boxClassName], a = c ? { ...B(c), ...B(s) } : B(s);
1168
- return "inline" in a && (a.display === "block" || !a.display ? a.display = "inline-block" : a.display === "flex" ? a.display = "inline-flex" : a.display === "grid" && (a.display = "inline-grid"), delete a.inline), "inlineH" in a && (a.displayH === "block" || !a.displayH ? a.displayH = "inline-block" : a.displayH === "flex" ? a.displayH = "inline-flex" : a.displayH === "grid" && (a.displayH = "inline-grid"), delete a.inlineH), "inlineF" in a && (a.displayF === "block" || !a.displayF ? a.displayF = "inline-block" : a.displayF === "flex" ? a.displayF = "inline-flex" : a.displayF === "grid" && (a.displayF = "inline-grid"), delete a.inlineF), "inlineA" in a && (a.displayA === "block" || !a.displayA ? a.displayA = "inline-block" : a.displayA === "flex" ? a.displayA = "inline-flex" : a.displayA === "grid" && (a.displayA = "inline-grid"), delete a.inlineA), Object.entries(a).forEach(([d, n]) => {
1169
- v.push(A.get(d, n));
1170
- }), v;
1171
- }, [s, c]);
1119
+ let a = D.Styles[n] ?? ((b = D.Styles.components) == null ? void 0 : b[n]);
1120
+ if (a)
1121
+ return m ? { ...a.styles, ...(V = a.themes) == null ? void 0 : V[m].styles } : a.styles;
1122
+ }, [n, r, m]);
1172
1123
  }
1173
- function B(s) {
1174
- const l = { ...s };
1175
- return Object.keys(l).forEach((v) => {
1176
- const a = z[v];
1177
- a && (a.key in l || (l[a.key] = l[v]), delete l[v]);
1178
- }), l;
1124
+ const ee = typeof window < "u" && typeof window.document < "u", se = ee ? G : M;
1125
+ function te(u, r) {
1126
+ const m = K(u);
1127
+ return se(S.flush, [u]), P(() => {
1128
+ const n = [r ? S.svgClassName : S.boxClassName], a = m ? { ...m, ...u } : { ...u };
1129
+ return Array.isArray(a.disabled) && (Object.entries(a.disabled[1]).forEach(([b, V]) => {
1130
+ a[`${b}Disabled`] = V;
1131
+ }), delete a.disabled), "inline" in a && (a.display === "block" || !a.display ? a.display = "inline-block" : a.display === "flex" ? a.display = "inline-flex" : a.display === "grid" && (a.display = "inline-grid"), delete a.inline), "inlineH" in a && (a.displayH === "block" || !a.displayH ? a.displayH = "inline-block" : a.displayH === "flex" ? a.displayH = "inline-flex" : a.displayH === "grid" && (a.displayH = "inline-grid"), delete a.inlineH), "inlineF" in a && (a.displayF === "block" || !a.displayF ? a.displayF = "inline-block" : a.displayF === "flex" ? a.displayF = "inline-flex" : a.displayF === "grid" && (a.displayF = "inline-grid"), delete a.inlineF), "inlineA" in a && (a.displayA === "block" || !a.displayA ? a.displayA = "inline-block" : a.displayA === "flex" ? a.displayA = "inline-flex" : a.displayA === "grid" && (a.displayA = "inline-grid"), delete a.inlineA), Object.entries(a).forEach(([b, V]) => {
1132
+ n.push(S.get(b, V));
1133
+ }), n;
1134
+ }, [u, m]);
1179
1135
  }
1180
- function ue(...s) {
1181
- return s.reduce((l, c) => c ? typeof c == "string" ? (l.push(c), l) : Array.isArray(c) ? (l.push(...ue(...c)), l) : (Object.entries(c).forEach(([v, a]) => {
1182
- a && l.push(v);
1183
- }), l) : l, []);
1136
+ function ae(...u) {
1137
+ return u.reduce((r, m) => m ? typeof m == "string" ? (r.push(m), r) : Array.isArray(m) ? (r.push(...ae(...m)), r) : (Object.entries(m).forEach(([n, a]) => {
1138
+ a && r.push(n);
1139
+ }), r) : r, []);
1184
1140
  }
1185
1141
  export {
1186
- A as S,
1187
- P as T,
1188
- ue as c,
1142
+ S,
1143
+ D as T,
1144
+ ae as c,
1189
1145
  te as u
1190
1146
  };