@cronocode/react-box 1.1.9 → 1.2.0
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/box.mjs +12 -12
- package/box.module.css.mjs +2 -2
- package/components/baseSvg.mjs +15 -15
- package/package.json +3 -1
- package/style.css +1 -1
- package/types.d.ts +2 -3
- package/utils/utils.mjs +88 -78
package/types.d.ts
CHANGED
|
@@ -21,7 +21,6 @@ export declare const styleVariables: {
|
|
|
21
21
|
cursors: readonly ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "e-resize", "n-resize", "ne-resize", "nw-resize", "s-resize", "se-resize", "sw-resize", "w-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "col-resize", "row-resize", "all-scroll", "zoom-in", "zoom-out", "grab", "grabbing"];
|
|
22
22
|
sizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100];
|
|
23
23
|
sizeMultiplier: number;
|
|
24
|
-
baseColors: readonly ["none", "transparent", "black", "white", "blue", "red", "purple", "yellow", "pink", "green", "orange", "navy", "teal", "violet", "gray", "brown", "orange"];
|
|
25
24
|
borderSizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
26
25
|
fontSizes: readonly [6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 54, 58, 64, 70, 78, 86, 96];
|
|
27
26
|
fontWeight: readonly [100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
@@ -45,7 +44,7 @@ type GapType = (typeof styleVariables.gap)[number];
|
|
|
45
44
|
type BoxSizeValue = (typeof styleVariables.sizeSpecialValues)[number];
|
|
46
45
|
type BorderSizeType = (typeof styleVariables.borderSizes)[number];
|
|
47
46
|
type SizeType = (typeof styleVariables.sizes)[number];
|
|
48
|
-
export type ColorType =
|
|
47
|
+
export type ColorType = string;
|
|
49
48
|
type CursorType = (typeof styleVariables.cursors)[number];
|
|
50
49
|
type OverflowType = (typeof styleVariables.overflows)[number];
|
|
51
50
|
type FontSizeType = (typeof styleVariables.fontSizes)[number];
|
|
@@ -212,5 +211,5 @@ interface BoxUserSelect {
|
|
|
212
211
|
}
|
|
213
212
|
type BoxNormalStyles = BoxPseudoClasses & BoxDisplay & BoxSizing & BoxPosition & BoxSize & BoxMargin & BoxPadding & BoxBorder & BoxShadow & BoxBackground & BoxColors & BoxCursor & BoxZIndex & BoxOverflow & BoxOpacity & BoxFont & BoxText & BoxFlex & BoxOutline & BoxTransition & BoxUserSelect;
|
|
214
213
|
export type BoxStyles = BoxNormalStyles & Hovered<BoxNormalStyles> & Focused<BoxNormalStyles> & Activated<BoxNormalStyles>;
|
|
215
|
-
export declare const themeClasses:
|
|
214
|
+
export declare const themeClasses: Partial<Record<keyof BoxStyles, string>>;
|
|
216
215
|
export {};
|
package/utils/utils.mjs
CHANGED
|
@@ -1,92 +1,102 @@
|
|
|
1
|
-
const
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
const h = {
|
|
2
|
+
hover: "_h",
|
|
3
|
+
focus: "_f",
|
|
4
|
+
shadow: "shadow_",
|
|
5
|
+
shadowH: "shadow_h_",
|
|
6
|
+
shadowF: "shadow_f_",
|
|
7
|
+
shadowA: "shadow_a_",
|
|
8
|
+
background: "bg_",
|
|
9
|
+
backgroundH: "bg_h_",
|
|
10
|
+
backgroundF: "bg_f_",
|
|
11
|
+
backgroundA: "bg_a_",
|
|
12
|
+
bg: "bg_",
|
|
13
|
+
bgH: "bg_h_",
|
|
14
|
+
bgF: "bg_f_",
|
|
15
|
+
bgA: "bg_a_",
|
|
16
|
+
color: "color_",
|
|
17
|
+
colorH: "color_h_",
|
|
18
|
+
colorF: "color_f_",
|
|
19
|
+
colorA: "color_a_",
|
|
20
|
+
backgroundColor: "bgColor_",
|
|
21
|
+
backgroundColorH: "bgColor_h_",
|
|
22
|
+
backgroundColorF: "bgColor_f_",
|
|
23
|
+
backgroundColorA: "bgColor_a_",
|
|
24
|
+
bgColor: "bgColor_",
|
|
25
|
+
bgColorH: "bgColor_h_",
|
|
26
|
+
bgColorF: "bgColor_f_",
|
|
27
|
+
bgColorA: "bgColor_a_",
|
|
28
|
+
borderColor: "borderColor_",
|
|
29
|
+
borderColorH: "borderColor_h_",
|
|
30
|
+
borderColorF: "borderColor_f_",
|
|
31
|
+
borderColorA: "borderColor_a_",
|
|
32
|
+
outlineColor: "outlineColor_",
|
|
33
|
+
outlineColorH: "outlineColor_h_",
|
|
34
|
+
outlineColorF: "outlineColor_f_",
|
|
35
|
+
outlineColorA: "outlineColor_a_"
|
|
36
|
+
};
|
|
37
|
+
var a;
|
|
38
|
+
((b) => {
|
|
39
|
+
function s(...n) {
|
|
40
|
+
return n.reduce((l, r) => r ? typeof r == "string" ? (l.push(r), l) : Array.isArray(r) ? (l.push(...s(...r)), l) : (Object.entries(r).forEach(([e, t]) => {
|
|
41
|
+
t && l.push(e);
|
|
42
|
+
}), l) : l, []);
|
|
33
43
|
}
|
|
34
|
-
|
|
35
|
-
})(
|
|
36
|
-
const
|
|
37
|
-
var
|
|
38
|
-
((
|
|
39
|
-
function
|
|
40
|
-
const
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
}), [
|
|
44
|
+
b.classNames = s;
|
|
45
|
+
})(a || (a = {}));
|
|
46
|
+
const f = a;
|
|
47
|
+
var d;
|
|
48
|
+
((b) => {
|
|
49
|
+
function s(n, ...l) {
|
|
50
|
+
const r = { ...n }, e = {};
|
|
51
|
+
return l.forEach((t) => {
|
|
52
|
+
t in r && (e[t] = r[t], delete r[t]);
|
|
53
|
+
}), [e, r];
|
|
44
54
|
}
|
|
45
|
-
|
|
46
|
-
})(
|
|
47
|
-
const
|
|
48
|
-
var
|
|
49
|
-
((
|
|
50
|
-
function
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
return
|
|
55
|
+
b.moveToTagProps = s;
|
|
56
|
+
})(d || (d = {}));
|
|
57
|
+
const p = d;
|
|
58
|
+
var C;
|
|
59
|
+
((b) => {
|
|
60
|
+
function s(l) {
|
|
61
|
+
const r = Array.from(l.elements).reduce((e, t) => {
|
|
62
|
+
const o = t.name;
|
|
63
|
+
return o && (e[o] || (e[o] = []), e[o].push(t)), e;
|
|
54
64
|
}, {});
|
|
55
|
-
return Object.entries(
|
|
56
|
-
if (
|
|
57
|
-
const
|
|
58
|
-
|
|
65
|
+
return Object.entries(r).reduce((e, [t, o]) => {
|
|
66
|
+
if (o.length === 1) {
|
|
67
|
+
const _ = o[0];
|
|
68
|
+
n(e, t, _.type === "checkbox" || _.type === "radio" ? _.checked : _.value);
|
|
59
69
|
} else {
|
|
60
|
-
const
|
|
61
|
-
|
|
70
|
+
const _ = o.reduce((i, c) => (c.type === "checkbox" || c.type === "radio" ? c.checked && i.push(c.value) : i.push(c.value), i), []);
|
|
71
|
+
n(e, t, _);
|
|
62
72
|
}
|
|
63
|
-
return
|
|
73
|
+
return e;
|
|
64
74
|
}, {});
|
|
65
75
|
}
|
|
66
|
-
|
|
67
|
-
function
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
let
|
|
71
|
-
|
|
72
|
-
if (
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
const [,
|
|
76
|
-
|
|
76
|
+
b.getFormEntries = s;
|
|
77
|
+
function n(l, r, e) {
|
|
78
|
+
if (r.includes(".")) {
|
|
79
|
+
const t = r.split(".");
|
|
80
|
+
let o = l;
|
|
81
|
+
t.forEach((_, i) => {
|
|
82
|
+
if (t.length > i + 1) {
|
|
83
|
+
const c = _.match(/^(.+)\[(\d)\]$/);
|
|
84
|
+
if (c) {
|
|
85
|
+
const [, u, g] = c;
|
|
86
|
+
o[u] = o[u] || [], o[u][g] = o[u][g] || {}, o = o[u][g];
|
|
77
87
|
} else
|
|
78
|
-
|
|
88
|
+
o[_] = o[_] || {}, o = o[_];
|
|
79
89
|
} else
|
|
80
|
-
|
|
90
|
+
o[_] = e;
|
|
81
91
|
});
|
|
82
92
|
} else
|
|
83
|
-
|
|
93
|
+
l[r] = e;
|
|
84
94
|
}
|
|
85
|
-
})(
|
|
86
|
-
const
|
|
95
|
+
})(C || (C = {}));
|
|
96
|
+
const F = C;
|
|
87
97
|
export {
|
|
88
|
-
C,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
98
|
+
f as C,
|
|
99
|
+
F,
|
|
100
|
+
p as O,
|
|
101
|
+
h as t
|
|
92
102
|
};
|