@cronocode/react-box 1.0.1 → 1.0.3
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.js +9 -9
- package/box.module.css.js +2 -2
- package/components/uncontrolledCheckboxCore.d.ts +3 -2
- package/components/uncontrolledCheckboxCore.js +18 -16
- package/components/uncontrolledRadioButtonCore.d.ts +3 -2
- package/components/uncontrolledRadioButtonCore.js +17 -15
- package/components/uncontrolledTextareaCore.d.ts +5 -4
- package/components/uncontrolledTextareaCore.js +35 -33
- package/components/uncontrolledTextboxCore.d.ts +3 -2
- package/components/uncontrolledTextboxCore.js +32 -30
- package/package.json +1 -1
- package/style.css +1 -1
- package/types.d.ts +10 -21
- package/utils/utils.js +54 -27
package/types.d.ts
CHANGED
|
@@ -21,14 +21,8 @@ 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", "
|
|
24
|
+
baseColors: readonly ["none", "transparent", "black", "white", "blue", "red", "purple", "yellow", "pink", "green", "orange", "navy", "teal", "violet", "gray", "brown", "orange"];
|
|
25
25
|
borderSizes: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
26
|
-
fontColors: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
27
|
-
bgColors: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
28
|
-
borderColors: readonly [1, 2, 3, 4, 5];
|
|
29
|
-
outlineColors: readonly [1, 2, 3, 4, 5];
|
|
30
|
-
backgrounds: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
31
|
-
shadows: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
32
26
|
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];
|
|
33
27
|
fontWeight: readonly [100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
34
28
|
zIndexSizes: readonly [1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15, 100, 101, 102, 103, 104, 105, 1000, 1001, 1002, 1003, 1004, 1005];
|
|
@@ -49,12 +43,6 @@ declare type BoxSizeValue = (typeof styleVariables.sizeSpecialValues)[number];
|
|
|
49
43
|
declare type BorderSizeType = (typeof styleVariables.borderSizes)[number];
|
|
50
44
|
declare type SizeType = (typeof styleVariables.sizes)[number];
|
|
51
45
|
declare type ColorType = (typeof styleVariables.baseColors)[number];
|
|
52
|
-
declare type BaseFontColorType = (typeof styleVariables.fontColors)[number];
|
|
53
|
-
declare type BaseBgColorType = (typeof styleVariables.bgColors)[number];
|
|
54
|
-
declare type BaseBorderColorType = (typeof styleVariables.borderColors)[number];
|
|
55
|
-
declare type BaseOutlineColorType = (typeof styleVariables.outlineColors)[number];
|
|
56
|
-
declare type BackgroundType = (typeof styleVariables.backgrounds)[number];
|
|
57
|
-
declare type ShadowType = (typeof styleVariables.shadows)[number];
|
|
58
46
|
declare type CursorType = (typeof styleVariables.cursors)[number];
|
|
59
47
|
declare type OverflowType = (typeof styleVariables.overflows)[number];
|
|
60
48
|
declare type FontSizeType = (typeof styleVariables.fontSizes)[number];
|
|
@@ -156,18 +144,18 @@ interface BoxBorder {
|
|
|
156
144
|
borderRadiusBottomRight?: SizeType;
|
|
157
145
|
}
|
|
158
146
|
interface BoxShadow {
|
|
159
|
-
shadow?:
|
|
147
|
+
shadow?: string;
|
|
160
148
|
}
|
|
161
149
|
interface BoxBackground {
|
|
162
|
-
background?:
|
|
163
|
-
bg?:
|
|
150
|
+
background?: string;
|
|
151
|
+
bg?: string;
|
|
164
152
|
}
|
|
165
153
|
interface BoxColors {
|
|
166
|
-
color?: ColorType |
|
|
167
|
-
backgroundColor?: ColorType |
|
|
168
|
-
bgColor?: ColorType |
|
|
169
|
-
borderColor?: ColorType |
|
|
170
|
-
outlineColor?: ColorType |
|
|
154
|
+
color?: ColorType | string;
|
|
155
|
+
backgroundColor?: ColorType | string;
|
|
156
|
+
bgColor?: ColorType | string;
|
|
157
|
+
borderColor?: ColorType | string;
|
|
158
|
+
outlineColor?: ColorType | string;
|
|
171
159
|
}
|
|
172
160
|
interface BoxCursor {
|
|
173
161
|
cursor?: CursorType;
|
|
@@ -212,4 +200,5 @@ interface BoxFlex {
|
|
|
212
200
|
}
|
|
213
201
|
declare type BoxNormalStyles = BoxPseudoClasses & BoxDisplay & BoxSizing & BoxPosition & BoxSize & BoxMargin & BoxPadding & BoxBorder & BoxShadow & BoxBackground & BoxColors & BoxCursor & BoxZIndex & BoxOverflow & BoxOpacity & BoxFont & BoxText & BoxFlex & BoxOutline;
|
|
214
202
|
export declare type BoxStyles = BoxNormalStyles & Hovered<BoxNormalStyles> & Focused<BoxNormalStyles> & Activated<BoxNormalStyles>;
|
|
203
|
+
export declare const themeClasses: Array<keyof BoxStyles>;
|
|
215
204
|
export {};
|
package/utils/utils.js
CHANGED
|
@@ -1,36 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
const a = [
|
|
2
|
+
"shadow",
|
|
3
|
+
"shadowH",
|
|
4
|
+
"shadowA",
|
|
5
|
+
"background",
|
|
6
|
+
"backgroundH",
|
|
7
|
+
"backgroundA",
|
|
8
|
+
"bg",
|
|
9
|
+
"bgH",
|
|
10
|
+
"bgA",
|
|
11
|
+
"color",
|
|
12
|
+
"colorH",
|
|
13
|
+
"colorA",
|
|
14
|
+
"backgroundColor",
|
|
15
|
+
"backgroundColorH",
|
|
16
|
+
"backgroundColorA",
|
|
17
|
+
"bgColor",
|
|
18
|
+
"bgColorH",
|
|
19
|
+
"bgColorA",
|
|
20
|
+
"borderColor",
|
|
21
|
+
"borderColorH",
|
|
22
|
+
"borderColorA",
|
|
23
|
+
"outlineColor",
|
|
24
|
+
"outlineColorH",
|
|
25
|
+
"outlineColorA"
|
|
26
|
+
];
|
|
11
27
|
var n;
|
|
12
|
-
((
|
|
13
|
-
function u(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
28
|
+
((i) => {
|
|
29
|
+
function u(...s) {
|
|
30
|
+
return s.reduce((t, r) => typeof r == "string" ? (t.push(r), t) : Array.isArray(r) ? (t.push(...u(...r)), t) : (Object.entries(r).forEach(([e, o]) => {
|
|
31
|
+
o && t.push(e);
|
|
32
|
+
}), t), []);
|
|
33
|
+
}
|
|
34
|
+
i.classNames = u;
|
|
35
|
+
})(n || (n = {}));
|
|
36
|
+
const g = n;
|
|
37
|
+
var l;
|
|
38
|
+
((i) => {
|
|
39
|
+
function u(s) {
|
|
40
|
+
const t = Array.from(s.elements).reduce((r, e) => {
|
|
41
|
+
const o = e.name;
|
|
42
|
+
return o && (r[o] || (r[o] = []), r[o].push(e)), r;
|
|
17
43
|
}, {});
|
|
18
|
-
return Object.entries(
|
|
19
|
-
if (
|
|
20
|
-
const
|
|
21
|
-
r[
|
|
44
|
+
return Object.entries(t).reduce((r, [e, o]) => {
|
|
45
|
+
if (o.length === 1) {
|
|
46
|
+
const c = o[0];
|
|
47
|
+
r[e] = c.type === "checkbox" || c.type === "radio" ? c.checked : c.value;
|
|
22
48
|
} else
|
|
23
|
-
r[
|
|
24
|
-
var
|
|
25
|
-
|
|
49
|
+
r[e] = [], o.forEach((c) => {
|
|
50
|
+
var d;
|
|
51
|
+
c.type === "checkbox" ? c.checked && r[e].push(c.value) : c.type === "radio" ? r[e] = (d = o.find((h) => h.checked)) == null ? void 0 : d.value : r[e].push(c.value);
|
|
26
52
|
});
|
|
27
53
|
return r;
|
|
28
54
|
}, {});
|
|
29
55
|
}
|
|
30
|
-
|
|
31
|
-
})(
|
|
32
|
-
const
|
|
56
|
+
i.getFormEntries = u;
|
|
57
|
+
})(l || (l = {}));
|
|
58
|
+
const C = l;
|
|
33
59
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
60
|
+
g as C,
|
|
61
|
+
C as F,
|
|
62
|
+
a as t
|
|
36
63
|
};
|