@cronocode/react-box 1.2.3 → 1.2.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 (33) hide show
  1. package/box.mjs +6 -6
  2. package/buildHelpers/mixins/boxStyles.d.ts +4 -0
  3. package/buildHelpers/mixins/svgStyles.d.ts +4 -0
  4. package/buildHelpers/plugins/moduleCssPlugin.d.ts +2 -0
  5. package/components/baseSvg.mjs +2 -22
  6. package/components/buttonCore.mjs +8 -11
  7. package/components/checkboxCore.mjs +7 -10
  8. package/components/flex.mjs +2 -9
  9. package/components/formAsync.mjs +4 -15
  10. package/components/radioButtonCore.mjs +6 -9
  11. package/components/textareaCore.mjs +7 -10
  12. package/components/textboxCore.mjs +7 -10
  13. package/dev/main.d.ts +0 -0
  14. package/package.json +18 -13
  15. package/{components → src/components}/buttonCore.d.ts +1 -0
  16. package/{components → src/components}/flex.d.ts +2 -1
  17. package/{components → src/components}/formAsync.d.ts +2 -1
  18. package/src/components/textbox.d.ts +26 -0
  19. package/src/index.d.ts +0 -0
  20. package/src/theme.d.ts +25 -0
  21. package/src/utils/object/objectUtils.d.ts +445 -0
  22. package/style.css +1 -1
  23. package/utils/utils.mjs +51 -56
  24. package/utils/object/objectUtils.d.ts +0 -4
  25. /package/{box.d.ts → src/box.d.ts} +0 -0
  26. /package/{components → src/components}/baseSvg.d.ts +0 -0
  27. /package/{components → src/components}/checkboxCore.d.ts +0 -0
  28. /package/{components → src/components}/radioButtonCore.d.ts +0 -0
  29. /package/{components → src/components}/textareaCore.d.ts +0 -0
  30. /package/{components → src/components}/textboxCore.d.ts +0 -0
  31. /package/{types.d.ts → src/types.d.ts} +0 -0
  32. /package/{utils → src/utils}/className/classNameUtils.d.ts +0 -0
  33. /package/{utils → src/utils}/form/formUtils.d.ts +0 -0
package/utils/utils.mjs CHANGED
@@ -33,80 +33,75 @@ const C = {
33
33
  outlineColorH: "outlineColor_h_",
34
34
  outlineColorF: "outlineColor_f_",
35
35
  outlineColorA: "outlineColor_a_"
36
- }, d = {
37
- fill: "fill_",
38
- fillH: "fill_h_",
39
- fillF: "fill_f_",
40
- fillA: "fill_a_",
41
- stroke: "stroke_",
42
- strokeH: "stroke_h_",
43
- strokeF: "stroke_f_",
44
- strokeA: "stroke_a_"
45
36
  };
