@cronocode/react-box 1.7.3 → 1.7.4

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.
Files changed (2) hide show
  1. package/core.js +248 -246
  2. package/package.json +1 -1
package/core.js CHANGED
@@ -1,68 +1,68 @@
1
- import { useMemo as P, useLayoutEffect as U, useEffect as X } from "react";
1
+ import { useMemo as D, useLayoutEffect as q, useEffect as U } from "react";
2
2
  var e;
3
3
  ((u) => {
4
- ((a) => {
5
- function c(s, n) {
4
+ ((l) => {
5
+ function m(s, n) {
6
6
  return `${s}${n.replace("/", "-")}`;
7
7
  }
8
- a.fraction = c;
9
- function v(s) {
8
+ l.fraction = m;
9
+ function c(s) {
10
10
  return [`${s} path`, `${s} circle`, `${s} rect`, `${s} line`];
11
11
  }
12
- a.svg = v;
13
- })(u.ClassName || (u.ClassName = {})), ((a) => {
14
- function c(t, l) {
15
- return `${l / 4}rem`;
12
+ l.svg = c;
13
+ })(u.ClassName || (u.ClassName = {})), ((l) => {
14
+ function m(o, a) {
15
+ return `${a / 4}rem`;
16
16
  }
17
- a.rem = c;
18
- function v(t, l) {
19
- return `${l}px`;
17
+ l.rem = m;
18
+ function c(o, a) {
19
+ return `${a}px`;
20
20
  }
21
- a.px = v;
22
- function s(t, l) {
23
- const [r, f] = l.split("/");
24
- return `${+r / +f * 100}%`;
21
+ l.px = c;
22
+ function s(o, a) {
23
+ const [v, g] = a.split("/");
24
+ return `${+v / +g * 100}%`;
25
25
  }
26
- a.fraction = s;
27
- function n(t, l) {
28
- switch (l) {
26
+ l.fraction = s;
27
+ function n(o, a) {
28
+ switch (a) {
29
29
  case "fit":
30
30
  return "100%";
31
31
  case "fit-screen":
32
- return t.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
32
+ return o.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
33
33
  default:
34
- return l;
34
+ return a;
35
35
  }
36
36
  }
37
- a.widthHeight = n;
38
- function d(t) {
39
- return (l, r) => `var(--${t}${r});`;
37
+ l.widthHeight = n;
38
+ function f(o) {
39
+ return (a, v) => `var(--${o}${v});`;
40
40
  }
41
- a.variables = d;
42
- function p(t) {
43
- return (l, r) => `var(--${t}${r});`;
41
+ l.variables = f;
42
+ function b(o) {
43
+ return (a, v) => `var(--${o}${v});`;
44
44
  }
45
- a.svgVariables = p;
46
- function h(t, l) {
47
- return `repeat(${l},minmax(0,1fr))`;
45
+ l.svgVariables = b;
46
+ function h(o, a) {
47
+ return `repeat(${a},minmax(0,1fr))`;
48
48
  }
49
- a.gridColumns = h;
50
- function g(t, l) {
51
- return l === "full-row" ? "1/-1" : `span ${l}/span ${l}`;
49
+ l.gridColumns = h;
50
+ function p(o, a) {
51
+ return a === "full-row" ? "1/-1" : `span ${a}/span ${a}`;
52
52
  }
53
- a.gridColumn = g;
54
- function V(t, l) {
55
- return `${l}ms`;
53
+ l.gridColumn = p;
54
+ function V(o, a) {
55
+ return `${a}ms`;
56
56
  }
57
- a.ms = V;
58
- function N(t, l) {
59
- return `${l}deg`;
57
+ l.ms = V;
58
+ function C(o, a) {
59
+ return `${a}deg`;
60
60
  }
61
- a.rotate = N;
62
- function T(t, l) {
63
- return l === "xAxis" ? "-1 1" : "1 -1";
61
+ l.rotate = C;
62
+ function r(o, a) {
63
+ return a === "xAxis" ? "-1 1" : "1 -1";
64
64
  }
65
- a.flip = T;
65
+ l.flip = r;
66
66
  })(u.Value || (u.Value = {}));
67
67
  })(e || (e = {}));
68
68
  const i = [
@@ -117,7 +117,7 @@ const i = [
117
117
  92,
118
118
  96,
119
119
  100
120
- ], Y = [
120
+ ], X = [
121
121
  -1,
122
122
  -2,
123
123
  -3,
@@ -163,7 +163,7 @@ const i = [
163
163
  -92,
164
164
  -96,
165
165
  -100
166
- ], m = [...i, ...Y], E = ["solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset", "none", "hidden"], A = ["auto", "hidden", "scroll", "visible"], x = [
166
+ ], d = [...i, ...X], O = ["solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset", "none", "hidden"], j = ["auto", "hidden", "scroll", "visible"], w = [
167
167
  "1/2",
168
168
  "1/3",
169
169
  "2/3",
@@ -190,7 +190,7 @@ const i = [
190
190
  "9/12",
191
191
  "10/12",
192
192
  "11/12"
193
- ], k = ["fit", "fit-screen", "auto", "fit-content", "max-content", "min-content"], L = ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"], o = {
193
+ ], x = ["fit", "fit-screen", "auto", "fit-content", "max-content", "min-content"], R = ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"], t = {
194
194
  /** 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
195
  display: {
196
196
  cssNames: ["display"],
@@ -214,60 +214,60 @@ const i = [
214
214
  },
215
215
  width: {
216
216
  cssNames: ["width"],
217
- values1: { values: k, formatValue: e.Value.widthHeight },
217
+ values1: { values: x, formatValue: e.Value.widthHeight },
218
218
  values2: { values: i, formatValue: e.Value.rem },
219
219
  values3: {
220
- values: x,
220
+ values: w,
221
221
  formatValue: e.Value.fraction
222
222
  // formatClassName: BoxStylesFormatters.ClassName.fraction,
223
223
  }
224
224
  },
225
225
  minWidth: {
226
226
  cssNames: ["min-width"],
227
- values1: { values: k, formatValue: e.Value.widthHeight },
227
+ values1: { values: x, formatValue: e.Value.widthHeight },
228
228
  values2: { values: i, formatValue: e.Value.rem },
229
229
  values3: {
230
- values: x,
230
+ values: w,
231
231
  formatValue: e.Value.fraction
232
232
  // formatClassName: BoxStylesFormatters.ClassName.fraction,
233
233
  }
234
234
  },
235
235
  maxWidth: {
236
236
  cssNames: ["max-width"],
237
- values1: { values: k, formatValue: e.Value.widthHeight },
237
+ values1: { values: x, formatValue: e.Value.widthHeight },
238
238
  values2: { values: i, formatValue: e.Value.rem },
239
239
  values3: {
240
- values: x,
240
+ values: w,
241
241
  formatValue: e.Value.fraction
242
242
  // formatClassName: BoxStylesFormatters.ClassName.fraction,
243
243
  }
244
244
  },
245
245
  height: {
246
246
  cssNames: ["height"],
247
- values1: { values: k, formatValue: e.Value.widthHeight },
247
+ values1: { values: x, formatValue: e.Value.widthHeight },
248
248
  values2: { values: i, formatValue: e.Value.rem },
249
249
  values3: {
250
- values: x,
250
+ values: w,
251
251
  formatValue: e.Value.fraction
252
252
  // formatClassName: BoxStylesFormatters.ClassName.fraction,
253
253
  }
254
254
  },
255
255
  minHeight: {
256
256
  cssNames: ["min-height"],
257
- values1: { values: k, formatValue: e.Value.widthHeight },
257
+ values1: { values: x, formatValue: e.Value.widthHeight },
258
258
  values2: { values: i, formatValue: e.Value.rem },
259
259
  values3: {
260
- values: x,
260
+ values: w,
261
261
  formatValue: e.Value.fraction
262
262
  // formatClassName: BoxStylesFormatters.ClassName.fraction,
263
263
  }
264
264
  },
265
265
  maxHeight: {
266
266
  cssNames: ["max-height"],
267
- values1: { values: k, formatValue: e.Value.widthHeight },
267
+ values1: { values: x, formatValue: e.Value.widthHeight },
268
268
  values2: { values: i, formatValue: e.Value.rem },
269
269
  values3: {
270
- values: x,
270
+ values: w,
271
271
  formatValue: e.Value.fraction
272
272
  // formatClassName: BoxStylesFormatters.ClassName.fraction,
273
273
  }
@@ -280,115 +280,115 @@ const i = [
280
280
  },
281
281
  top: {
282
282
  cssNames: ["top"],
283
- values1: { values: m, formatValue: e.Value.rem },
283
+ values1: { values: d, formatValue: e.Value.rem },
284
284
  values2: { values: [] },
285
285
  values3: { values: [] }
286
286
  },
287
287
  right: {
288
288
  cssNames: ["right"],
289
- values1: { values: m, formatValue: e.Value.rem },
289
+ values1: { values: d, formatValue: e.Value.rem },
290
290
  values2: { values: [] },
291
291
  values3: { values: [] }
292
292
  },
293
293
  bottom: {
294
294
  cssNames: ["bottom"],
295
- values1: { values: m, formatValue: e.Value.rem },
295
+ values1: { values: d, formatValue: e.Value.rem },
296
296
  values2: { values: [] },
297
297
  values3: { values: [] }
298
298
  },
299
299
  left: {
300
300
  cssNames: ["left"],
301
- values1: { values: m, formatValue: e.Value.rem },
301
+ values1: { values: d, formatValue: e.Value.rem },
302
302
  values2: { values: [] },
303
303
  values3: { values: [] }
304
304
  },
305
305
  inset: {
306
306
  cssNames: ["inset"],
307
- values1: { values: m, formatValue: e.Value.rem },
307
+ values1: { values: d, formatValue: e.Value.rem },
308
308
  values2: { values: [] },
309
309
  values3: { values: [] }
310
310
  },
311
311
  margin: {
312
312
  cssNames: ["margin"],
313
- values1: { values: m, formatValue: e.Value.rem },
313
+ values1: { values: d, formatValue: e.Value.rem },
314
314
  values2: { values: ["auto"] },
315
315
  values3: { values: [] }
316
316
  },
317
317
  marginHorizontal: {
318
318
  cssNames: ["margin-inline"],
319
- values1: { values: m, formatValue: e.Value.rem },
319
+ values1: { values: d, formatValue: e.Value.rem },
320
320
  values2: { values: ["auto"] },
321
321
  values3: { values: [] }
322
322
  },
323
323
  marginVertical: {
324
324
  cssNames: ["margin-block"],
325
- values1: { values: m, formatValue: e.Value.rem },
325
+ values1: { values: d, formatValue: e.Value.rem },
326
326
  values2: { values: ["auto"] },
327
327
  values3: { values: [] }
328
328
  },
329
329
  marginTop: {
330
330
  cssNames: ["margin-top"],
331
- values1: { values: m, formatValue: e.Value.rem },
331
+ values1: { values: d, formatValue: e.Value.rem },
332
332
  values2: { values: ["auto"] },
333
333
  values3: { values: [] }
334
334
  },
335
335
  marginRight: {
336
336
  cssNames: ["margin-right"],
337
- values1: { values: m, formatValue: e.Value.rem },
337
+ values1: { values: d, formatValue: e.Value.rem },
338
338
  values2: { values: ["auto"] },
339
339
  values3: { values: [] }
340
340
  },
341
341
  marginBottom: {
342
342
  cssNames: ["margin-bottom"],
343
- values1: { values: m, formatValue: e.Value.rem },
343
+ values1: { values: d, formatValue: e.Value.rem },
344
344
  values2: { values: ["auto"] },
345
345
  values3: { values: [] }
346
346
  },
347
347
  marginLeft: {
348
348
  cssNames: ["margin-left"],
349
- values1: { values: m, formatValue: e.Value.rem },
349
+ values1: { values: d, formatValue: e.Value.rem },
350
350
  values2: { values: ["auto"] },
351
351
  values3: { values: [] }
352
352
  },
353
353
  padding: {
354
354
  cssNames: ["padding"],
355
- values1: { values: m, formatValue: e.Value.rem },
355
+ values1: { values: d, formatValue: e.Value.rem },
356
356
  values2: { values: [] },
357
357
  values3: { values: [] }
358
358
  },
359
359
  paddingHorizontal: {
360
360
  cssNames: ["padding-inline"],
361
- values1: { values: m, formatValue: e.Value.rem },
361
+ values1: { values: d, formatValue: e.Value.rem },
362
362
  values2: { values: [] },
363
363
  values3: { values: [] }
364
364
  },
365
365
  paddingVertical: {
366
366
  cssNames: ["padding-block"],
367
- values1: { values: m, formatValue: e.Value.rem },
367
+ values1: { values: d, formatValue: e.Value.rem },
368
368
  values2: { values: [] },
369
369
  values3: { values: [] }
370
370
  },
371
371
  paddingTop: {
372
372
  cssNames: ["padding-top"],
373
- values1: { values: m, formatValue: e.Value.rem },
373
+ values1: { values: d, formatValue: e.Value.rem },
374
374
  values2: { values: [] },
375
375
  values3: { values: [] }
376
376
  },
377
377
  paddingRight: {
378
378
  cssNames: ["padding-right"],
379
- values1: { values: m, formatValue: e.Value.rem },
379
+ values1: { values: d, formatValue: e.Value.rem },
380
380
  values2: { values: [] },
381
381
  values3: { values: [] }
382
382
  },
383
383
  paddingBottom: {
384
384
  cssNames: ["padding-bottom"],
385
- values1: { values: m, formatValue: e.Value.rem },
385
+ values1: { values: d, formatValue: e.Value.rem },
386
386
  values2: { values: [] },
387
387
  values3: { values: [] }
388
388
  },
389
389
  paddingLeft: {
390
390
  cssNames: ["padding-left"],
391
- values1: { values: m, formatValue: e.Value.rem },
391
+ values1: { values: d, formatValue: e.Value.rem },
392
392
  values2: { values: [] },
393
393
  values3: { values: [] }
394
394
  },
@@ -400,43 +400,43 @@ const i = [
400
400
  },
401
401
  borderHorizontal: {
402
402
  cssNames: ["border-inline-width"],
403
- values1: { values: m, formatValue: e.Value.px },
403
+ values1: { values: d, formatValue: e.Value.px },
404
404
  values2: { values: [] },
405
405
  values3: { values: [] }
406
406
  },
407
407
  borderVertical: {
408
408
  cssNames: ["border-block-width"],
409
- values1: { values: m, formatValue: e.Value.px },
409
+ values1: { values: d, formatValue: e.Value.px },
410
410
  values2: { values: [] },
411
411
  values3: { values: [] }
412
412
  },
413
413
  borderTop: {
414
414
  cssNames: ["border-top-width"],
415
- values1: { values: m, formatValue: e.Value.px },
415
+ values1: { values: d, formatValue: e.Value.px },
416
416
  values2: { values: [] },
417
417
  values3: { values: [] }
418
418
  },
419
419
  borderRight: {
420
420
  cssNames: ["border-right-width"],
421
- values1: { values: m, formatValue: e.Value.px },
421
+ values1: { values: d, formatValue: e.Value.px },
422
422
  values2: { values: [] },
423
423
  values3: { values: [] }
424
424
  },
425
425
  borderBottom: {
426
426
  cssNames: ["border-bottom-width"],
427
- values1: { values: m, formatValue: e.Value.px },
427
+ values1: { values: d, formatValue: e.Value.px },
428
428
  values2: { values: [] },
429
429
  values3: { values: [] }
430
430
  },
431
431
  borderLeft: {
432
432
  cssNames: ["border-left-width"],
433
- values1: { values: m, formatValue: e.Value.px },
433
+ values1: { values: d, formatValue: e.Value.px },
434
434
  values2: { values: [] },
435
435
  values3: { values: [] }
436
436
  },
437
437
  borderStyle: {
438
438
  cssNames: ["border-style"],
439
- values1: { values: E },
439
+ values1: { values: O },
440
440
  values2: { values: [] },
441
441
  values3: { values: [] }
442
442
  },
@@ -549,19 +549,19 @@ const i = [
549
549
  },
550
550
  overflow: {
551
551
  cssNames: ["overflow"],
552
- values1: { values: A },
552
+ values1: { values: j },
553
553
  values2: { values: [] },
554
554
  values3: { values: [] }
555
555
  },
556
556
  overflowX: {
557
557
  cssNames: ["overflow-x"],
558
- values1: { values: A },
558
+ values1: { values: j },
559
559
  values2: { values: [] },
560
560
  values3: { values: [] }
561
561
  },
562
562
  overflowY: {
563
563
  cssNames: ["overflow-y"],
564
- values1: { values: A },
564
+ values1: { values: j },
565
565
  values2: { values: [] },
566
566
  values3: { values: [] }
567
567
  },
@@ -722,13 +722,13 @@ const i = [
722
722
  },
723
723
  alignSelf: {
724
724
  cssNames: ["align-self"],
725
- values1: { values: L },
725
+ values1: { values: R },
726
726
  values2: { values: [] },
727
727
  values3: { values: [] }
728
728
  },
729
729
  justifySelf: {
730
730
  cssNames: ["justify-self"],
731
- values1: { values: L },
731
+ values1: { values: R },
732
732
  values2: { values: [] },
733
733
  values3: { values: [] }
734
734
  },
@@ -764,7 +764,7 @@ const i = [
764
764
  },
765
765
  outlineStyle: {
766
766
  cssNames: ["outline-style"],
767
- values1: { values: E },
767
+ values1: { values: O },
768
768
  values2: { values: [] },
769
769
  values3: { values: [] }
770
770
  },
@@ -831,14 +831,14 @@ const i = [
831
831
  values2: { values: [] },
832
832
  values3: { values: [] }
833
833
  }
834
- }, I = {
834
+ }, L = {
835
835
  shadow: { cssNames: ["box-shadow"], formatValue: e.Value.variables("shadow") },
836
836
  background: { cssNames: ["background"], formatValue: e.Value.variables("background") },
837
837
  color: { cssNames: ["color"], formatValue: e.Value.variables("color") },
838
838
  bgColor: { cssNames: ["background-color"], formatValue: e.Value.variables("color") },
839
839
  borderColor: { cssNames: ["border-color"], formatValue: e.Value.variables("color") },
840
840
  outlineColor: { cssNames: ["outline-color"], formatValue: e.Value.variables("color") }
841
- }, _ = {
841
+ }, I = {
842
842
  fill: {
843
843
  cssNames: ["fill"],
844
844
  formatValue: e.Value.svgVariables("color"),
@@ -849,140 +849,142 @@ const i = [
849
849
  formatValue: e.Value.svgVariables("color"),
850
850
  formatSelector: e.ClassName.svg
851
851
  }
852
- }, J = ["H", "F", "A"], z = {
852
+ }, Y = ["H", "F", "A"], H = {
853
853
  hover: { className: "_h" },
854
854
  focus: { className: "_f" }
855
855
  };
856
- Object.keys(I).forEach((u) => {
857
- o[u] = I[u], o[u].isThemeStyle = !0;
856
+ Object.keys(L).forEach((u) => {
857
+ t[u] = L[u], t[u].isThemeStyle = !0;
858
858
  });
859
- Object.keys(_).forEach((u) => {
860
- o[u] = _[u], o[u].isThemeStyle = !0;
859
+ Object.keys(I).forEach((u) => {
860
+ t[u] = I[u], t[u].isThemeStyle = !0;
861
861
  });
862
- const C = {
863
- w: { ...o.width, key: "width" },
864
- h: { ...o.height, key: "height" },
865
- m: { ...o.margin, key: "margin" },
866
- mx: { ...o.marginHorizontal, key: "marginHorizontal" },
867
- my: { ...o.marginVertical, key: "marginVertical" },
868
- mt: { ...o.marginTop, key: "marginTop" },
869
- mr: { ...o.marginRight, key: "marginRight" },
870
- mb: { ...o.marginBottom, key: "marginBottom" },
871
- ml: { ...o.marginLeft, key: "marginLeft" },
872
- p: { ...o.padding, key: "padding" },
873
- px: { ...o.paddingHorizontal, key: "paddingHorizontal" },
874
- py: { ...o.paddingVertical, key: "paddingVertical" },
875
- pt: { ...o.paddingTop, key: "paddingTop" },
876
- pr: { ...o.paddingRight, key: "paddingRight" },
877
- pb: { ...o.paddingBottom, key: "paddingBottom" },
878
- pl: { ...o.paddingLeft, key: "paddingLeft" },
879
- b: { ...o.border, key: "border" },
880
- bx: { ...o.borderHorizontal, key: "borderHorizontal" },
881
- by: { ...o.borderVertical, key: "borderVertical" },
882
- bt: { ...o.borderTop, key: "borderTop" },
883
- br: { ...o.borderRight, key: "borderRight" },
884
- bb: { ...o.borderBottom, key: "borderBottom" },
885
- bl: { ...o.borderLeft, key: "borderLeft" },
886
- jc: { ...o.justifyContent, key: "justifyContent" },
887
- ai: { ...o.alignItems, key: "alignItems" },
888
- ac: { ...o.alignContent, key: "alignContent" },
889
- d: { ...o.flexDirection, key: "flexDirection" }
890
- }, Q = Object.keys(o), Z = Object.keys(C);
891
- J.forEach((u) => {
892
- Q.forEach((a) => {
893
- o[`${a}${u}`] = { ...o[a] }, o[`${a}${u}`].pseudoSuffix = u;
894
- }), Z.forEach((a) => {
895
- C[`${a}${u}`] = { ...C[a], key: `${C[a].key}${u}` }, C[`${a}${u}`].pseudoSuffix = u;
862
+ const k = {
863
+ w: { ...t.width, key: "width" },
864
+ h: { ...t.height, key: "height" },
865
+ m: { ...t.margin, key: "margin" },
866
+ mx: { ...t.marginHorizontal, key: "marginHorizontal" },
867
+ my: { ...t.marginVertical, key: "marginVertical" },
868
+ mt: { ...t.marginTop, key: "marginTop" },
869
+ mr: { ...t.marginRight, key: "marginRight" },
870
+ mb: { ...t.marginBottom, key: "marginBottom" },
871
+ ml: { ...t.marginLeft, key: "marginLeft" },
872
+ p: { ...t.padding, key: "padding" },
873
+ px: { ...t.paddingHorizontal, key: "paddingHorizontal" },
874
+ py: { ...t.paddingVertical, key: "paddingVertical" },
875
+ pt: { ...t.paddingTop, key: "paddingTop" },
876
+ pr: { ...t.paddingRight, key: "paddingRight" },
877
+ pb: { ...t.paddingBottom, key: "paddingBottom" },
878
+ pl: { ...t.paddingLeft, key: "paddingLeft" },
879
+ b: { ...t.border, key: "border" },
880
+ bx: { ...t.borderHorizontal, key: "borderHorizontal" },
881
+ by: { ...t.borderVertical, key: "borderVertical" },
882
+ bt: { ...t.borderTop, key: "borderTop" },
883
+ br: { ...t.borderRight, key: "borderRight" },
884
+ bb: { ...t.borderBottom, key: "borderBottom" },
885
+ bl: { ...t.borderLeft, key: "borderLeft" },
886
+ jc: { ...t.justifyContent, key: "justifyContent" },
887
+ ai: { ...t.alignItems, key: "alignItems" },
888
+ ac: { ...t.alignContent, key: "alignContent" },
889
+ d: { ...t.flexDirection, key: "flexDirection" }
890
+ }, J = Object.keys(t), Q = Object.keys(k);
891
+ Y.forEach((u) => {
892
+ J.forEach((l) => {
893
+ t[`${l}${u}`] = { ...t[l] }, t[`${l}${u}`].pseudoSuffix = u;
894
+ }), Q.forEach((l) => {
895
+ k[`${l}${u}`] = { ...k[l], key: `${k[l].key}${u}` }, k[`${l}${u}`].pseudoSuffix = u;
896
896
  });
897
897
  });
898
- class K {
898
+ class Z {
899
899
  constructor() {
900
900
  this._index = 0, this._cache = {};
901
901
  }
902
- getIdentity(a) {
903
- return this._cache[a] || (this._cache[a] = this.getByIndex(this._index++)), this._cache[a];
902
+ getIdentity(l) {
903
+ return this._cache[l] || (this._cache[l] = this.getByIndex(this._index++)), this._cache[l];
904
904
  }
905
- getByIndex(a) {
906
- const { first: c, next: v } = ee, s = a - c.length;
905
+ getByIndex(l) {
906
+ const { first: m, next: c } = K, s = l - m.length;
907
907
  if (s < 0)
908
- return c[a];
909
- const n = Math.floor(s / v.length), d = s - n * v.length;
910
- return this.getByIndex(n) + v[d];
908
+ return m[l];
909
+ const n = Math.floor(s / c.length), f = s - n * c.length;
910
+ return this.getByIndex(n) + c[f];
911
911
  }
912
912
  }
913
- const ee = {
913
+ const K = {
914
914
  first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
915
915
  next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
916
916
  };
917
- var F;
917
+ var B;
918
918
  ((u) => {
919
919
  u.boxClassName = "_box", u.svgClassName = "_svg";
920
- const a = `: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;}}
920
+ 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;}}
921
921
  html{font-size: 16px;font-family: Arial, sans-serif;}
922
922
  body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
923
923
  a,ul{all: unset;}
924
924
  .${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;}
925
925
  .${u.svgClassName}{transition: all var(--svgTransitionTime);}.${u.svgClassName} path,.${u.svgClassName} circle,.${u.svgClassName} rect,.${u.svgClassName} line {transition: all var(--svgTransitionTime);}
926
- `, c = new K(), v = Object.keys(o), s = T();
927
- let n = !1;
928
- const d = v.reduce(
929
- (t, l) => (t[l] = /* @__PURE__ */ new Set(), t),
926
+ `, m = new Z(), c = Object.keys(t);
927
+ let s = !1;
928
+ const n = c.reduce(
929
+ (r, o) => (r[o] = /* @__PURE__ */ new Set(), r),
930
930
  {}
931
931
  );
932
- function p(t, l) {
933
- if (t in o)
934
- return g(t, l);
935
- if (t in z)
936
- return z[t].className;
932
+ function f(r, o) {
933
+ if (r in t)
934
+ return h(r, o);
935
+ if (r in H)
936
+ return H[r].className;
937
937
  }
938
- u.get = p;
939
- function h() {
940
- if (n) {
938
+ u.get = f;
939
+ function b() {
940
+ if (s) {
941
941
  console.info("%c💬Flush Dox Styles", "color: #00ffff");
942
- let t = V([a]);
943
- t = V(t, "H"), t = V(t, "F"), t = V(t, "A"), s.innerHTML = t.join(""), n = !1;
942
+ let r = p([l]);
943
+ r = p(r, "H"), r = p(r, "F"), r = p(r, "A");
944
+ const o = C();
945
+ o.innerHTML = r.join(""), s = !1;
944
946
  }
945
947
  }
946
- u.flush = h;
947
- function g(t, l) {
948
- var b;
949
- d[t].has(l) || (n = !0, d[t].add(l));
950
- const r = N(t, l), f = ((b = r.formatClassName) == null ? void 0 : b.call(r, t, l)) ?? `${t}${l}`;
951
- return `-${c.getIdentity(f)}`;
948
+ u.flush = b;
949
+ function h(r, o) {
950
+ var g;
951
+ n[r].has(o) || (s = !0, n[r].add(o));
952
+ const a = V(r, o), v = ((g = a.formatClassName) == null ? void 0 : g.call(a, r, o)) ?? `${r}${o}`;
953
+ return `-${m.getIdentity(v)}`;
952
954
  }
953
- function V(t, l) {
954
- return Object.entries(d).filter(([f]) => {
955
- var b;
956
- return ((b = o[f]) == null ? void 0 : b.pseudoSuffix) === l;
957
- }).reduce((f, [b, W]) => (W.forEach((H) => {
958
- var R;
959
- const y = N(b, H), w = `.${g(b, H)}`;
960
- let $ = [];
961
- l ? l === "H" ? $ = [
962
- ...r(`${w}:hover`, y),
963
- ...r(`.${z.hover.className}:hover>${w}`, y)
964
- ] : l === "F" ? $ = [
965
- ...r(`${w}:focus-within`, y),
966
- ...r(`.${z.focus.className}:focus-within>${w}`, y)
967
- ] : l === "A" && ($ = r(`${w}:active`, y)) : $ = r(w, y);
968
- const G = ((R = y.formatValue) == null ? void 0 : R.call(y, b, H)) ?? H, M = o[b].cssNames.map((q) => `${q}:${G};`).join("");
969
- f.push(`${$.join(",")}{${M}}`);
970
- }), f), t);
971
- function r(f, b) {
972
- return b.formatSelector ? b.formatSelector(f) : [f];
955
+ function p(r, o) {
956
+ return Object.entries(n).filter(([v]) => {
957
+ var g;
958
+ return ((g = t[v]) == null ? void 0 : g.pseudoSuffix) === o;
959
+ }).reduce((v, [g, P]) => (P.forEach(($) => {
960
+ var E;
961
+ const y = V(g, $), N = `.${h(g, $)}`;
962
+ let T = [];
963
+ o ? o === "H" ? T = [
964
+ ...a(`${N}:hover`, y),
965
+ ...a(`.${H.hover.className}:hover>${N}`, y)
966
+ ] : o === "F" ? T = [
967
+ ...a(`${N}:focus-within`, y),
968
+ ...a(`.${H.focus.className}:focus-within>${N}`, y)
969
+ ] : o === "A" && (T = a(`${N}:active`, y)) : T = a(N, y);
970
+ const W = ((E = y.formatValue) == null ? void 0 : E.call(y, g, $)) ?? $, G = t[g].cssNames.map((M) => `${M}:${W};`).join("");
971
+ v.push(`${T.join(",")}{${G}}`);
972
+ }), v), r);
973
+ function a(v, g) {
974
+ return g.formatSelector ? g.formatSelector(v) : [v];
973
975
  }
974
976
  }
975
- function N(t, l) {
976
- const r = o[t];
977
- return r.isThemeStyle ? r : r.values1.values.includes(l) ? r.values1 : r.values2.values.includes(l) ? r.values2 : r.values3;
977
+ function V(r, o) {
978
+ const a = t[r];
979
+ return a.isThemeStyle ? a : a.values1.values.includes(o) ? a.values1 : a.values2.values.includes(o) ? a.values2 : a.values3;
978
980
  }
979
- function T() {
980
- const t = "crono-styles", r = typeof window < "u" && typeof window.document < "u" ? window.document : global.document;
981
- let f = r.getElementById(t);
982
- return f || (f = r.createElement("style"), f.setAttribute("id", t), f.setAttribute("type", "text/css"), r.head.insertBefore(f, r.head.firstChild)), f;
981
+ function C() {
982
+ const r = "crono-styles", a = typeof window < "u" && typeof window.document < "u" ? window.document : global.document;
983
+ let v = a.getElementById(r);
984
+ return v || (v = a.createElement("style"), v.setAttribute("id", r), v.setAttribute("type", "text/css"), a.head.insertBefore(v, a.head.firstChild)), v;
983
985
  }
984
- })(F || (F = {}));
985
- const S = F, j = {
986
+ })(B || (B = {}));
987
+ const z = B, S = {
986
988
  button: {
987
989
  styles: {
988
990
  display: "inline-block",
@@ -1025,25 +1027,25 @@ const S = F, j = {
1025
1027
  }
1026
1028
  }
1027
1029
  };
1028
- var O;
1030
+ var F;
1029
1031
  ((u) => {
1030
- u.Styles = j;
1031
- function a(s) {
1032
- u.Styles = s, v();
1032
+ u.Styles = S;
1033
+ function l(s) {
1034
+ u.Styles = s, c();
1033
1035
  }
1034
- u.setup = a;
1035
- function c(s, n) {
1036
- const d = Object.entries(s.colors).map(([l, r]) => `--color${l}: ${r};`).join(`
1037
- `), p = Object.entries(s.shadows).map(([l, r]) => `--shadow${l}: ${r};`).join(`
1038
- `), h = Object.entries(s.backgrounds).map(([l, r]) => `--background${l}: ${r};`).join(`
1039
- `), g = [":root {"];
1040
- d && g.push(` ${d}`), p && g.push(` ${p}`), h && g.push(` ${h}`), g.push("}");
1041
- const V = Object.keys(s.colors).map((l) => `'${l}'`).join(" | "), N = Object.keys(s.backgrounds).map((l) => `'${l}'`).join(" | "), T = Object.keys(s.shadows).map((l) => `'${l}'`).join(" | "), t = `import '@cronocode/react-box';
1036
+ u.setup = l;
1037
+ function m(s, n) {
1038
+ const f = Object.entries(s.colors).map(([a, v]) => `--color${a}: ${v};`).join(`
1039
+ `), b = Object.entries(s.shadows).map(([a, v]) => `--shadow${a}: ${v};`).join(`
1040
+ `), h = Object.entries(s.backgrounds).map(([a, v]) => `--background${a}: ${v};`).join(`
1041
+ `), p = [":root {"];
1042
+ f && p.push(` ${f}`), b && p.push(` ${b}`), h && p.push(` ${h}`), p.push("}");
1043
+ const V = Object.keys(s.colors).map((a) => `'${a}'`).join(" | "), C = Object.keys(s.backgrounds).map((a) => `'${a}'`).join(" | "), r = Object.keys(s.shadows).map((a) => `'${a}'`).join(" | "), o = `import '@cronocode/react-box';
1042
1044
 
1043
1045
  declare module '${(n == null ? void 0 : n.namespacePath) ?? "@cronocode/react-box/core/types"}' {
1044
1046
  type ColorType = ${V};
1045
- type BackgroundType = ${N};
1046
- type ShadowType = ${T};
1047
+ type BackgroundType = ${C};
1048
+ type ShadowType = ${r};
1047
1049
 
1048
1050
  namespace Augmented {
1049
1051
  interface BoxProps {
@@ -1087,58 +1089,58 @@ var O;
1087
1089
  }
1088
1090
  `;
1089
1091
  return {
1090
- variables: g.join(`
1092
+ variables: p.join(`
1091
1093
  `),
1092
- boxDts: t
1094
+ boxDts: o
1093
1095
  };
1094
1096
  }
1095
- u.setupAugmentedProps = c;
1096
- function v() {
1097
- Object.keys(j).forEach((n) => {
1098
- const d = u.Styles[n], p = j[n];
1099
- d ? (d.styles = { ...p.styles, ...d.styles }, d.disabled && p.disabled && (d.disabled = { ...p.disabled, ...d.disabled })) : u.Styles[n] = j[n];
1097
+ u.setupAugmentedProps = m;
1098
+ function c() {
1099
+ Object.keys(S).forEach((n) => {
1100
+ const f = u.Styles[n], b = S[n];
1101
+ f ? (f.styles = { ...b.styles, ...f.styles }, f.disabled && b.disabled && (f.disabled = { ...b.disabled, ...f.disabled })) : u.Styles[n] = S[n];
1100
1102
  });
1101
1103
  }
1102
- })(O || (O = {}));
1103
- const D = O;
1104
- function se(u) {
1105
- const { clean: a, disabled: c, theme: v, component: s } = u;
1106
- return P(() => {
1107
- var p, h, g;
1108
- if (a)
1104
+ })(F || (F = {}));
1105
+ const _ = F;
1106
+ function ee(u) {
1107
+ const { clean: l, disabled: m, theme: c, component: s } = u;
1108
+ return D(() => {
1109
+ var b, h, p;
1110
+ if (l)
1109
1111
  return;
1110
- let n = D.Styles[s] ?? ((p = D.Styles.components) == null ? void 0 : p[s]);
1112
+ let n = _.Styles[s] ?? ((b = _.Styles.components) == null ? void 0 : b[s]);
1111
1113
  if (!n)
1112
1114
  return;
1113
- let d = v ? { ...n.styles, ...(h = n.themes) == null ? void 0 : h[v].styles } : n.styles;
1114
- return c ? v ? { ...d, ...n.disabled, ...(g = n.themes) == null ? void 0 : g[v].disabled } : { ...d, ...n.disabled } : d;
1115
- }, [s, a, c, v]);
1115
+ let f = c ? { ...n.styles, ...(h = n.themes) == null ? void 0 : h[c].styles } : n.styles;
1116
+ return m ? c ? { ...f, ...n.disabled, ...(p = n.themes) == null ? void 0 : p[c].disabled } : { ...f, ...n.disabled } : f;
1117
+ }, [s, l, m, c]);
1116
1118
  }
1117
- const ae = typeof window < "u" && typeof window.document < "u", le = ae ? U : X;
1118
- function re(u, a) {
1119
- const c = se(u);
1120
- return le(S.flush, [u]), P(() => {
1121
- const v = [a ? S.svgClassName : S.boxClassName], s = c ? { ...B(c), ...B(u) } : B(u);
1122
- return "inline" in s && (s.display === "block" ? s.display = "inline-block" : s.display === "flex" ? s.display = "inline-flex" : s.display === "grid" && (s.display = "inline-grid"), delete s.inline), "inlineH" in s && (s.displayH === "block" ? s.displayH = "inline-block" : s.displayH === "flex" ? s.displayH = "inline-flex" : s.displayH === "grid" && (s.displayH = "inline-grid"), delete s.inlineH), "inlineF" in s && (s.displayF === "block" ? s.displayF = "inline-block" : s.displayF === "flex" ? s.displayF = "inline-flex" : s.displayF === "grid" && (s.displayF = "inline-grid"), delete s.inlineF), "inlineA" in s && (s.displayA === "block" ? s.displayA = "inline-block" : s.displayA === "flex" ? s.displayA = "inline-flex" : s.displayA === "grid" && (s.displayA = "inline-grid"), delete s.inlineA), Object.entries(s).forEach(([n, d]) => {
1123
- v.push(S.get(n, d));
1124
- }), v;
1125
- }, [u, c]);
1119
+ const se = typeof window < "u" && typeof window.document < "u", ae = se ? q : U;
1120
+ function oe(u, l) {
1121
+ const m = ee(u);
1122
+ return ae(z.flush, [u]), D(() => {
1123
+ const c = [l ? z.svgClassName : z.boxClassName], s = m ? { ...A(m), ...A(u) } : A(u);
1124
+ return "inline" in s && (s.display === "block" ? s.display = "inline-block" : s.display === "flex" ? s.display = "inline-flex" : s.display === "grid" && (s.display = "inline-grid"), delete s.inline), "inlineH" in s && (s.displayH === "block" ? s.displayH = "inline-block" : s.displayH === "flex" ? s.displayH = "inline-flex" : s.displayH === "grid" && (s.displayH = "inline-grid"), delete s.inlineH), "inlineF" in s && (s.displayF === "block" ? s.displayF = "inline-block" : s.displayF === "flex" ? s.displayF = "inline-flex" : s.displayF === "grid" && (s.displayF = "inline-grid"), delete s.inlineF), "inlineA" in s && (s.displayA === "block" ? s.displayA = "inline-block" : s.displayA === "flex" ? s.displayA = "inline-flex" : s.displayA === "grid" && (s.displayA = "inline-grid"), delete s.inlineA), Object.entries(s).forEach(([n, f]) => {
1125
+ c.push(z.get(n, f));
1126
+ }), c;
1127
+ }, [u, m]);
1126
1128
  }
1127
- function B(u) {
1128
- const a = { ...u };
1129
- return Object.keys(a).forEach((v) => {
1130
- const s = C[v];
1131
- s && (s.key in a || (a[s.key] = a[v]), delete a[v]);
1132
- }), a;
1129
+ function A(u) {
1130
+ const l = { ...u };
1131
+ return Object.keys(l).forEach((c) => {
1132
+ const s = k[c];
1133
+ s && (s.key in l || (l[s.key] = l[c]), delete l[c]);
1134
+ }), l;
1133
1135
  }
1134
- function ue(...u) {
1135
- return u.reduce((a, c) => c ? typeof c == "string" ? (a.push(c), a) : Array.isArray(c) ? (a.push(...ue(...c)), a) : (Object.entries(c).forEach(([v, s]) => {
1136
- s && a.push(v);
1137
- }), a) : a, []);
1136
+ function le(...u) {
1137
+ return u.reduce((l, m) => m ? typeof m == "string" ? (l.push(m), l) : Array.isArray(m) ? (l.push(...le(...m)), l) : (Object.entries(m).forEach(([c, s]) => {
1138
+ s && l.push(c);
1139
+ }), l) : l, []);
1138
1140
  }
1139
1141
  export {
1140
- S,
1141
- D as T,
1142
- ue as c,
1143
- re as u
1142
+ z as S,
1143
+ _ as T,
1144
+ le as c,
1145
+ oe as u
1144
1146
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "type": "module",
5
5
  "main": "./box.js",
6
6
  "module": "./box.js",