@cronocode/react-box 1.1.2 → 1.1.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.
- package/{box.js → box.mjs} +2 -2
- package/components/{baseSvg.js → baseSvg.mjs} +1 -1
- package/components/buttonCore.mjs +12 -0
- package/components/flex.mjs +12 -0
- package/components/formAsync.mjs +16 -0
- package/components/uncontrolledCheckboxCore.mjs +27 -0
- package/components/uncontrolledRadioButtonCore.mjs +27 -0
- package/components/uncontrolledTextareaCore.mjs +44 -0
- package/components/uncontrolledTextboxCore.mjs +40 -0
- package/package.json +7 -7
- package/components/buttonCore.js +0 -11
- package/components/flex.js +0 -11
- package/components/formAsync.js +0 -15
- package/components/uncontrolledCheckboxCore.js +0 -26
- package/components/uncontrolledRadioButtonCore.js +0 -26
- package/components/uncontrolledTextareaCore.js +0 -43
- package/components/uncontrolledTextboxCore.js +0 -39
- /package/{box.module.css.js → box.module.css.mjs} +0 -0
- /package/utils/{utils.js → utils.mjs} +0 -0
package/{box.js → box.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import x, { useState as N } from "react";
|
|
2
|
-
import { c as a } from "./box.module.css.
|
|
3
|
-
import { C as b, t as g } from "./utils/utils.
|
|
2
|
+
import { c as a } from "./box.module.css.mjs";
|
|
3
|
+
import { C as b, t as g } from "./utils/utils.mjs";
|
|
4
4
|
function H(c) {
|
|
5
5
|
const { tag: m, children: s, props: u, className: n, style: p } = c, e = n ? b.classNames(n, a.box) : [a.box];
|
|
6
6
|
Object.entries(c).forEach(([o, i]) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import g, { useState as w } from "react";
|
|
2
|
-
import { C as v } from "../utils/utils.
|
|
2
|
+
import { C as v } from "../utils/utils.mjs";
|
|
3
3
|
const s = { base: "cLD", fillnone: "cLE", fillHnone: "cLF", hovertrue: "d", filltransparent: "cLG", fillHtransparent: "cLH", fillblack: "cLI", fillHblack: "cLJ", fillwhite: "cLK", fillHwhite: "cLL", fillblue: "cLM", fillHblue: "cLN", fillred: "cLO", fillHred: "cLP", fillpurple: "cLQ", fillHpurple: "cLR", fillyellow: "cLS", fillHyellow: "cLT", fillpink: "cLU", fillHpink: "cLV", fillgreen: "cLW", fillHgreen: "cLX", fillorange: "cLY", fillHorange: "cLZ", fillnavy: "cL0", fillHnavy: "cL1", fillteal: "cL2", fillHteal: "cL3", fillviolet: "cL4", fillHviolet: "cL5", fillgray: "cL6", fillHgray: "cL7", fillbrown: "cL8", fillHbrown: "cL9", strokenone: "cMa", strokeHnone: "cMb", stroketransparent: "cMc", strokeHtransparent: "cMd", strokeblack: "cMe", strokeHblack: "cMf", strokewhite: "cMg", strokeHwhite: "cMh", strokeblue: "cMi", strokeHblue: "cMj", strokered: "cMk", strokeHred: "cMl", strokepurple: "cMm", strokeHpurple: "cMn", strokeyellow: "cMo", strokeHyellow: "cMp", strokepink: "cMq", strokeHpink: "cMr", strokegreen: "cMs", strokeHgreen: "cMt", strokeorange: "cMu", strokeHorange: "cMv", strokenavy: "cMw", strokeHnavy: "cMx", stroketeal: "cMy", strokeHteal: "cMz", strokeviolet: "cMA", strokeHviolet: "cMB", strokegray: "cMC", strokeHgray: "cMD", strokebrown: "cME", strokeHbrown: "cMF", rotate0: "cMG", rotateH0: "cMH", rotate90: "cMI", rotateH90: "cMJ", rotate180: "cMK", rotateH180: "cML", rotate270: "cMM", rotateH270: "cMN", flipxAxis: "cMO", flipHxAxis: "cMP", flipyAxis: "cMQ", flipHyAxis: "cMR" }, b = ["fill", "fillH", "stroke", "strokeH"];
|
|
4
4
|
function m(o) {
|
|
5
5
|
const { children: e, props: M, className: r, style: H, viewBox: k, width: L, height: p } = o, l = r ? v.classNames(r, s.base) : [s.base];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import u from "../box.mjs";
|
|
3
|
+
import "react";
|
|
4
|
+
import "../box.module.css.mjs";
|
|
5
|
+
import "../utils/utils.mjs";
|
|
6
|
+
function l(t) {
|
|
7
|
+
const { tag: o, type: r, onClick: n, disabled: p, props: e } = t, i = { ...e, type: r || "button", onClick: n, disabled: p };
|
|
8
|
+
return /* @__PURE__ */ s(u, { tag: o || "button", cursor: "pointer", inline: !0, ...t, props: i });
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
l as default
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import r from "../box.mjs";
|
|
3
|
+
import "react";
|
|
4
|
+
import "../box.module.css.mjs";
|
|
5
|
+
import "../utils/utils.mjs";
|
|
6
|
+
function x(i) {
|
|
7
|
+
const { inline: o } = i;
|
|
8
|
+
return /* @__PURE__ */ t(r, { display: o ? "inline-flex" : "flex", ...i });
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
x as default
|
|
12
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as p, useCallback as u } from "react";
|
|
3
|
+
import a from "../box.mjs";
|
|
4
|
+
import { F as c } from "../utils/utils.mjs";
|
|
5
|
+
import "../box.module.css.mjs";
|
|
6
|
+
function S(o) {
|
|
7
|
+
const { onSubmit: m, props: n } = o, r = p(null), s = u((t) => {
|
|
8
|
+
t.preventDefault();
|
|
9
|
+
const f = c.getFormEntries(r.current);
|
|
10
|
+
m(f, t);
|
|
11
|
+
}, []), e = { ...n, onSubmit: s, ref: r };
|
|
12
|
+
return /* @__PURE__ */ i(a, { tag: "form", ...o, props: e });
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
S as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as h } from "react";
|
|
3
|
+
import x from "../box.mjs";
|
|
4
|
+
import "../box.module.css.mjs";
|
|
5
|
+
import "../utils/utils.mjs";
|
|
6
|
+
function C(o, e) {
|
|
7
|
+
const { props: r, name: t, disabled: n, placeholder: a, value: p, onInput: c, onChange: l, autoFocus: u, readOnly: d, required: i, defaultChecked: s } = o, m = {
|
|
8
|
+
...r,
|
|
9
|
+
type: "checkbox",
|
|
10
|
+
name: t,
|
|
11
|
+
disabled: n,
|
|
12
|
+
placeholder: a,
|
|
13
|
+
onInput: c,
|
|
14
|
+
onChange: l,
|
|
15
|
+
value: p,
|
|
16
|
+
autoFocus: u,
|
|
17
|
+
readOnly: d,
|
|
18
|
+
required: i,
|
|
19
|
+
defaultChecked: s,
|
|
20
|
+
ref: e
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ f(x, { tag: "input", inline: !0, ...o, props: m });
|
|
23
|
+
}
|
|
24
|
+
const P = h(C);
|
|
25
|
+
export {
|
|
26
|
+
P as default
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as g } from "react";
|
|
3
|
+
import C from "../box.mjs";
|
|
4
|
+
import "../box.module.css.mjs";
|
|
5
|
+
import "../utils/utils.mjs";
|
|
6
|
+
function h(o, r) {
|
|
7
|
+
const { props: t, name: e, disabled: n, placeholder: a, value: d, onInput: i, onChange: p, autoFocus: u, readOnly: l, required: s, defaultChecked: c } = o, m = {
|
|
8
|
+
...t,
|
|
9
|
+
type: "radio",
|
|
10
|
+
name: e,
|
|
11
|
+
disabled: n,
|
|
12
|
+
placeholder: a,
|
|
13
|
+
onInput: i,
|
|
14
|
+
onChange: p,
|
|
15
|
+
value: d,
|
|
16
|
+
autoFocus: u,
|
|
17
|
+
readOnly: l,
|
|
18
|
+
required: s,
|
|
19
|
+
defaultChecked: c,
|
|
20
|
+
ref: r
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ f(C, { tag: "input", inline: !0, ...o, props: m });
|
|
23
|
+
}
|
|
24
|
+
const P = g(h);
|
|
25
|
+
export {
|
|
26
|
+
P as default
|
|
27
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as w } from "react";
|
|
3
|
+
import C from "../box.mjs";
|
|
4
|
+
import "../box.module.css.mjs";
|
|
5
|
+
import "../utils/utils.mjs";
|
|
6
|
+
function T(o, e) {
|
|
7
|
+
const {
|
|
8
|
+
props: r,
|
|
9
|
+
name: t,
|
|
10
|
+
disabled: n,
|
|
11
|
+
placeholder: a,
|
|
12
|
+
defaultValue: l,
|
|
13
|
+
onInput: p,
|
|
14
|
+
onChange: s,
|
|
15
|
+
rows: i,
|
|
16
|
+
cols: m,
|
|
17
|
+
autoFocus: u,
|
|
18
|
+
maxLength: d,
|
|
19
|
+
minLength: c,
|
|
20
|
+
readOnly: f,
|
|
21
|
+
required: x
|
|
22
|
+
} = o, g = {
|
|
23
|
+
...r,
|
|
24
|
+
name: t,
|
|
25
|
+
disabled: n,
|
|
26
|
+
placeholder: a,
|
|
27
|
+
onInput: p,
|
|
28
|
+
onChange: s,
|
|
29
|
+
defaultValue: l,
|
|
30
|
+
rows: i,
|
|
31
|
+
cols: m,
|
|
32
|
+
autoFocus: u,
|
|
33
|
+
maxLength: d,
|
|
34
|
+
minLength: c,
|
|
35
|
+
readOnly: f,
|
|
36
|
+
required: x,
|
|
37
|
+
ref: e
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ h(C, { tag: "textarea", inline: !0, ...o, props: g });
|
|
40
|
+
}
|
|
41
|
+
const y = w(T);
|
|
42
|
+
export {
|
|
43
|
+
y as default
|
|
44
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as g } from "react";
|
|
3
|
+
import b from "../box.mjs";
|
|
4
|
+
import "../box.module.css.mjs";
|
|
5
|
+
import "../utils/utils.mjs";
|
|
6
|
+
function y(o, t) {
|
|
7
|
+
const {
|
|
8
|
+
props: e,
|
|
9
|
+
name: r,
|
|
10
|
+
type: n,
|
|
11
|
+
disabled: p,
|
|
12
|
+
placeholder: a,
|
|
13
|
+
defaultValue: l,
|
|
14
|
+
onInput: u,
|
|
15
|
+
onChange: i,
|
|
16
|
+
autoFocus: s,
|
|
17
|
+
readOnly: d,
|
|
18
|
+
required: m,
|
|
19
|
+
step: c
|
|
20
|
+
} = o, f = {
|
|
21
|
+
...e,
|
|
22
|
+
type: n || "text",
|
|
23
|
+
name: r,
|
|
24
|
+
disabled: p,
|
|
25
|
+
placeholder: a,
|
|
26
|
+
onInput: u,
|
|
27
|
+
onChange: i,
|
|
28
|
+
defaultValue: l,
|
|
29
|
+
autoFocus: s,
|
|
30
|
+
readOnly: d,
|
|
31
|
+
required: m,
|
|
32
|
+
step: c,
|
|
33
|
+
ref: t
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ x(b, { tag: "input", inline: !0, ...o, props: f });
|
|
36
|
+
}
|
|
37
|
+
const j = g(y);
|
|
38
|
+
export {
|
|
39
|
+
j as default
|
|
40
|
+
};
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cronocode/react-box",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"main": "./box.
|
|
5
|
-
"module": "./box.
|
|
3
|
+
"version": "1.1.4",
|
|
4
|
+
"main": "./box.mjs",
|
|
5
|
+
"module": "./box.mjs",
|
|
6
6
|
"types": "./box.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"import": "./box.
|
|
10
|
-
"require": "./box.
|
|
9
|
+
"import": "./box.mjs",
|
|
10
|
+
"require": "./box.mjs",
|
|
11
11
|
"types": "./box.d.ts"
|
|
12
12
|
},
|
|
13
13
|
"./style.css": "./style.css",
|
|
14
14
|
"./components/*": {
|
|
15
|
-
"import": "./components/*.
|
|
16
|
-
"require": "./components/*.
|
|
15
|
+
"import": "./components/*.mjs",
|
|
16
|
+
"require": "./components/*.mjs",
|
|
17
17
|
"types": "./components/*.d.ts"
|
|
18
18
|
}
|
|
19
19
|
},
|
package/components/buttonCore.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import a from "react";
|
|
2
|
-
import s from "../box.js";
|
|
3
|
-
import "../box.module.css.js";
|
|
4
|
-
import "../utils/utils.js";
|
|
5
|
-
function f(t) {
|
|
6
|
-
const { tag: o, type: r, onClick: e, disabled: n, props: p } = t, i = { ...p, type: r || "button", onClick: e, disabled: n };
|
|
7
|
-
return /* @__PURE__ */ a.createElement(s, { tag: o || "button", cursor: "pointer", inline: !0, ...t, props: i });
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
f as default
|
|
11
|
-
};
|
package/components/flex.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import i from "react";
|
|
2
|
-
import n from "../box.js";
|
|
3
|
-
import "../box.module.css.js";
|
|
4
|
-
import "../utils/utils.js";
|
|
5
|
-
function f(e) {
|
|
6
|
-
const { inline: t } = e;
|
|
7
|
-
return /* @__PURE__ */ i.createElement(n, { display: t ? "inline-flex" : "flex", ...e });
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
f as default
|
|
11
|
-
};
|
package/components/formAsync.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import f, { useRef as c, useCallback as u } from "react";
|
|
2
|
-
import i from "../box.js";
|
|
3
|
-
import { F as p } from "../utils/utils.js";
|
|
4
|
-
import "../box.module.css.js";
|
|
5
|
-
function R(o) {
|
|
6
|
-
const { onSubmit: e, props: n } = o, t = c(null), m = u((r) => {
|
|
7
|
-
r.preventDefault();
|
|
8
|
-
const a = p.getFormEntries(t.current);
|
|
9
|
-
e(a, r);
|
|
10
|
-
}, []), s = { ...n, onSubmit: m, ref: t };
|
|
11
|
-
return /* @__PURE__ */ f.createElement(i, { tag: "form", ...o, props: s });
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
R as default
|
|
15
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import f, { forwardRef as h } from "react";
|
|
2
|
-
import C from "../box.js";
|
|
3
|
-
import "../box.module.css.js";
|
|
4
|
-
import "../utils/utils.js";
|
|
5
|
-
function x(e, o) {
|
|
6
|
-
const { props: r, name: t, disabled: n, placeholder: a, value: c, onInput: l, onChange: p, autoFocus: u, readOnly: d, required: i, defaultChecked: s } = e, m = {
|
|
7
|
-
...r,
|
|
8
|
-
type: "checkbox",
|
|
9
|
-
name: t,
|
|
10
|
-
disabled: n,
|
|
11
|
-
placeholder: a,
|
|
12
|
-
onInput: l,
|
|
13
|
-
onChange: p,
|
|
14
|
-
value: c,
|
|
15
|
-
autoFocus: u,
|
|
16
|
-
readOnly: d,
|
|
17
|
-
required: i,
|
|
18
|
-
defaultChecked: s,
|
|
19
|
-
ref: o
|
|
20
|
-
};
|
|
21
|
-
return /* @__PURE__ */ f.createElement(C, { tag: "input", inline: !0, ...e, props: m });
|
|
22
|
-
}
|
|
23
|
-
const y = h(x);
|
|
24
|
-
export {
|
|
25
|
-
y as default
|
|
26
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import f, { forwardRef as g } from "react";
|
|
2
|
-
import C from "../box.js";
|
|
3
|
-
import "../box.module.css.js";
|
|
4
|
-
import "../utils/utils.js";
|
|
5
|
-
function R(o, e) {
|
|
6
|
-
const { props: t, name: r, disabled: n, placeholder: a, value: d, onInput: u, onChange: i, autoFocus: l, readOnly: p, required: c, defaultChecked: s } = o, m = {
|
|
7
|
-
...t,
|
|
8
|
-
type: "radio",
|
|
9
|
-
name: r,
|
|
10
|
-
disabled: n,
|
|
11
|
-
placeholder: a,
|
|
12
|
-
onInput: u,
|
|
13
|
-
onChange: i,
|
|
14
|
-
value: d,
|
|
15
|
-
autoFocus: l,
|
|
16
|
-
readOnly: p,
|
|
17
|
-
required: c,
|
|
18
|
-
defaultChecked: s,
|
|
19
|
-
ref: e
|
|
20
|
-
};
|
|
21
|
-
return /* @__PURE__ */ f.createElement(C, { tag: "input", inline: !0, ...o, props: m });
|
|
22
|
-
}
|
|
23
|
-
const y = g(R);
|
|
24
|
-
export {
|
|
25
|
-
y as default
|
|
26
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import h, { forwardRef as w } from "react";
|
|
2
|
-
import C from "../box.js";
|
|
3
|
-
import "../box.module.css.js";
|
|
4
|
-
import "../utils/utils.js";
|
|
5
|
-
function T(e, o) {
|
|
6
|
-
const {
|
|
7
|
-
props: r,
|
|
8
|
-
name: t,
|
|
9
|
-
disabled: a,
|
|
10
|
-
placeholder: n,
|
|
11
|
-
defaultValue: l,
|
|
12
|
-
onInput: c,
|
|
13
|
-
onChange: p,
|
|
14
|
-
rows: s,
|
|
15
|
-
cols: u,
|
|
16
|
-
autoFocus: d,
|
|
17
|
-
maxLength: i,
|
|
18
|
-
minLength: m,
|
|
19
|
-
readOnly: f,
|
|
20
|
-
required: g
|
|
21
|
-
} = e, x = {
|
|
22
|
-
...r,
|
|
23
|
-
name: t,
|
|
24
|
-
disabled: a,
|
|
25
|
-
placeholder: n,
|
|
26
|
-
onInput: c,
|
|
27
|
-
onChange: p,
|
|
28
|
-
defaultValue: l,
|
|
29
|
-
rows: s,
|
|
30
|
-
cols: u,
|
|
31
|
-
autoFocus: d,
|
|
32
|
-
maxLength: i,
|
|
33
|
-
minLength: m,
|
|
34
|
-
readOnly: f,
|
|
35
|
-
required: g,
|
|
36
|
-
ref: o
|
|
37
|
-
};
|
|
38
|
-
return /* @__PURE__ */ h.createElement(C, { tag: "textarea", inline: !0, ...e, props: x });
|
|
39
|
-
}
|
|
40
|
-
const q = w(T);
|
|
41
|
-
export {
|
|
42
|
-
q as default
|
|
43
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import x, { forwardRef as g } from "react";
|
|
2
|
-
import b from "../box.js";
|
|
3
|
-
import "../box.module.css.js";
|
|
4
|
-
import "../utils/utils.js";
|
|
5
|
-
function y(e, t) {
|
|
6
|
-
const {
|
|
7
|
-
props: o,
|
|
8
|
-
name: r,
|
|
9
|
-
type: n,
|
|
10
|
-
disabled: a,
|
|
11
|
-
placeholder: p,
|
|
12
|
-
defaultValue: l,
|
|
13
|
-
onInput: u,
|
|
14
|
-
onChange: c,
|
|
15
|
-
autoFocus: d,
|
|
16
|
-
readOnly: i,
|
|
17
|
-
required: s,
|
|
18
|
-
step: m
|
|
19
|
-
} = e, f = {
|
|
20
|
-
...o,
|
|
21
|
-
type: n || "text",
|
|
22
|
-
name: r,
|
|
23
|
-
disabled: a,
|
|
24
|
-
placeholder: p,
|
|
25
|
-
onInput: u,
|
|
26
|
-
onChange: c,
|
|
27
|
-
defaultValue: l,
|
|
28
|
-
autoFocus: d,
|
|
29
|
-
readOnly: i,
|
|
30
|
-
required: s,
|
|
31
|
-
step: m,
|
|
32
|
-
ref: t
|
|
33
|
-
};
|
|
34
|
-
return /* @__PURE__ */ x.createElement(b, { tag: "input", inline: !0, ...e, props: f });
|
|
35
|
-
}
|
|
36
|
-
const P = g(y);
|
|
37
|
-
export {
|
|
38
|
-
P as default
|
|
39
|
-
};
|
|
File without changes
|
|
File without changes
|