46
- var g;
47
- ((n) => {
48
- function c(...i) {
49
- return i.reduce((t, r) => r ? typeof r == "string" ? (t.push(r), t) : Array.isArray(r) ? (t.push(...c(...r)), t) : (Object.entries(r).forEach(([e, l]) => {
50
- l && t.push(e);
37
+ var a;
38
+ ((c) => {
39
+ function s(...i) {
40
+ return i.reduce((t, _) => _ ? typeof _ == "string" ? (t.push(_), t) : Array.isArray(_) ? (t.push(...s(..._)), t) : (Object.entries(_).forEach(([r, e]) => {
41
+ e && t.push(r);
51
42
  }), t) : t, []);
52
43
  }
53
- n.classNames = c;
54
- })(g || (g = {}));
55
- const p = g;
56
- var u;
57
- ((n) => {
58
- function c(i, ...t) {
59
- const r = { ...i }, e = {};
60
- return t.forEach((l) => {
61
- l in r && (e[l] = r[l], delete r[l]);
44
+ c.classNames = s;
45
+ })(a || (a = {}));
46
+ const f = a;
47
+ var d;
48
+ ((c) => {
49
+ function s(t, ..._) {
50
+ const r = { ...t }, e = {};
51
+ return _.forEach((o) => {
52
+ o in r && (e[o] = r[o], delete r[o]);
62
53
  }), [e, r];
63
54
  }
64
- n.moveToTagProps = c;
65
- })(u || (u = {}));
66
- const k = u;
55
+ c.moveToTagProps = s;
56
+ function i(t, _, r) {
57
+ const e = { ...r, ...t }, o = { ...t.props };
58
+ return _.forEach((l) => {
59
+ l in e && (o[l] = e[l], delete e[l]);
60
+ }), e.props = o, e;
61
+ }
62
+ c.buildProps = i;
63
+ })(d || (d = {}));
64
+ const p = d;
67
65
  var h;
68
- ((n) => {
69
- function c(t) {
70
- const r = Array.from(t.elements).reduce((e, l) => {
71
- const o = l.name;
72
- return o && (e[o] || (e[o] = []), e[o].push(l)), e;
66
+ ((c) => {
67
+ function s(t) {
68
+ const _ = Array.from(t.elements).reduce((r, e) => {
69
+ const o = e.name;
70
+ return o && (r[o] || (r[o] = []), r[o].push(e)), r;
73
71
  }, {});
74
- return Object.entries(r).reduce((e, [l, o]) => {
72
+ return Object.entries(_).reduce((r, [e, o]) => {
75
73
  if (o.length === 1) {
76
- const _ = o[0];
77
- i(e, l, _.type === "checkbox" || _.type === "radio" ? _.checked : _.value);
74
+ const l = o[0];
75
+ i(r, e, l.type === "checkbox" || l.type === "radio" ? l.checked : l.value);
78
76
  } else {
79
- const _ = o.reduce((b, s) => (s.type === "checkbox" || s.type === "radio" ? s.checked && b.push(s.value) : b.push(s.value), b), []);
80
- i(e, l, _);
77
+ const l = o.reduce((b, n) => (n.type === "checkbox" || n.type === "radio" ? n.checked && b.push(n.value) : b.push(n.value), b), []);
78
+ i(r, e, l);
81
79
  }
82
- return e;
80
+ return r;
83
81
  }, {});
84
82
  }
85
- n.getFormEntries = c;
86
- function i(t, r, e) {
87
- if (r.includes(".")) {
88
- const l = r.split(".");
83
+ c.getFormEntries = s;
84
+ function i(t, _, r) {
85
+ if (_.includes(".")) {
86
+ const e = _.split(".");
89
87
  let o = t;
90
- l.forEach((_, b) => {
91
- if (l.length > b + 1) {
92
- const s = _.match(/^(.+)\[(\d)\]$/);
93
- if (s) {
94
- const [, a, f] = s;
95
- o[a] = o[a] || [], o[a][f] = o[a][f] || {}, o = o[a][f];
88
+ e.forEach((l, b) => {
89
+ if (e.length > b + 1) {
90
+ const n = l.match(/^(.+)\[(\d)\]$/);
91
+ if (n) {
92
+ const [, u, g] = n;
93
+ o[u] = o[u] || [], o[u][g] = o[u][g] || {}, o = o[u][g];
96
94
  } else
97
- o[_] = o[_] || {}, o = o[_];
95
+ o[l] = o[l] || {}, o = o[l];
98
96
  } else
99
- o[_] = e;
97
+ o[l] = r;
100
98
  });
101
99
  } else
102
- t[r] = e;
100
+ t[_] = r;
103
101
  }
104
102
  })(h || (h = {}));
105
- const F = h;
106
103
  export {
107
- p as C,
108
- F,
109
- k as O,
110
- C as a,
111
- d as t
104
+ f as C,
105
+ p as O,
106
+ C as t
112
107
  };
@@ -1,4 +0,0 @@
1
- declare namespace ObjectUtils {
2
- function moveToTagProps<T extends Object, TKey extends keyof T>(props: T, ...keys: TKey[]): Record<TKey, T[TKey]>[];
3
- }
4
- export default ObjectUtils;
File without changes
File without changes
File without changes
File without changes
File without changes